Tray Platform / 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:

  1. Select the service they wish to make use of

  2. Select the operation they wish to make use of

  3. Add any necessary inputs for the operation

twilio-example-screenshot-v2
  1. 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)

  2. 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)

  3. 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:

{
"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"
}
}