SLASCONE’s API produces the following HTTP response codes:
- 200: Success
- 401: Unauthorized / 403: Forbidden
- This is the result of a wrong/missing isv_id or Authentication Key
- 404: Not Found
- 409: Conflict
- 50X: Error/Bad Gateway/Service Unavailable
Regardless of your business case, you have to:
- catch 409 responses/conflicts. Their handling is crucial for the implementation of your business logic.
- have retry and fallback policies for 50X errors.
409 CONFLICTS
The documentation of each endpoint provides the list of possible 409 conflicts, as shown in the following screenshot taken from:
https://api365.slascone.com/swagger/index.html?urls.primaryName=V2#/Provisioning/AddHeartbeat
All of our GitHub examples handle 409 errors.
50X CONFLICTS AND RETRY LOGIC
Although these errors are uncommon, they can occur under certain circumstances, such as server overloads or network issues. To handle such situations effectively, it is essential to implement the following:
-
Retry Policy
Use a moderate retry policy, with a recommended maximum of 2 retries. Avoid excessive retries to prevent further strain on the server. -
Fallback Policy
If retries are unsuccessful, implement a fallback policy. Whenever possible, prioritize graceful degradation over outright denial to avoid disrupting the end-user experience. For example, it may be preferable to provide partial functionality rather than none at all.
The appropriate retry and fallback strategies will depend on your specific use case and the endpoint in question. For example, you might want to implement different policies for activations, license heartbeats, the first open session and/or subsequent session refresh.
Comments
0 comments
Please sign in to leave a comment.