📤Making Requests

Structuring a request to Plannr's API

Providing an account

Most of the API endpoints support multi-tenancy (in instances where one user account belongs to multiple firms). This means a UUID must be specified for the account that you want to authenticate as.

This can be obtained by visiting https://api.plannrcrm.com/api/v1/logins. This endpoint will return the logins that the authenticated user has. Retrieve the UUID from within the account object - NOT the login uuid.

This is required for most API routes, provided in a "X-PLANNR-ACCOUNT-UUID" header.

Required Request Headers

Whenever you make a request to the Plannr API, there are a number of required headers you MUST send with the request:

  1. X-PLANNR-ACCOUNT-UUID: <ACCOUNT-UUID>

  2. Authorization: Bearer <YOUR-ACCESS-TOKEN>

  3. Accept: application/json

  4. Content-Type: application/json

Example Request

Let's build a request with a couple of parameters as a use example.

First, we pick a request based on the required functionality and find the relevant endpoint in the documentation to see how to build the request. For this example, we want to retrieve an address attached to an account which we know from the documentation is:

/api/v1/account/{account_uuid}/address

All endpoints begin with api.plannrcrm.com, followed by /api and a version, prefixed with a v. For example:

https://api.plannrcrm.com/api/v1/account/{account_uuid}/address.

This endpoint requires a uuid for an account object as a path parameter. As labeled in the documentation, this is required. It is also a HTTP GET request. After obtaining the relevant uuid, the request now becomes:

GET https://api.plannrcrm.com/api/v1/account/0cc5c3a9-30c3-4236-92cc-2ffcf2de522f/address

Finally, the mandatory request headers must be sent alongside the request. Here is an example of a complete request to the API using cURL/

curl
--location 'https://api.plannrcrm.com/api/v1/account/0cc5c3a9-30c3-4236-92cc-2ffcf2de522f/address' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR-TOKEN-HERE>'
--header 'X-PLANNR-ACCOUNT-UUID: fbf4bd85-ccdc-409d-a3fd-c33cb1d8837b'

Last updated