Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog field and selection endpoints EA #7427

Merged
merged 5 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions _docs/_api/endpoints/catalogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ page_type: landing
guide_top_header: "Catalogs Endpoints"
guide_top_text: "Use the Braze Catalogs Endpoints to add, edit, and manage your catalogs and catalog item details. For bulk changes to your catalog, use the asynchronous catalog endpoints. <br><br> Looking for guidance on creating a catalog? Check out our article for <a href='/docs/user_guide/personalization_and_dynamic_content/catalog/'>creating and using catalogs</a>."

guide_featured_title: "Catalog management endpoints<br><br>"
guide_featured_title: "Catalog management endpoints"
guide_featured_list:
- name: "DELETE: Delete Catalog"
link: /docs/api/endpoints/catalogs/catalog_management/synchronous/delete_catalog/
Expand All @@ -23,9 +23,8 @@ guide_featured_list:
link: /docs/api/endpoints/catalogs/catalog_management/synchronous/post_create_catalog/
image: /assets/img/braze_icons/check-square-broken.svg

optional_guide_menu_title: "Catalog items endpoints"
guide_menu_title: "<h3>Asynchronous</h3>"
guide_menu_list:
guide_menu_title2: "Asynchronous catalog items endpoints"
guide_menu_list2:
- name: "DELETE: Delete Multiple Catalog Items Endpoints"
link: /docs/api/endpoints/catalogs/catalog_items/asynchronous/delete_catalog_items_bulk/
image: /assets/img/braze_icons/edit-05.svg
Expand All @@ -39,8 +38,8 @@ guide_menu_list:
link: /docs/api/endpoints/catalogs/catalog_items/asynchronous/put_update_catalog_items/
image: /assets/img/braze_icons/user-circle.svg

guide_menu_title2: "<h3>Synchronous</h3>"
guide_menu_list2:
guide_menu_title3: "Synchronous catalog items endpoints"
guide_menu_list3:
- name: "DELETE: Delete Catalog Item"
link: /docs/api/endpoints/catalogs/catalog_items/synchronous/delete_catalog_item/
image: /assets/img/braze_icons/edit-05.svg
Expand All @@ -60,5 +59,22 @@ guide_menu_list2:
link: /docs/api/endpoints/catalogs/catalog_items/synchronous/put_update_catalog_item/
image: /assets/img/braze_icons/user-circle.svg

guide_menu_title4: "Asynchronous catalog fields endpoints"
guide_menu_list4:
- name: "POST: Create Catalog Fields"
link: /docs/api/endpoints/catalogs/catalog_fields/asynchronous/post_create_catalog_fields/
image: /assets/img/braze_icons/check-square-broken.svg
- name: "DELETE: Delete Catalog Field"
link: /docs/api/endpoints/catalogs/catalog_fields/asynchronous/delete_catalog_field/
image: /assets/img/braze_icons/edit-05.svg

guide_menu_title5: "Asynchronous catalog selections endpoints"
guide_menu_list5:
- name: "POST: Create Catalog Fields"
link: /docs/api/endpoints/catalogs/catalog_fields/asynchronous/post_create_catalog_fields/
image: /assets/img/braze_icons/check-square-broken.svg
- name: "DELETE: Delete Catalog Field"
link: /docs/api/endpoints/catalogs/catalog_fields/asynchronous/delete_catalog_field/
image: /assets/img/braze_icons/edit-05.svg

---
---
6 changes: 6 additions & 0 deletions _docs/_api/endpoints/catalogs/catalog_fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
nav_title: Catalog Fields
config_only: true
noindex: true
page_order: 3
---
6 changes: 6 additions & 0 deletions _docs/_api/endpoints/catalogs/catalog_fields/asynchronous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
nav_title: Asynchronous
config_only: true
noindex: true
page_order: 1
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
nav_title: "DELETE: Delete Catalog Field"
article_title: "DELETE: Delete Catalog Field"
search_tag: Endpoint
page_order: 1

layout: api_page
page_type: reference
description: "This article outlines details about the Delete catalog field Braze endpoint."

---
{% api %}
# Delete catalog field
{% apimethod delete %}
/catalogs/{catalog_name}/fields/{field_name}
{% endapimethod %}

> Use this endpoint to delete a catalog field.
{% alert important %}
This endpoint is currently in early access. Contact your customer success manager if you're interested in participating in this early access.
{% endalert %}

## Prerequisites

To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key/) with the `catalogs.delete_fields` permission.

## Rate limit

{% multi_lang_include rate_limits.md endpoint='asynchronous catalog fields' %}

## Path parameters

