AQuirky
AQuirky

Reputation: 5236

What are the restrictions on Twilio worker names?

I just now ran into a huge issue with Twilio Task Queue worker names. I had worker names like markh and ryanr and everything was working fine.

Then someone decided that workers names should be "Mark H" and "Ryan R" and everything started failing. It took me a while to figure out what was wrong.

You can create workers like "Mark H" and "Ryan R" in the task queue. There seems to be utterly no validation on what is entered for the friendly name. There is only a mysterious comment that hyphens are not supported in attribute values for task queue. Really? You can't use negative numbers in an attribute value? Really?

But spaces clearly do no work in worker names. The problem is that when Twilio makes a call to a worker, the destination is formatted as "client:Mark H" and apparently the H is lost somewhere along the way.

So my question is: what are the exact requirements for worker name. Can you use upper case? What special characters are allowed? How long can the name be? If upper case characters are allowed is "markh" distinct from "MarkH"? Can you use Unicode characters with umlauts and so on? I can't find anything in the Twilio Task Queue documentation about this.

Upvotes: 0

Views: 70

Answers (1)

GeekGlider
GeekGlider

Reputation: 11

I know this doesn't answer your specific questions but here is a possible solution for your issue. In my Workers section, the 'Attributes' contains the following:

{"contact_uri":"client:markh","full_name":"Mark H","email":"[email protected]"}

All in all, add 'Mark H' to the full_name section rather than the contact_uri section. Hope this helps!

New answer edit: After doing some digging at how my environment is set up, I think I found some information that might be useful for you. Me and my team are 'admin' roles and were created from invitation to the Twilio account. All other workers in the environment were created from our Azure AD domain (so I don't spill information, lets call my domain Google). The workers created from AD had the following:

{"contact_uri":"client:jdoe_40google_2Ecom","full_name":"John Doe","email":"[email protected]","roles":["agent"]}

So I looked into what _40 and _2E meant. And I found https://www.w3schools.com/tags/ref_urlencode.asp which shows you that the contact_uri requires UTF-8 format.

Upvotes: 2

Related Questions