Tray Embedded / Connectivity APIs / Example use case
Example use case
On this page
The screenshot below shows a mockup of an interface you might create to make use of the above Twilio example.
This would allow your users to:
Select the service they wish to make use of
Select the operation they wish to make use of
Add any necessary inputs for the operation
The 'Service Connector' dropdown would make use of the Get Connectors endpoint (i.e. a GET request to
https://api.tray.io/core/v1/connectors
)The 'Operation' dropdown would make use of the Get Connector Operations endpoint (i.e. a GET request to
https://api.tray.io/core/v1/connectors/twilio-output/versions/2.1/operations
)The form fields would make use of the Call connector endpoint and the 'required' inputs (and any others as needed) as returned by 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/gmail/versions/3.4/call
with the body of the message being something like:
1{2"operation": "send_sms",3"authId": "9944xxx-xxxx-xxxx-xxxx-xxxx456fd0",4"input": {5"from": "+18577633299",6"to": "+447587123456",7"body": "Call connector is great!",8"media_url": "https://acmecorp-images.s3.eu-west-2.amazonaws.com/message.png",9"status_callback": "https://status.acmecorp.com"10}11}12