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": "6a3ae288-0912-4122-bd49-0c618dfa678c",
      "type": "background_batches",
      "attributes": {
        "created_at": "2021-11-23T14:38:29Z",
        "pending": 0,
        "total": 1,
        "updated_at": "2021-11-23T14:38:29Z",
        "updated_in_db_at": "2021-11-23T14:38:29Z"
      },
      "relationships": {
        "requests": {
          "data": [
            {
              "id": "742a49ac-88cd-4bd5-9ae0-8cf3ecf9e997",
              "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": "5c52e11d-33d4-4318-bc3a-6df36d0533d8",
            "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": "7203b304-3269-4daa-b619-e8effa6cea06",
    "type": "background_batches",
    "attributes": {
      "created_at": "2021-11-23T14:38:29Z",
      "pending": 0,
      "total": 1,
      "updated_at": "2021-11-23T14:38:29Z",
      "updated_in_db_at": "2021-11-23T14:38:29Z"
    },
    "relationships": {
      "requests": {
        "data": [
          {
            "id": "ebda0713-c3ba-4b15-b709-e23e520e495e",
            "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/af66a935-bc53-4911-95e4-24ce988f40a1
Content-Type: application/vnd.api+json

Body

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
200 OK

Body

{
  "data": {
    "id": "af66a935-bc53-4911-95e4-24ce988f40a1",
    "type": "background_batches",
    "attributes": {
      "created_at": "2021-11-23T14:38:29Z",
      "pending": 0,
      "total": 1,
      "updated_at": "2021-11-23T14:38:29Z",
      "updated_in_db_at": "2021-11-23T14:38:29Z"
    },
    "relationships": {
      "requests": {
        "data": [
          {
            "id": "1b2b7a61-e20f-4434-820c-50fd1ee0716b",
            "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/6a34af0e-0576-4617-b258-73fd164e6f25
Content-Type: application/vnd.api+json

Body

Response

Headers

204 No Content

Body

Last updated