| Parameter | Required | Data Type | Description |
| -------------- | -------- | --------- | -------------------------- |
| `catalog_name` | Required | String | Name of the catalog. |
| `field_name` | Required | String | Name of the catalog field. |
{: .reset-td-br-1 .reset-td-br-2 .reset-td-br-3 .reset-td-br-4}

## Example request

```
curl --location --request DELETE 'https://rest.iad-03.braze.com/catalogs/restaurants/fields/ratings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
```

## Response

There are two status code responses for this endpoint: `202` and `404`.

### Example success response

The status code `202` could return the following response body:

```json
{
"message": "success"
}
```

### Example error response

The status code `404` could return the following response body. Refer to [Troubleshooting](#troubleshooting) for more information about errors you may encounter.

```json
{
"errors": [
{
"id": "catalog-not-found",
"message": "Could not find catalog",
"parameters": [
"catalog_name"
],
"parameter_values": [
"restaurants"
]
}
],
"message": "Invalid Request"
}
```

## Troubleshooting

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

| Error | Troubleshooting |
| ------------------------------- | ---------------------------------------------------------------- |
| `catalog-not-found` | Check that the catalog name is valid. |
| `field-referenced-by-selection` | Check that the catalog field is currently in use by a selection. |
| `field-is-inventory` | Check that the catalog field is used as an inventory field. |
| `invalid-field-name` | Check that the catalog field name is valid. |
{: .reset-td-br-1 .reset-td-br-2}

{% endapi %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
nav_title: "POST: Create Catalog Fields"
article_title: "POST: Create Catalog Fields"
search_tag: Endpoint
page_order: 2

layout: api_page
page_type: reference
description: "This article outlines details about the Create catalog fields Braze endpoint."

---
{% api %}
# Create catalog fields
{% apimethod post %}
/catalogs/{catalog_name}/fields
{% endapimethod %}

> Use this endpoint to create multiple fields in your catalog.
{% alert important %}
This endpoint is currently in early access. Contact your customer success manager if you're interested in participating in this early access.
{% endalert %}

## Prerequisites

To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key/) with the `catalogs.create_fields` permission.

## Rate limit

{% multi_lang_include rate_limits.md endpoint='asynchronous catalog fields' %}

## Path parameters

| Parameter | Required | Data Type | Description |
| -------------- | -------- | --------- | -------------------- |
| `catalog_name` | Required | String | Name of the catalog. |
{: .reset-td-br-1 .reset-td-br-2 .reset-td-br-3 .reset-td-br-4}

## Request parameters

| Parameter | Required | Data Type | Description |
| --------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------ |
| `fields` | Required | Array | An array that contains field objects. The fields objects should contain the name and type of the new fields. |
{: .reset-td-br-1 .reset-td-br-2 .reset-td-br-3 .reset-td-br-4}

## Example Request

```
curl --location --request POST 'https://rest.iad-03.braze.com/catalogs/restaurants/fields' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
"fields": [
{
"name": "Name",
"type": "string"
},
{
"name": "Ratings",
"type": "number"
},
{
"name": "Loyalty_Program",
"type": "boolean"
},
{
"name": "Created_At",
"type": "time"
}
]
}'
```

## Response

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

### Example success response

The status code `202` could return the following response body.

```json
{
"message": "success"
}
```

### Example error response

The status code `400` could return the following response body. Refer to [Troubleshooting](#troubleshooting) for more information about errors you may encounter.

```json
{
"errors": [
{
"id": "catalog-not-found",
"message": "Could not find catalog",
"parameters": [
"catalog_name"
],
"parameter_values": [
"restaurants"
]
}
],
"message": "Invalid Request"
}
```

## Troubleshooting

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

| Error | Troubleshooting |
|--------------------------------------|--------------------------------------------------------------------------------------------------------|
| `arbitrary-error` | An arbitrary error occurred. Please try again or contact [Support]({{site.baseurl}}/support_contact/). |
| `catalog-not-found` | Check that the catalog name is valid. |
| `company-size-limit-already-reached` | The catalog storage size limit is reached. |
| `request-includes-too-many-fields` | Each request can support up to 50 new fields. |
| `catalog-exceeds-fields-limit` | Catalog cannot have more than 500 fields. |
{: .reset-td-br-1 .reset-td-br-2}

{% endapi %}
6 changes: 6 additions & 0 deletions _docs/_api/endpoints/catalogs/catalog_selections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
nav_title: Catalog Selections
config_only: true
noindex: true
page_order: 4
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
nav_title: Asynchronous
config_only: true
noindex: true
page_order: 1
---
Loading