Skip to content

Structure of Requests and Responses

The API provides REST endpoints that can be accessed directly from your program code. All requests are made using the http verbs GET, PUT, POST, and DELETE. This section describes some elements that are common to most, if not all, of the connectFi API calls. These elements are not discussed in the individual descriptions unless necessary.

Requests

Each method is invoked by an http request to an API endpoint using one of the verbs GET, PUT, POST or DELETE. Path parameters may be encoded in the URL.

Most POST and PUT requests provide a request body in JSON format. However, some POST and PUT requests require form-data instead. The specific documentation for each section will indicate which format is required for each request. When a JSON format request body is required, the Content-Type header should be application/json. When form data is required, the Content-Type header should be multipart/form-data.

For GET requests, the request body is empty, but path parameters encoded in the URL may be necessary.

Pre-requisite Requests

Some requests will fail if pre-requisite requests have not been completed prior to the current request. In the same way that all requests (except logging in) will fail without a token, many requests require a reference to prior responses received from these pre-requisite requests before they will succeed.

For example, a debit card cannot be activated unless the debit card is first added to a customer. Likewise, a debit card cannot be added to a customer unless the customer has been initialized and all necessary documents have been uploaded.

Responses

Each request returns a status code, along with a set of standard http headers which may be ignored. In some cases a response body is also returned in JSON format. Most response bodies have the following format.

{
    "code": "0", //Success
    "data": {
        //Response properties in key: value pairs
    },
    "requestId": "123AlphaNumericStringIdentifingThisRequest456"
}

If the call succeeds, the response body includes the element "code": "0"and the status code is 200 or 201. If the call fails, the status code is 300 or greater, and the response body gives an appropriate message.