BrazeEx.Api.CatalogsCatalogItemsAsynchronous (braze_ex v1.0.6)

API calls for all endpoints tagged CatalogsCatalogItemsAsynchronous.

Link to this section Summary

Functions

Delete Multiple Catalog Items

Use this endpoint to delete multiple items in your catalog.

Edit Multiple Catalog Items

Use this endpoint to delete multiple items in your catalog.

Create Multiple Catalog Items

Use this endpoint to create multiple items in your catalog.

Update Catalog Item

Use this endpoint to send Canvas messages via API-triggered delivery.

Link to this section Functions

Link to this function

catalogs_catalog_name_items_delete(connection, catalog_name, opts \\ [])

@spec catalogs_catalog_name_items_delete(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

delete-multiple-catalog-items

Delete Multiple Catalog Items

Use this endpoint to delete multiple items in your catalog.

To use this endpoint, you’ll need to generate an API key with the catalogs.delete_items permission.

Each request can support up to 50 items. This endpoint is asynchronous.

rate-limit

Rate limit

This endpoint has a shared rate limit of 100 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.

path-parameters

Path parameters

ParameterRequiredData TypeDescription
catalog_nameRequiredStringName of the catalog.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
itemsRequiredArrayAn array that contains item objects. The item objects should contain an id referencing the items Braze should delete. Up to 50 item objects are allowed per request.

example-request

Example request

curl --location --request DELETE 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
  {"id": "restaurant1"},
  {"id": "restaurant2"},
  {"id": "restaurant3"}
]
}'

response

Response

There are three status code responses for this endpoint: 202, 400, and 404.

example-success-response

Example success response

The status code 202 could return the following response body.

{
"message": "success"
}

example-error-response

Example error response

The status code 400 could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.

{
"errors": [
  {
    "id": "items-missing-ids",
    "message": "There are 1 item(s) that do not have ids",
    "parameters": [],
    "parameter_values": []
  }
],
"message": "Invalid Request",
}

troubleshooting

Troubleshooting

The following table lists possible returned errors and their associated troubleshooting steps.

ErrorTroubleshooting
catalog-not-foundCheck that the catalog name is valid.
ids-too-largeItem IDs can't be more than 250 characters.
ids-not-uniqueCheck that the item IDs are unique in the request.
ids-not-stringsItem IDs must be of type string.
items-missing-idsThere are items that do not have item IDs. Check that each item has an item ID.
invalid-idsItem IDs can only include letters, numbers, hyphens, and underscores.
request-includes-too-many-itemsYour request has too many items. The item limit per request is 50.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • catalog_name (String.t):
  • opts (keyword): Optional parameters
    • :content_type (String.t):
    • :authorization (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

catalogs_catalog_name_items_patch(connection, catalog_name, opts \\ [])

@spec catalogs_catalog_name_items_patch(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

edit-multiple-catalog-items

Edit Multiple Catalog Items

Use this endpoint to delete multiple items in your catalog.

To use this endpoint, you’ll need to generate an API key with the catalogs.delete_items permission.

Each request can support up to 50 items. This endpoint is asynchronous.

rate-limit

Rate limit

This endpoint has a shared rate limit of 100 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.

path-parameters

Path parameters

ParameterRequiredData TypeDescription
catalog_nameRequiredStringName of the catalog.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
itemsRequiredArrayAn array that contains item objects. The item objects should contain an id referencing the items Braze should delete. Up to 50 item objects are allowed per request.

example-request

Example request

curl --location --request DELETE 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
  {"id": "restaurant1"},
  {"id": "restaurant2"},
  {"id": "restaurant3"}
]
}'

response

Response

There are three status code responses for this endpoint: 202, 400, and 404.

example-success-response

Example success response

The status code 202 could return the following response body.

{
"message": "success"
}

example-error-response

Example error response

The status code 400 could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.

{
"errors": [
  {
    "id": "items-missing-ids",
    "message": "There are 1 item(s) that do not have ids",
    "parameters": [],
    "parameter_values": []
  }
],
"message": "Invalid Request",
}

troubleshooting

Troubleshooting

The following table lists possible returned errors and their associated troubleshooting steps.

ErrorTroubleshooting
catalog-not-foundCheck that the catalog name is valid.
ids-too-largeItem IDs can't be more than 250 characters.
ids-not-uniqueCheck that the item IDs are unique in the request.
ids-not-stringsItem IDs must be of type string.
items-missing-idsThere are items that do not have item IDs. Check that each item has an item ID.
invalid-idsItem IDs can only include letters, numbers, hyphens, and underscores.
request-includes-too-many-itemsYour request has too many items. The item limit per request is 50.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • catalog_name (String.t):
  • opts (keyword): Optional parameters
    • :content_type (String.t):
    • :authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

catalogs_catalog_name_items_post(connection, catalog_name, opts \\ [])

