Skip to main content

Format

Content

A JSON object is at the root of every request and response containing data.

Inside this root object:

  • the data field contains the resource object (or array of resource objects)
  • the meta fiels contains meta informations
note

There is an exception: the webhook notification content is the event resource.

Example: Create a user

Request:

POST /api/users HTTP/1.1
Host: api.fairjungle.com
Content-Type: application/json
Authorization: Bearer TIAnRrvnKaiJAlEorDGwPKbMm6v4Itod
Content-Length: 61
{
"data": {
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user@test.com",
"lang": "fr"
}
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Content-Length: 202
{
"data": {
"id": "c73d505b-2d96-466f-88c0-2c802b936728",
"type": "user",
"createdAt": "2024-09-27T13:34:00Z",
"archived": false,
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user@test.com",
"lang": "fr"
}
}

Example: Patch a user

Request:

PATCH /api/users/c73d505b-2d96-466f-88c0-2c802b936728 HTTP/1.1
Host: api.fairjungle.com
Content-Type: application/json
Authorization: Bearer TIAnRrvnKaiJAlEorDGwPKbMm6v4Itod
Content-Length: 33
{
"data": {
"lang": "en"
}
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 202
{
"data": {
"id": "c73d505b-2d96-466f-88c0-2c802b936728",
"type": "user",
"createdAt": "2024-09-27T13:34:00Z",
"archived": false,
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user@test.com",
"lang": "en"
}
}

Example: Replace a user

Request:

PUT /api/users/c73d505b-2d96-466f-88c0-2c802b936728 HTTP/1.1
Content-Type: application/json
Authorization: Bearer TIAnRrvnKaiJAlEorDGwPKbMm6v4Itod
Content-Length: 138
{
"data": {
"archived": true,
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user-changed@test.com",
"lang": "fr"
}
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 209
{
"data": {
"id": "c73d505b-2d96-466f-88c0-2c802b936728",
"type": "user",
"createdAt": "2024-09-27T13:34:00Z",
"archived": true,
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user-changed@test.com",
"lang": "fr"
}
}

Example: Fetch a user

Request:

GET /api/users/c73d505b-2d96-466f-88c0-2c802b936728 HTTP/1.1
Host: api.fairjungle.com
Authorization: Bearer TIAnRrvnKaiJAlEorDGwPKbMm6v4Itod

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 209
{
"data": {
"id": "c73d505b-2d96-466f-88c0-2c802b936728",
"type": "user",
"createdAt": "2024-09-27T13:34:00Z",
"archived": true,
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user-changed@test.com",
"lang": "fr"
}
}

Example: Fetch a list of users

Request:

GET /api/users HTTP/1.1
Host: api.fairjungle.com
Authorization: Bearer TIAnRrvnKaiJAlEorDGwPKbMm6v4Itod

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 307
{
"data": [
{
"id": "c73d505b-2d96-466f-88c0-2c802b936728",
"type": "user",
"createdAt": "2024-09-27T13:34:00Z",
"archived": true,
"billingProfileId": "6523ac96653c0ef73fcf01bb",
"email": "user-changed@test.com",
"lang": "fr"
}
],
"meta": {
"pageKind": "offset",
"limit": 10,
"offset": 0,
"total": 1,
"order": "asc",
"sortBy": "createdAt"
}
}