Response Codes
Social Feed uses HTTP response status codes to indicate the success or failure of your API requests. This document provides more information about the following types of error and status messages:
HTTP Code | Description |
---|---|
2xx | Success |
200 | Success (OK) |
201 | Successfully created (For POST requests) |
4xx | Client Errors |
400 | Request was invalid |
401 | Unauthorized |
403 | Forbidden |
404 | Not found |
409 | Conflict request |
5xx | Server Errors |
500 | Internal server error |
Below is a list of possible errors that can be returned, along with additional information about how to resolve them.
#
Resolve a 400 error code: Request was invalidThis error indicates that the request body or path parameter or request parameter has invalid input data.
To fix these errors:
- Check the message field of the exception and adjust your request accordingly.
- Check our API documentation to see the number and valid values for required items.
#
Resolve a 401 error code: UnauthorizedThis error can result if the Authorization header is not present or invalid.
The value of Authorization
header is a token you can get by the authenticating yourself.
To fix these errors:
- See the Authentication documentation for more information on how to do this.
#
Resolve a 403 error code: ForbiddenForbidan status code indicate that access to the requested resource is denied for some reason
This error can result from any one of the following issues in your code:
- If the authenticating user is not active.
- If the authenticating user does not have rights to access the specified organization.
- If the specified comment does not belong to the authenticating user organization.
- If the specified post does not belong to the authenticating user organization.
- If the specified person (gets or) updates post or comments of another person.
- If the specified person does not belong to the authenticating user organization.
To fix these errors:
- Check the message field of the exception and adjust your request accordingly.
- Check our API documentation to see the number and valid values for required items.
#
Resolve a 409 error code: Conflict requestConflict response status code indicates a request conflict with current state of the server.
Conflicts are most likely to occur in response to a POST
or PUT
request. For example, you may get a 409 response when adding a new organization which is a similar one is already saved previously.
This error can result from any one of the following issues in your code:
- Adding a new organization with an already existing name.
- Updating an organization to an already existing name.
- Adding a new category with an already existing name.
- Updating a category to an already existing name.
- Liking a post by the same user for more that one time.
- Liking a comment by the same user for more that one time.
To fix these errors:
- Check the message field of the exception and adjust your request accordingly.
- Check our API documentation to see the number and valid values for required items.
#
Resolve a 404 error code: Not FoundThis error indicates that the requested resource is no longer available at the server.
- Check the message field of the exception and adjust your request accordingly.
- Check our API documentation to see the number and valid values for required items.
#
Resolve a 5XX error: Server errorsBankify monitors these errors to make them as rare as possible, but integrations should be able to handle them when they arise.