|
|
PPMS API Doc
|
Receiving Response
Response Type
All responses are returned in a JSON format.
General Response
There are two types of responses, a general response, and a paged response. We talk about paged responses in the next section. In a general response, you get back all the results at once. The following is the format of a general response: { "<END_POINT_NAME>": [ ... ] } The <END_POINT_NAME> is the name of the end-point that was used to send the request. For example, in the Grant Cycles end-point, the response would look like this: { "grant_cycles": [ ... ] }
Paged Response
In a paged response, the results are returned one page at a time. You specify which page whose results you want to be returned when you send the request. To learn how to do that, please check Paged Request. The following is the format of a paged response: { "<END_POINT_NAME>": { "results": [ ... ], "total_results": int, "result_from": int, "result_to": int } }
The <END_POINT_NAME> is the name of the end-point that was used to send the request. The { "project_list": { "results": [ ... ], "total_results": 100, "result_from": 1, "result_to": 15 } }
Error Response
If there is a problem with the request, the server returns an HTTP response with error status codes ( { "detail": "<ERROR_MESSAGE>" } The <ERROR_MESSAGE> is the error message returned by the server. |