Example use case
The screenshot above shows a mockup of an interface you might create to make use of the Twilio connector.
This would allow your users to:
- Create an auth for the service in the integration using the auth-only dialog (or retrieve a pre-existing auth if they have already registered)
- Select the operation they wish to make use of
- Add any necessary inputs for the operation
- Submit the call to Twilio
In order to serve this form to your End Users, your backend setup should have:
- A 'users' database which stores user and auth ids (as generated by our Users API , Authentications API and auth-only dialog )
- An 'integrations' database which stores the service details for each of your integrations, including the auth and operation input schemas for the connectors being used (as retrieved from our Connectors API and Authentications API )
This setup will help maximize the consistency and efficiency of your application.
For more details, please see our 'Building integrations' guidance on storing users and integrations
Please also see our Building a UI form tutorial for quickstart guide to rendering a form as a UI.
The form fields would make use of the available inputs according to the Twilio input schema
Having retrieved the form details from the user, the final call to the connector would be a POST request to https://api.tray.io/core/v1/connectors/twilio-output/versions/2.1/call with the body of the message being something like:
{
"operation": "send_sms",
"authId": "9944xxx-xxxx-xxxx-xxxx-xxxx456fd0",
"input": {
"from": "+18577633299",
"to": "+447587123456",
"body": "Call connector is great!",
"media_url": "https://acmecorp-images.s3.eu-west-2.amazonaws.com/message.png",
"status_callback": "https://status.acmecorp.com"
}
}