If you're familiar with the Twilio Verify API, it uses basic authentication to send a One-Time PIN, and there is no token process. In order to use the Twilio Verify API as an External Service, I had to create a Legacy Named Credential that uses Anonymous Authentication. To further complicate things, the basic requirements are to send a URL Encoded 'To' address (phone number/email) and 'Channel' (SMS, Email, Phone, WhatsApp).
I wrote a quick RAML and posted it in our Mulesoft API Exchange, it imported nicely, and I'm able to add the Auth parameter and ServiceID, but I can't get any parameters to show up in the Flow Action for the 'To' and 'Channel' values. It's a pretty weird use case, not exactly fitting current External Service functionality, but any insight is welcome!
Dug through this with one of my Salesforce SMEs. Here are the fixes:
- Change Named Credential to password auth
- Remove Auth header from External Service
- Use the Apex Defined variable for the URL encoded parameters and pass that to the 'generated' field on the Action. This is what I initially overlooked.
- Do not specify any responses in the API spec in Mulesoft Exchange
For whatever reason, defining responses in the API spec caused Salesforce to fail parsing the response every time.