Bulk

Bulk Documentation

Bulk [BULK POST]

an individual element of the data array

{
  "data": {
    "type": "notification_preferences",
    "id": "1d6393dd-f3f4-49d3-9fd8-7e758b056b1f",
    "attributes": {
      "email": true,
      "task": false
    }
  }
}

For this bulk create endpoint, you are required to send an array of items within the data object. You are also required to send in a related Notification Type. A Notification Preference cannot be created without a Notification Type.

  • Each member of the array must contain a client generated id to be used for the Notification Preference being created.

  • Each member of the array must contain a type that has the value of 'notification_preferences'.

  • Each member of the array must have an attributes hash of values to be used for the Notification Preference being created.

Request

Endpoint

POST /api/v2/account_lists/bb9d4ccd-4739-4481-88fb-d6503e7ee67b/notification_preferences/bulk
Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "data": {
        "type": "notification_preferences",
        "id": "6333be88-4c01-4a85-99ce-f6aa964e6340",
        "attributes": {
          "app": true,
          "email": true,
          "task": true
        },
        "relationships": {
          "notification_type": {
            "data": {
              "type": "notification_types",
              "id": "f2fc1247-75b4-49a0-b98e-9482d3be4af1"
            }
          }
        }
      }
    }
  ]
}

Response

Headers

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

Body

[
  {
    "data": {
      "id": "6333be88-4c01-4a85-99ce-f6aa964e6340",
      "type": "notification_preferences",
      "attributes": {
        "app": true,
        "created_at": "2022-01-12T17:18:31Z",
        "email": true,
        "task": true,
        "updated_at": "2022-01-12T17:18:31Z",
        "updated_in_db_at": "2022-01-12T17:18:31Z"
      },
      "relationships": {
        "notification_type": {
          "data": {
            "id": "f2fc1247-75b4-49a0-b98e-9482d3be4af1",
            "type": "notification_type"
          }
        }
      }
    }
  }
]

Fields

data

Type [Notification Preference / error]

Description Array of Notification Preference objects that have been successfully created and of errors related to Notification Preference objects that were not created successfully

Last updated