Home / Basics / Highnote API

API Error Handling

Query Errors

The Highnote API rejects invalid queries and populates error information in the errors array. These errors are similar to compile-time errors and can be triggered if you send an invalid type or miss a required field.

In the case errors are present due to an invalid query, the API will return a 400 Bad Request response with the following body:

{
  "data": null,
  "errors": [
    {
      "message": "String cannot represent integer",
      "locations": [{ "line": 1, "column": 6 }],
      "path": []
    }
  ]
}

We recommend testing requests and queries in the Test Environment before using them in your Live Environment. You should see very few errors after testing in the Test Environment.

Validation and Logic Errors

When performing API operations, you could have invalid input even after testing in the Test Environment. Invalid input errors are represented as data in the userErrors field and are not present in errors.

Using data for errors allows Highnote to document and tailor what's being returned to your system in a way that's not possible using errors. All mutations have the userErrors field you can select and query for errors.

Troubleshooting with Request ID

The Highnote API includes a requestId field with a unique identifier for your request. This is to be used when you need help with a response. Ensure you log this ID on any errors you encounter to ensure the Highnote support team can monitor and debug your request.

The requestId field can be found in the extensions key of the response:

{
  "data": {
    "node": null
  },
  "extenstions": {
    "requestId": "REQUEST_ID"
  }
}

Provide Feedback

Was this content helpful?