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 results field contains the actual results. The total_results field contains the total number of results. The field result_from contains the index (one-based) of first returned result out of the total number of results. The field result_to contains the index (one-based) of last returned result out of the total number of results. For example, in the Project List end-point, the response would look like this:

{
    "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 (400s or 500s) with the following data format:

{
    "detail": "<ERROR_MESSAGE>"
}

The <ERROR_MESSAGE> is the error message returned by the server.