Background Batches
Background Batches Documentation
Background Batch [LIST]
Background Batch [LIST]
Request
Endpoint
GET /api/v2/background_batches
Content-Type: application/vnd.api+json
Body
Response
Headers
Content-Type: application/vnd.api+json; charset=utf-8
200 OK
Body
{
"data": [
{
"id": "949fffcb-1c34-4913-b2f9-c30fdb63d5dd",
"type": "background_batches",
"attributes": {
"created_at": "2022-01-12T17:18:47Z",
"pending": 0,
"total": 1,
"updated_at": "2022-01-12T17:18:47Z",
"updated_in_db_at": "2022-01-12T17:18:47Z"
},
"relationships": {
"requests": {
"data": [
{
"id": "97377984-9bb8-4a20-a5ca-9513a744470a",
"type": "background_batch_requests"
}
]
}
}
}
],
"meta": {
"pagination": {
"page": 1,
"per_page": 25,
"total_count": 1,
"total_pages": 1
},
"sort": null,
"filter": {
}
}
}
Fields
data
Type
[Bulk Background]
Description An array of Bulk Background Objects
Background Batch [POST]
an individual element of the
requests
array
{
"data": {
"type": "background_batch_requests",
"id": "1d6393dd-f3f4-49d3-9fd8-7e758b056b1f",
"attributes": {
"path": "api/v2/account_lists/%{default_account_list_id}/donations"
"request_params": {
"filter": {
"account_list_id": "users default account list id"
} // Added only if default_account_list is true
} // GET params are automatically added in as query params
"request_body": ""
"request_headers": {
"accept": "application/vnd.api+json",
"authorization": "Bearer JWT", // User JWT is inserted here
"content-type": "application/vnd.api+json"
} // These headers are included by default
"request_method": "GET" // GET, POST, PUT, or DELETE (GET by default)
"default_account_list": false // should only be true on index requests
}
}
}
You are required to include at least one request relationship.
Each request must have a path
If you include
%{default_account_list_id}
template in your path string it will substitute the user's default_account_list_id
Request
Endpoint
POST /api/v2/background_batches
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "background_batches",
"attributes": {
},
"relationships": {
"requests": {
"data": [
{
"type": "background_batch_requests",
"id": "4736eab9-9f23-450d-bbfe-6536aa9ed4fa",
"attributes": {
"path": "api/v2/user"
}
}
]
}
}
}
}
Parameters
Attributes
created_at
Type
date
Description The timestamp of when this resource was created
Required No
updated_at
Type
date
Description The timestamp of when this resource was last updated
Required No
updated_in_db_at
Type
date
Description This is to be used as a reference for the last time the resource was updated in the remote database - specifically for when data is updated while the client is offline.
Required No
Relationships
requests.data
Type
[Bulk Background Request]
Description An array of Bulk Background Requests references for the Bulk Background
Required No
Response
Headers
Content-Type: application/vnd.api+json; charset=utf-8
201 Created
Body
{
"data": {
"id": "1e97dec5-a6a7-4654-ab28-93d4a44aca38",
"type": "background_batches",
"attributes": {
"created_at": "2022-01-12T17:18:47Z",
"pending": 0,
"total": 1,
"updated_at": "2022-01-12T17:18:47Z",
"updated_in_db_at": "2022-01-12T17:18:47Z"
},
"relationships": {
"requests": {
"data": [
{
"id": "dec7fe54-e041-4bdd-b287-bbca89943bcd",
"type": "background_batch_requests"
}
]
}
}
}
}
Fields
Attributes
created_at
Type
date
Description The timestamp of when this resource was created
pending
Type
integer
Description The total number of requests still to be processed
total
Type
integer
Description The total number of requests
updated_at
Type
date
Description The timestamp of when this resource was last updated
updated_in_db_at
Type
date
Description This is to be used as a reference for the last time the resource was updated in the remote database - specifically for when data is updated while the client is offline.
Relationships
requests.data
Type
[Bulk Background Request]
Description An array of Bulk Background Requests references for the Bulk Background
Background Batch [GET]
Background Batch [GET]
Request
Endpoint
GET /api/v2/background_batches/d382a0d4-c4a2-4e0d-bf07-0f2fb40e098a
Content-Type: application/vnd.api+json
Body
Response
Headers
Content-Type: application/vnd.api+json; charset=utf-8
200 OK
Body
{
"data": {
"id": "d382a0d4-c4a2-4e0d-bf07-0f2fb40e098a",
"type": "background_batches",
"attributes": {
"created_at": "2022-01-12T17:18:47Z",
"pending": 0,
"total": 1,
"updated_at": "2022-01-12T17:18:47Z",
"updated_in_db_at": "2022-01-12T17:18:47Z"
},
"relationships": {
"requests": {
"data": [
{
"id": "b56450a5-37a9-4c0d-a196-b3ee595ccab4",
"type": "background_batch_requests"
}
]
}
}
}
}
Fields
Attributes
created_at
Type
date
Description The timestamp of when this resource was created
pending
Type
integer
Description The total number of requests still to be processed
total
Type
integer
Description The total number of requests
updated_at
Type
date
Description The timestamp of when this resource was last updated
updated_in_db_at
Type
date
Description This is to be used as a reference for the last time the resource was updated in the remote database - specifically for when data is updated while the client is offline.
Relationships
requests.data
Type
[Bulk Background Request]
Description An array of Bulk Background Requests references for the Bulk Background
Background Batch [DELETE]
Background Batch [DELETE]
Request
Endpoint
DELETE /api/v2/background_batches/45d1c037-ec5e-451c-b0e1-5eef78ea087a
Content-Type: application/vnd.api+json
Body
Response
Headers
204 No Content
Body
Last updated