Using the Crassula API
This section will give you a good idea of how to set the development environment to send your first API request to Crassula in a few simple steps. We'll be focusing on making a simple GET
request using a third-party API platform.
Prerequisites
A Crassula client profile: See Persons for more details.
A Crassula banking account: See the Getting started section for more detail;
An Administrative Panel account: See the Administrative Panel Overview section for more detail;
Any third-party API platform: In the example below, we will use the Postman platform.
Setting up the Postman workspace
Navigate to the Postman home page, specify your email address, and click Sign Up for Free:
Create a Postman free account by either specifying a username-password pair or by signing up with your Google account: Accept the End-User License Agreement, specify your name and role, and click Continue to navigate to your Postman workspace:
3. In the dialog above, select the New HTTP request option and click Continue to finish the onboarding. Do not close the Postman workspace tab in your browser since you will need to use it later.
Creating an API request
Typically, an API request has the following structure:
https://client.demo.crassu.la/api/clients/{clientId}/accounts
where
https://client.demo.crassu.la is a host URL;
api/clients/{clientId}/accounts is a request;
{clientId} is an internal client identification number defining which client is taken into consideration.
The following additional parameters are also required to be filled in for the request mentioned above:
Key: A key header parameter defined in the API request description. The parameter defines the action performed by the API request.
Value: A unique API key generated in the Crassula back-end. The key corresponds to the {clientId} and allows one to access the client details without client’s credentials.
Sending an API request
The Postman workspace allows you to send an API request and receive the response. The following instruction takes the aforementioned request as an example; though, you can use any request from Banking API.
To send an API request
Navigate to Banking API.
Copy the
GET api/clients/{clientId}/accounts
request from the list.Navigate to the Postman home page.
Select the
GET
method from the drop-down menu in the top sidebar.Insert the
api/clients/{clientId}/accounts
part of the request into the Enter request URL field.Add the host URL to the request to complete it as follows:
CODEhttps://client.demo.crassu.la/api/clients/{clientId}/accounts
Navigate to the Authorization tab and select API key from the Type drop-down menu.
Add client details and additional parameters to the request:
Update the
ClientId
parameter:Navigate to Crassula Administrative Panel>Banking>Persons and open the profile of a client.
Copy the ID field value and replace the
{clientId}
string with it in Postman.
Set the Key field value:
Navigate to Banking API and click the
GET api/clients/{clientId}/accounts request
.Copy the header parameter (i.e. Authorization).
Insert the copied value into the Key field of Postman.
Set the Value field value:
Navigate to Crassula Administrative Panel>API>API keys to generate an API key for the selected client.
Click Add new.
Set the name of the client in the Client field. Make sure to use the name of the client defined by the
{clientId}
string.Click Create and copy the new API key shown in the green confirmation message. Do not close the window before you copy the key: there is no way the value can be shown after the window is closed.
Insert the copied key into the Value field of Postman.
Click Send to send the request.
See the response body in the Response field.