REST API - Authentication & Error Handling
This article will give you an overview for the following topics.
Rate Limiting
Authentication Types
Error Handling
Rate Limiting
There is currently no rate limiting on any instance of EventLyte CRM.
Authentication Types
The REST API only supports authentication using Personal Access Tokens (PATs).
HTTP Token Authentication
This authentication method involves sending a Personal Access Token using basic authentication.
The Authorization header must start with “Basic “ with USER:PAT being base64 encoded.
curl --location 'https://your-instance.crm.eventlyte.com/api/records/contacts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {base64 USER:PAT}' \
--data '{}'
Generating Tokens
To generate a personal access token:
Log into EventLyte CRM
Go to Settings in the top right
Select “Access Tokens”
Add a new token:
Enter a friendly name
Define token lifetime (up to 90 days)
Click Save
Copy the generated token and use it in REST API requests using Basic Authentication.
This token can be revoked within EventLyte CRM at any time if you require to, such as the token being compromised.
Error Handling
The API will do its best to reduce errors being returned to API consumers. This increases the availability of the record for use onsite and within the CRM.
When extra fields are sent to the API for saving, and the field does not exist, the field is placed in a holding area and not discarded. A section within the CRM then will enable you to review missing fields and be recommended to add fields in order to view the data.
Error Response Format
EventLyte uses an RFC 7807 compliant error response when returning errors, meaning that all errors can be handled with the same response body.
{
"type": "https://example.com/api/records/contacts",
"title": "Error",
"status": 400,
"detail": "Error details available here",
"instance": "/api/records/contacts"
}
For further information, refer to: https://www.rfc-editor.org/rfc/rfc7807
Expected Response Codes
Code | Expected Response Type | Description |
|---|---|---|
200 | Record | The data has been saved successfully |
400 | RFC 7807 | The data within the request body is invalid or the data being sent in a field does not match |
404 | RFC 7807 | The URL path does not exist within the API |
500 | RFC 7807 | An error has occurred with a message in the response body indicating the type of error |