Using connectors and operations
info
This page will take you through what endpoints are involved in discovering and using connectors and their operations.
Please be sure to check out our Building a UI form tutorial for guidance on putting it all into practice!
Discovering connectors
The Get connectors endpoint will return all of the connectors that you have access to:
The response includes:
- connector name
- connector version
These can then be used with the Get connector operations endpoint to list the available operations within a particular connector.
So if your organization has access to Outreach and Twilio you would see the following:
{
"elements": [
{
"name": "outreach",
"version": "3.2",
"title": "Outreach",
"description": ""
},
{
"name": "twilio-output",
"version": "2.1",
"title": "Twilio",
"description": "Cloud communication platform for developers"
}
]
}
Discovering operations
The operations available within a connector can be identified using the Get connector operations endpoint.
So for Twilio the URL would be:
https://api.tray.io/core/v1/connectors/twilio-output/versions/2.1/operations
In the following sample response for Twilio, we have shown only the input schema for the 'Send SMS' operation.
You can use our Ops Explorer dev tool to get complete examples of operation lists and input and output schema:
{
"elements": [
{
"name": "send_sms",
"title": "Send SMS",
"description": "Send SMS.",
"inputSchema": {
"$schema": "https://api.tray.io/core/v1/connectors/operations/input-schema#",
"advanced": [],
"additionalProperties": false,
"type": "object",
"properties": {
"body": {
"type": "string",
"description": "The body of the SMS to send.",
"title": "Body"
},
"media_url": {
"type": "string",
"title": "Media URL",
"description": "This parameter specifies the URL of the media you want to include with your message, for sending an MMS message."
},
"to": {
"type": "string",
"description": "The phone number (including international code) to send the sms to.",
"title": "To"
},
"from": {
"type": "string",
"description": "The valid Twilio number (or authorised number) from which the sms message will appear.",
"title": "From"
},
"status_callback": {
"type": "string",
"title": "Status callback URL",
"description": "By including a StatusCallback URL in your API call, you can tell Twilio where to POST information about your message."
}
},
"required": ["to", "from", "body"]
},
"hasDynamicOutput": false,
"authScopes": []
}
]
}
Using operations
When making a call to a particular connector operation using the Call connector endpoint, the body needs to contain:
-
The
operation
that is being called -
The unique
authId
which identifies the End User and their auth credentials -
The required
input
as dictated by Tray's input schema for the connector being called
Using the Ops Explorer
Our in-browser Ops Explorer dev tool can help you quickly identify all of the above for any connector operation.
The following screenshot shows using it to obtain the required inputs for the Twilio 'Send SMS' operation:
Testing operations with the form builder demo
You can also download and run our Form Builder demo app to connect to your Tray Embedded account and run live tests of any operations you wish to use.
This will show you the input payload being built, and also the response coming from Tray and the 3rd party once you hit 'submit'
We also highly recommend you follow our Building a UI form tutorial which explains how this was built and will give you a great headstart in building your own integrations: