Following are standard HTTP Response status codes for the LearningStudio API. See the specific API request for detailed response code descriptions.
Success Response Codes
|HTTP Status Code||Description|
|200 OK||Request was successful.|
|201 Created||Value or resource was successfully created for a POST. Response includes a Location header to the new resource location.|
|204 No Content||Request was successful, but no response returned. For example, a value was updated during a PUT or a deletion was successful during a DELETE.|
Error Response Codes
The following response codes indicate that the request failed. The response includes message text that describes the reason for the error.
|HTTP Status Code||Description|
|400 Bad Request||The request had incorrect syntax (badly formed). The request was missing a required field during a POST or PUT. Please correct the problem before resubmitting.|
|401 Unauthorized||Authentication credentials were missing, incorrect, or expired. The accompanying error message will provide an explanation to inform the caller if the authentication credentials were expired, but otherwise valid. The most common issue is an incorrect OAuth 1 signature or expired OAuth 2 token.|
|403 Forbidden||Request was understood, but refused. The requested action is not allowed to the data item. User is trying to access a data item to which the user does not have access. For example, a student is trying to access grades for another student or a student is trying to start an exam before it is scheduled to start.|
|404 Not Found||URI path is invalid. ID referenced in URI does not exist. Child ID does not match a provided parent ID. For example, the requested exam ID may be valid, but not in the provided course ID.|
|406 Not Acceptable||The request body had an invalid format.|
|429 Too Many Requests||Your API key is making too many requests at once. Keys are limited to 500 requests per second. Be sure you are not sharing your Application ID with another application at your company.|
|500 Internal Server Error||The network or system is having issues and is unavailable. Retry the request. If the condition persists, please post to the LearningStudio API Forum so the team can investigate.|
|502 Bad Gateway||The service is down or being upgraded and is unavailable. Retry the request. If this occurs outside of scheduled maintenance or if the condition persists, please post to the LearningStudio API Forum so the team can investigate.|
|503 Service Unavailable||The service is working, but unavailable due to extremely high demand. Try again later. If the condition persists, please post to the LearningStudio API Forum so the team can investigate. You may have exceeded your quota limits for the time period. Try again later.|
Response Codes vs. Messages
In LearningStudio APIs, the HTTP code is part of the API contract. If a certain error condition results in a 404, then we will always use 404 unless previously communicated. HTTP Messages, especially error messages, are not considered part of the contract and may be changed over time to be more or differently descriptive.
When programming with these APIs, you should not test the error messages to determine an error state. Test against the HTTP codes.