Error handling (Tray)


Overview

When calling operations using the Call connector endpoint you may experience errors associated with the input payload or with the authentication referenced by the authId.

If there are failures of validation, Tray will return 400, 403, 404 etc.

A 200 response means that the input payload and authentication have passed Tray's validation. This is not a guarantee of success however, as there may be an error response from the 3rd party. Please see our page on 3rd party error handling for more details.

A request payload for the Call connector endpoint conforms to the following general structure:

Copy
Copied
{
  "operation": "operation_name",
  "authId": "af75xxxx-xxxx-xxxx-xxxx-xxxx58c494c5",
  "input": {
    "input_field_1": "",
    "input_field_2": ""
  },
  "returnOutputSchema": false
}
info

The required inputs for an operation can be found in the inputSchema returned by the Get Connector Operations endpoint.

These input schemas can be very large and complex to navigate. Our Operations Explorer dev tool can help you quickly explore input schema for any connector operations.

You can also download our Form Builder Demo App to run live tests on

Our Form Builder tutorial offers guidance on using input schema in your applications.

Input errors

Missing required inputs

If any required inputs are missing (e.g. channel for the Slack send_messsage operation) a status of 400 Bad Request will be returned:

query (missing required 'channel' input)400 Bad Request
Copy
Copied
{
  "operation": "send_message",
  "authId": "af75xxxx-xxxx-xxxx-xxxx-xxxx58c494c5",
  "input": {
    "text": "Hello",
    "as_user": true
  },
  "returnOutputSchema": false
}
Copy
Copied
{
	"message": "Connector input validation failed. Schema validation errors:
    [ 1 - #: required key [channel] not found ]",
	"code": null
}

Wrong data type

If, for example, you make a call to Google Sheets get_rows and pass a string to number_of_rows you will receive a 400 Bad Request and a Connector input validation failed message:

query400 Bad Request
Copy
Copied
{
  "operation": "get_rows",
  "authId": "925aa19a-xxxx-xxxx-xxxx-966afc72acdc",
  "input": {
    "number_of_rows": "100",
    "spreadsheet_id": "13TF-oSSxxxxxxxxxxxxxxxxbMmgVIhfZ2a40",
    "worksheet_name": "Sheet1"
  },
  "returnOutputSchema": false
}
Copy
Copied
{
    "message": "Connector input validation failed. Schema validation errors:
    [ 1 - #/number_of_rows: expected type: Integer, found: String ]",
    "code": null
}
warning

Even though an input payload may pass all of Tray's validation, there may still be particular requirements or inconsistencies with the 3rd party which will give you errors or unusual responses.

Auth errors

Permissions

Suggests authId is found but does not have access to the service being called 403 forbidden

403 Forbidden'
Copy
Copied
{
  "message": "The request is forbidden",
  "code": null
}

Auth does not exist

No such auth exists:

400 Bad Request'
Copy
Copied
{
  "message": "Invalid value for: body (Couldn't decode a valid UUID at 'authId')",
  "code": null
}

Badly formed authId

Copy
Copied
{
	"message": "Invalid value for: body (Got value '\"5e7b53b2\"'
    with wrong type, expecting string at 'authId')",
	"code": null
}