@spec catalogs_catalog_name_items_post(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

create-multiple-catalog-items

Create Multiple Catalog Items

Use this endpoint to create multiple items in your catalog.

To use this endpoint, you’ll need to generate an API key with the catalogs.add_items permission.

Each request can support up to 50 items. This endpoint is asynchronous.

rate-limit

Rate limit

This endpoint has a shared rate limit of 100 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.

path-parameters

Path parameters

ParameterRequiredData TypeDescription
catalog_nameRequiredStringName of the catalog.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
itemsRequiredArrayAn array that contains item objects. The item objects should contain all of the fields in the catalog. Up to 50 item objects are allowed per request.

example-request

Example request

curl --location --request POST 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
  {
    "id": "restaurant1",
    "Name": "Restaurant1",
    "City": "New York",
    "Cuisine": "American",
    "Rating": 5,
    "Loyalty_Program": true,
    "Created_At": "2022-11-01T09:03:19.967+00:00"
  },
  {
    "id": "restaurant2",
    "Name": "Restaurant2",
    "City": "New York",
    "Cuisine": "American",
    "Rating": 10,
    "Loyalty_Program": true,
    "Created_At": "2022-11-02T09:03:19.967+00:00"
  },
  {
    "id": "restaurant3",
    "Name": "Restaurant3",
    "City": "New York",
    "Cuisine": "American",
    "Rating": 3,
    "Loyalty_Program": false,
    "Created_At": "2022-11-03T09:03:19.967+00:00"
  }
]
}'

response

Response

There are three status code responses for this endpoint: 202, 400, and 404.

example-success-response

Example success response

The status code 202 could return the following response body.

{
"message": "success"
}

example-error-response

Example error response

The status code 400 could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.

{
"errors": [
  {
    "id": "fields-do-not-match",
    "message": "Fields do not match with fields on the catalog",
    "parameters": [
      "id"
    ],
    "parameter_values": [
      "restaurant2"
    ]
  }
],
"message": "Invalid Request"
}

troubleshooting

Troubleshooting

The following table lists possible returned errors and their associated troubleshooting steps.

ErrorTroubleshooting
catalog-not-foundCheck that the catalog name is valid.
ids-not-stringsItem IDs must be of type string.
ids-not-uniqueItem IDs must be unique in the request.
ids-too-largeItem IDs can't be more than 250 characters.
invalid-idsItem IDs can only include letters, numbers, hyphens, and underscores.
invalid-fieldsConfirm that the fields in the request exist in the catalog.
invalid-keys-in-value-objectItem object keys can't include . or $.
item-array-invaliditems must be an array of objects.
items-missing-idsThere are items that do not have item IDs. Check that each item has an item ID.
items-too-largeItem values can't exceed 5,000 characters.
request-includes-too-many-itemsYour request has too many items. The item limit per request is 50.
too-deep-nesting-in-value-objectItem objects can't have more than 50 levels of nesting.
unable-to-coerce-valueItem types can't be converted.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • catalog_name (String.t):
  • opts (keyword): Optional parameters
    • :content_type (String.t):
    • :authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

catalogs_catalog_name_items_put(connection, catalog_name, opts \\ [])

@spec catalogs_catalog_name_items_put(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

update-catalog-item

Update Catalog Item

Use this endpoint to send Canvas messages via API-triggered delivery.

To use this endpoint, you'll need to generate an API key with the catalogs.replace_item permission.

API-triggered Delivery allows you to store message content in the Braze dashboard while dictating when a message is sent, and to whom via your API.

Note that to send messages with this endpoint, you must have a Canvas ID, created when you build a Canvas.

rate-limit

Rate limit

This endpoint has a shared rate limit of 50 requests per minute between all synchronous catalog item endpoints, as documented in API rate limits.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
catalog_nameRequiredStringName of the catalog.
item_idRequiredStringThe ID of the catalog item.

request-parameters-1

Request parameters

ParameterRequiredData TypeDescription
itemsRequiredArrayAn array that contains item objects. The item objects should contain fields that exist in the catalog except for the id field. Only one item object is allowed per request.

example-request

Example request

response

Response

There are three status code responses for this endpoint: 200, 400, and 404.

example-success-response

Example success response

The status code 200 could return the following response body.

{
"message": "success"
}

example-error-response

Example error response

The status code 400 could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.

{
"errors": [
  {
    "id": "invalid-fields",
    "message": "Some of the fields given do not exist in the catalog",
    "parameters": [
      "id"
    ],
    "parameter_values": [
      "restaurant1"
    ]
  }
],
"message": "Invalid Request"
}

troubleshooting

Troubleshooting

The following table lists possible returned errors and their associated troubleshooting steps.

ErrorTroubleshooting
catalog_not_foundCheck that the catalog name is valid.
ids_not_stringConfirm that each item ID is a string.
ids_not_uniqueCheck that each item ID is unique.
ids_too_largeCharacter limit for each item ID is 250 characters.
item_array_invaliditems must be an array of objects.
items_missing_idsConfirm that each item has an ID.
items_too_largeItem values can't exceed 5,000 characters.
invalid_idsSupported characters for item ID names are letters, numbers, hyphens, and underscores.
invalid_fieldsConfirm that the fields in the request exist in the catalog.
invalid_keys_in_value_objectItem object keys can't include . or $.

| too_deep_nesting_in_value_object | Item objects can't have more than 50 levels of nesting. | request_includes_too_many_items | Your request has too many items. The item limit per request is 50. | | unable_to_coerce_value | Item types can't be converted. |

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • catalog_name (String.t):
  • opts (keyword): Optional parameters
    • :content_type (String.t):
    • :authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure