This had me frustrated over past couple days, trying to find a solution to what should have been a simple issue, so thought I would drop a line to put something in to this pool of info that I draw out of so often.
Wanting to use Twilio Lookup tool to confirm phone numbers, using getURL.
The Twilio documentation shows:
'https://lookups.twilio.com/v1/PhoneNumbers/+19999999999?Type=carrier&Type=caller-name' -u 'YOURUSERACCOUNT:YOURAUTHTOKEN'
but the challenge become how to make the '-u YOURUSERACCOUNT:YOURAUTHTOKEN' part to work as I kept getting "invalid credentials" error, and I burned hours trying to get it working by map it into the header info of my getURL, but always same credentials error (even though I already proofed the credentials were fine)
no luck with Creator support and I'm convinced Twilio support is limited to some AI algorithm, as it seems like their response was ignoring what I sent
after much searching through Stack Overflow, here's the solution I found that works, by reconfiguring the URL:
https://YOURUSERACCOUNT:YOURAUTHTOKEN@lookups.twilio.com/v1/PhoneNumbers/+19999999999
note I've left off the '?Type=carrier&Type=caller-name' from their documentation, which which do work fine as optional parameters you can choose to include or not (adds small cost and not helpful in my case as I'm in Canada which has restrictions on that info being supplied so results are null anyway)
Twilio also has some additional Add-ons (add cost) that can also be used by first enabling on your Twilio account and then adding to the getURL, for example:
"?AddOns=ekata_reverse_phone"
(which did provide a fair amount of additional info even in Canada, but at a fairly high cost of $0.05/ea)
in Twilio dashboard you can also generate a specific set of SID:Token pair if you want to isolate this path from the rest of your Twilio account
probably obvious to the pro's out there, but hope that helps out some other low-coder like me