Overzicht
LiGo uses conventional HTTP response codes to indicate the success or failure of an API request. In general: - Codes in the 2xx range indicate success - Codes in the 4xx range indicate an error from the provided information (e.g., missing required parameter, invalid authentication) - Codes in the 5xx range indicate server errors
Error Response Format
When an error occurs, the API returns a JSON response with the following:
- error error code that identifies the specific type of problem that occurred
- Bericht field containing a description of what went wrong
- documentation containing a URL to the documentation of the resource
{
"error": "Error code specifiying what problem occurred",
"message": "Error message describing what went wrong",
"documentation": "URL pointing to the documentation of the resource"
}Error Codes
List of machine-readable error codes:
| Error Code | Beschrijving |
|---|---|
| MISSING_API_KEY | API key was not entered when trying to access the endpoint |
| INVALID_API_KEY | API key entered was invalid |
| RESOURCE_NOT_FOUND | The resource you were trying to find/modify does not exist |
| PLAN_LIMITATION | This resource is not available in your plan |
| PLAN_LIMIT_REACHED | You have reached your plan limit |
| INVALID_INPUT | Your request body contains invalid items |
| LINKEDIN_NOT_CONNECTED | You have not connected your LinkedIn profile to LiGo |
| MISSING_LINKEDIN_URL | You have not given your LinkedIn username to LiGo |
| INTERNAL_SERVER_ERROR | An unexpected error occurred on our server or, our server is temporarily unavailable |
HTTP Status Codes
200The request was successful.
201A new resource was successfully created.
400The request payload is invalid or required fields are missing.
401Authentication failed or API key is missing/invalid.
404The requested resource could not be found.
405The HTTP method is not supported for this endpoint.
429Rate limit exceeded. Please slow down your requests.
500An unexpected error occurred on the server.
503Our server is temporarily unavailable.
Common Error Examples
Missing Required Field
Returned when a required field is not provided in the request body.
{
"error": "INVALID_INPUT",
"message": "'post_text' is missing in the request body",
"documentation": "https://ligosocial.com/api-documentation"
}Invalid Authentication
Returned when the API key is missing, invalid, or expired.
{
"error": "INVALID_API_KEY",
"message": "Invalid API key",
"documentation": "https://ligosocial.com/api-documentation"
}Resource Not Found
Returned when the requested resource does not exist.
{
"error": "RESOURCE_NOT_FOUND",
"message": "No posts found",
"documentation": "https://ligosocial.com/api-documentation"
}Handling Errors
Always check the HTTP status code of responses. Implement proper error handling in your application to gracefully handle different error scenarios and provide meaningful feedback to users.