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

Deploy - April 30, 2024 #7277

Merged
merged 55 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4d5598a
Contributing docs: Creating Jekyll Collections
internetisaiah Feb 23, 2024
6f0226a
Linking jekyll doc + quick edit
internetisaiah Feb 23, 2024
096effa
BD-2928
lydia-xie Mar 19, 2024
8b76e4b
updates
lydia-xie Mar 20, 2024
6964b2e
gdoc to github pt 1
lydia-xie Apr 4, 2024
42d5dbb
gdoc to github pt. 2
lydia-xie Apr 4, 2024
53ff80a
add bracket
lydia-xie Apr 4, 2024
c41cf92
gdoc to github pt. 3
lydia-xie Apr 5, 2024
95470f7
border around additional deletion considerations
lydia-xie Apr 9, 2024
ffa8dcf
bold around UI elements
lydia-xie Apr 9, 2024
2ac721f
edits to description and placeholder data
lydia-xie Apr 9, 2024
829be83
Building out subscription groups section pt. 1
lydia-xie Apr 9, 2024
d833918
example data and edits
lydia-xie Apr 23, 2024
f8b9fc5
finalize draft
lydia-xie Apr 23, 2024
1223a66
typo
lydia-xie Apr 24, 2024
083375e
add connected source docs
colleenkerr Apr 25, 2024
066c4b7
add link to cdi segments doc
colleenkerr Apr 25, 2024
c783234
fix formatting
colleenkerr Apr 25, 2024
1412cf0
add info for data deletion preferences
colleenkerr Apr 26, 2024
c9075ea
fix table formatting and image cropping
colleenkerr Apr 26, 2024
14ec968
Apply suggestions from code review
lydia-xie Apr 29, 2024
6ee891f
Apply suggestions from code review
lydia-xie Apr 29, 2024
dc0d01b
Apply suggestions from code review
lydia-xie Apr 29, 2024
218f802
Add multi lang support
zzhaobraze Apr 29, 2024
d095be4
cleanup app.json
hokstuff Apr 29, 2024
cd07f7a
release notes april 30, 2024
lydia-xie Apr 29, 2024
78059ac
team feedback
lydia-xie Apr 29, 2024
141e277
Merge branch 'develop' into lx/api_uc
lydia-xie Apr 29, 2024
b3cb0b7
Merge pull request #7268 from braze-inc/ck-security-settings-data-del…
lydia-xie Apr 29, 2024
34ecde0
feedback
lydia-xie Apr 29, 2024
b1354cc
Merge pull request #7273 from braze-inc/lx/apr30_rn
lydia-xie Apr 29, 2024
6201ccd
remove old rn
lydia-xie Apr 29, 2024
94bab6c
Merge pull request #7274 from braze-inc/lx/apr30_rn_del
rachel-feinberg Apr 29, 2024
3d81172
Merge pull request #7275 from braze-inc/update_rake_multi_lang
josh-mccrowell-braze Apr 30, 2024
0f5c0a0
add multi_lang support for redirect in navigation
zzhaobraze Apr 30, 2024
2673dc3
Merge pull request #7276 from braze-inc/fix_nav_redirect_multi_lang
josh-mccrowell-braze Apr 30, 2024
7bb8ceb
Tech writer edits
josh-mccrowell-braze Apr 30, 2024
a4c685b
Apply suggestions from code review
lydia-xie Apr 30, 2024
a244b6c
Merge pull request #7072 from braze-inc/BD-2928
rachel-feinberg Apr 30, 2024
9c3bf96
Merge pull request #7272 from braze-inc/SDK-4855-flutter-appJson
internetisaiah Apr 30, 2024
15cce13
Merge branch 'develop' into BD-2843
internetisaiah Apr 30, 2024
f9fcc0c
Merge pull request #7177 from braze-inc/lx/api_uc
rachel-feinberg Apr 30, 2024
7898090
update required permissions for CDI segment role
colleenkerr Apr 30, 2024
21fa7c6
fix summary steps
colleenkerr Apr 30, 2024
fcf1385
Finishing up content
internetisaiah Apr 30, 2024
e28e377
Quick edits
internetisaiah Apr 30, 2024
4f29259
Fixing table line breaks
internetisaiah Apr 30, 2024
6b17a36
Final edits
internetisaiah Apr 30, 2024
4877071
Reconfigured the steps
josh-mccrowell-braze Apr 30, 2024
8268e67
BD-2898: Sort partner docs alphabetically
internetisaiah Apr 30, 2024
cdb38c9
Update _docs/_contributing/content_management.md
internetisaiah Apr 30, 2024
6a729b5
Merge pull request #6954 from braze-inc/BD-2843
internetisaiah Apr 30, 2024
994b111
numbering
josh-mccrowell-braze Apr 30, 2024
cf3dc6c
Merge pull request #7258 from braze-inc/ck-cdi-connected-source
josh-mccrowell-braze Apr 30, 2024
a78c252
Merge pull request #7278 from braze-inc/BD-2898
bre-fitzgerald Apr 30, 2024
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
39 changes: 26 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ namespace :docs_en do
end
end

namespace :docs_fr do
config_file = './_config.yml,./_lang/_config_fr.yml'
task :index do
namespace :lang do
task :index, [:lang] do |t, args|
config_file = "./_config.yml,./_lang/_config_#{args[:lang]}.yml"
if ENV["SITE_URL"] == 'https://www.braze.com' && ENV["RACK_ENV"] == 'production'
puts `bundle exec jekyll algolia --config #{config_file}`
end
end
task build: [:index] do
jekyll_build(config_file, 'fr')
task :build, [:lang] => [:index] do |t, args|
jekyll_build("./_config.yml,./_lang/_config_#{args[:lang]}.yml", args[:lang])
end
task :serve do
jekyll_serve(config_file)
task :serve, [:lang] do |t, args|
jekyll_serve("./_config.yml,./_lang/_config_#{args[:lang]}.yml")
end
task :proxy_serve do
pipe 'bundle exec ruby proxy.rb fr'
task :proxy_serve, [:lang] do |t, args|
pipe "bundle exec ruby proxy.rb #{args[:lang]}"
end
end

Expand All @@ -79,14 +79,27 @@ namespace :assets do
end
end

multitask fr: [
'docs_fr:serve', 'docs_fr:proxy_serve'

# Usage: rake "lang[:lang]" ie
# rake "lang[:fr]"
# rake "lang[:ja]"
multitask :lang, [:lang] => [
'lang:serve',
'lang:proxy_serve'
]

multitask en: [
multitask serve: [
'docs_en:serve', 'docs_en:proxy_serve'
]

multitask serve: [
multitask en: [
'docs_en:serve', 'docs_en:proxy_serve'
]

task :fr do
Rake::Task["lang"].invoke('fr')
end

task :ja do
Rake::Task["lang"].invoke('ja')
end
19 changes: 18 additions & 1 deletion _docs/_api/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,24 @@ alias: /api/api_key/

# API overview

> This reference article covers the API basics including common terminology and an overview of REST API keys, permissions, and how to keep them secure.
> This reference article covers the API basics, including common terminology and an overview of REST API keys, permissions, and how to keep them secure.

## Braze REST API collection

| Collection | Purpose |
|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [Catalogs]({{site.baseurl}}/api/endpoints/catalogs/) | Create and manage catalogs and catalog items to reference in your Braze campaigns. |
| [Cloud Data Ingestion]({{site.baseurl}}/api/endpoints/cdi/) | Manage your data warehouse integrations and syncs. |
| [Email lists and addresses]({{site.baseurl}}/api/endpoints/email/) | Set up and manage bi-directional sync between Braze and your email systems. |
| [Export]({{site.baseurl}}/api/endpoints/export/) | Access and export various details of your campaigns, Canvases, KPIs, and more. |
| [Messages]({{site.baseurl}}/api/endpoints/messaging/) | Schedule, send, and manage your campaigns and Canvases. |
| [Preference center]({{site.baseurl}}/api/endpoints/preference_center/) | Build your preference center and update the styling of it. |
| [SCIM]({{site.baseurl}}/api/endpoints/scim/) | Manage user identities in cloud-based applications and services. |
| [SMS]({{site.baseurl}}/api/endpoints/sms/) | Manage your users' phone numbers in your subscription groups. |
| [Subscription groups]({{site.baseurl}}/api/endpoints/subscription_groups/) | List and update both SMS and email subscription groups stored in the Braze dashboard. |
| [Templates]({{site.baseurl}}/api/endpoints/templates/) | Create and update templates for email messaging and Content Blocks. |
| [User data]({{site.baseurl}}/api/endpoints/user_data/) | Identify, track, and manage your users. |
{: .reset-td-br-1 .reset-td-br-2}

## API definitions

Expand Down
242 changes: 242 additions & 0 deletions _docs/_api/use_cases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
---
nav_title: API Use Cases
article_title: API Use Cases
description: "Whether you’re a proficient developer or a marketer with minimal developer resources, this reference article is designed to help you understand how to leverage the power of the Braze REST API to accomplish various tasks and enhance your customer engagement strategy."
page_type: reference
page_order: 4.8
---

# Use cases

> The [Braze REST API]({{site.baseurl}}/api/basics/) provides a wide range of endpoints designed to help manage and optimize your customer engagement strategy. In this article, we’ll explore several use cases for each endpoint collection: catalogs, email lists and addresses, export, messages, preference center, SMS, subscription groups, templates, and user data.<br><br>Each section introduces a scenario with a step-by-step guide, code sample, and expected outcome. By the end of this article, you’ll better understand how to use the Braze REST API to enhance your customer engagement efforts.

## Deleting multiple items in a catalog

A new year welcomes new product launches at Kitchenerie, a retail brand specializing in kitchenware. In the Braze dashboard, Kitchenerie has a catalog set up for its dishware collection named "Dishware". This new year also means removing the following products from its dishware collection.

* Plain Bisque
* Pearl Porcelain
* Pink Shimmer

To remove these products from its catalog, Kitchener can use the [`/catalogs/{catalog_name}/items` endpoint]({{site.baseurl}}/api/endpoints/catalogs/catalog_items/asynchronous/delete_catalog_items_bulk/) to pass in the item IDs.

Here's the example request:

```
curl --location --request DELETE 'https://rest.iad-03.braze.com/catalogs/dishware/items' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
"items": [
{"id": "plainbisque"},
{"id": "pearlporcelain"},
{"id": "pinkshimmer"}
]
}'
```

After sending this payload, the following response confirms that the three collections have been successfully removed from Kitchenerie's dishware catalog.

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

## Removing emails from the Braze spam list

At MovieCanon, a streaming services company, the developer team is responsible for periodically auditing its email lists to identify and keep users who are subscribed to its email campaigns. As part of this audit, MovieCanon wants to remove this list of emails from its spam list:

- august.author.example.com
- betty.benson@example.com
- charlie.chase@example.com
- delilah.york@example.com
- evergreen.rebecca@example.com

To accomplish this task, the developer team will need an API key with the `email.spam.remove` permission to use the `/email/spam/remove` endpoint. This endpoint removes email addresses from the Braze spam list and the spam list maintained by MovieCanon’s email provider.

To send this request, include either a string email address or an array of up to 50 email addresses to modify. Since the list of emails to remove is under 50, MovieCanon can accomplish this task with the following request body:

```
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
```

```json
{
"email": ["august.author.example.com","betty.benson@example.com","charlie.chase@example.com","delilah.york@example.com","evergreen.rebecca@example.com"]
}
```

After sending this payload successfully, this response confirms the emails have been removed from MovieCanon’s spam list.

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

## Audit all Canvases

Siege Valley Health is a hospital system that includes 10 operating hospitals and research centers with thousands of patients. Its marketing team wants to compare the Canvases sent to patients to remind them to schedule an appointment for flu shots from the past 3 years of using Braze. Siege Valley Health’s marketing team also wants a quick and efficient way to see both the list of Canvases and the analytics summary.

Let’s dive into how Siege Valley Health can accomplish these two tasks using a combination of endpoints rather than filtering through the Braze dashboard.

For the first task of auditing Canvases, use the [`/canvas/list` endpoint]({{site.baseurl}}/api/endpoints/export/canvas/get_canvases/) to export a list of Canvases that includes the name and tags. Here’s an example request:

{% details Here’s the response that the Siege Valley Health marketing team would receive. %}
```json
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"canvases" : [
{
"id": "canvas_identifier_1",
"last_edited": "2020-07-10T23:59:59",
"name": "PatientReminder_FluShot_2020",
"tags": {
"flu_shots", "patienthealth", "2020"
},
},
{
"id": "canvas_identifier_2",
"last_edited": "2020-07-30T23:59:59",
"name": "PatientReminder2_FluShot_2020",
"tags": {
"flu_shots", "patienthealth", "reminder", "2020"
},
},
... (more Canvases)
],
"message": 'success'
}
```
{% enddetails %}

Let’s move on to the next task of viewing the analytics summary for the first Canvas from Siege Valley Health’s list of Canvases. To do so, we would use the [`/canvas/data_summary` endpoint]({{site.baseurl}}/api/endpoints/export/canvas/get_canvas_analytics_summary/) with the following request parameters:

* `canvas_id`: "canvas_identifier_2"
* `ending_at`: 2023-07-10T23:59:59
* `starting_at`: 2020-07-10T23:59:59

Here's an example request:

```
curl --location -g --request GET 'https://rest.iad-01.braze.com/canvas/data_summary?canvas_id={{canvas_identifier_2}}&ending_at=2023-07-10T23:59:59&starting_at=2020-07-10T23:59:59&length=5&include_variant_breakdown=false&include_step_breakdown=false&include_deleted_step_data=false' \
--header 'Authorization: Bearer YOUR-REST-API-KEY'
```

## Checking upcoming scheduled campaigns and Canvases

The busiest time of year is quickly approaching for Flash & Thread, a retail brand that sells clothing and beauty products online and in stores. Its marketing team wants to check the upcoming campaigns and Canvases from the Braze dashboard before March 31, 2024 at 12 pm. This can be accomplished using the [`/messages/scheduled_broadcasts` endpoint]({{site.baseurl}}/api/endpoints/messaging/schedule_messages/get_messages_scheduled/).

Here's the example request:

```
curl --location --request GET 'https://rest.iad-01.braze.com/messages/scheduled_broadcasts?end_time=2024-03-31T12:00:00' \
--header 'Authorization: Bearer YOUR-REST-API-KEY'
```

This endpoint will return the list of upcoming campaigns and Canvases. From here, the marketing team can confirm its list of messages by referencing the `name` field for the campaigns and Canvases in the response.

## View an older preference center

PoliterWeekly is a digital magazine whose subscribers are reachable through email. In an effort to better understand its subscribers' user journey, the marketing team wants to review the details for PoliterWeekly’s preference center to check when it was created and last updated.

Using the [`/preference_center/v1/{preferenceCenterExternalID}` endpoint]({{site.baseurl}}/api/endpoints/preference_center/get_view_details_preference_center/), the marketing team only needs to insert the preference center external ID as the path parameter, which would look like this:

```
curl --location -g --request GET https://rest.iad-01.braze.com/preference_center/v1/politer_weekly_preference_center_api_id \
--header 'Authorization: Bearer YOUR-REST-API-KEY'
```

{% details Here’s the response the PoliterWeekly marketing team would receive. %}

```json
{
"name": "PoliterWeekly Notification Preferences",
"preference_center_api_id": "user_engage_pref_123",
"created_at": "2021-04-03T12:00:00",
"updated_at": "2024-08-15T15:00:00",
"preference_center_title": "Manage Your PoliterWeekly Notification Preferences",
"preference_center_page_html": "<!DOCTYPE html><html><head><title>Your PoliterWeekly Newsletter Preferences</title><style>body { font-family: Arial, sans-serif; margin: 0; padding: 20px; }.container { max-width: 600px; margin: auto; }h1 { color: #333; }.preference { margin-bottom: 20px; }.preference label { font-size: 16px; }.preference input[type=\"checkbox\"] { margin-right: 10px; }.submit-btn { background-color: #007bff; color: white; padding: 10px 20px; border: none; cursor: pointer; }</style></head><body><div class=\"container\"><h1>Manage your notification preferences</h1><p>Select the types of updates you wish to receive from us:</p><form id=\"preferencesForm\"><div class=\"preference\"><label><input type=\"checkbox\" name=\"newsUpdates\" checked> News Updates</label></div><div class=\"preference\"><label><input type=\"checkbox\" name=\"editorialPicks\"> Editorial Picks</label></div><div class=\"preference\"><label><input type=\"checkbox\" name=\"events\"> Events & Webinars</label></div><div class=\"preference\"><label><input type=\"checkbox\" name=\"specialOffers\"> Special Offers & Promotions</label></div><button type=\"submit\" class=\"submit-btn\">Save Preferences</button></form></div><script>document.getElementById('preferencesForm').addEventListener('submit', function(e) {e.preventDefault();alert('Your preferences have been saved!');});</script></body></html>",
"confirmation_page_html": "<!DOCTYPE html><html><head><title>PoliterWeekly Preferences Updated</title></head><body><h1>You're good to go!</h1><p>Your preferences have been updated successfully.</p></body></html>",
"redirect_page_html": null,
"preference_center_options": {
"meta-viewport-content": "width=device-width, initial-scale=1"
},
"state": "active"
}
```

From this response, the marketing team can see the preference center was created 3 years before its most recent update. With this information in mind, the marketing team could create and launch a new preference center.

{% enddetails %}

## Remove invalid phone numbers

At CashBlastr, the primary goal is to streamline how people can send and receive quick payments. As a financial service company, CashBlastr wants to keep its list of phone numbers for its customers up-to-date and accurate. The developer team has been tasked to remove the following list of phone numbers marked as “invalid” so the marketing team’s SMS messages can reach the appropriate CashBlastr customers.

- 12223135467
- 12183095514
- 14235662245
- 14324567892

To send a request with the [`/sms/invalid_phone_numbers/remove` endpoint]({{site.baseurl}}/api/endpoints/sms/post_remove_invalid_numbers/), the phone numbers must be in an array of strings in [e.164 format](https://en.wikipedia.org/wiki/E.164), with up to 50 phone numbers per request. Because the list doesn’t exceed 50 phone numbers, here’s an example of the request body CashBlastr’s developer team would send:

```json
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"phone_numbers": ["12183095514","14255551212"]
}
```

After sending this payload, the following response confirms the invalid phone numbers from CashBlastr have been removed from the Braze invalid list.

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

## View a user's subscription group status

SandwichEmperor is a quick-service restaurant chain in the United States, and its marketing team wants to check the subscription group statuses for a randomized list of its users for SMS. Using the [`/subscription/status/get` endpoint]({{site.baseurl}}/api/endpoints/subscription_groups/get_list_user_subscription_group_status/), SandwichEmperor can accomplish this task for an individual user with the following example request:

{% raw %}
```
curl --location -g --request GET 'https://rest.iad-01.braze.com/subscription/status/get?subscription_group_id={{subscription_group_id}}&phone=+11232223333' \
--header 'Authorization: Bearer YOUR-REST-API-KEY'
```
{% endraw %}

This endpoint also lists the subscription group statuses of a user for email and can be used to see the subscription group status for multiple users.

## Check an HTML template for email messaging

At WorkFriends, a social network for helping build connections between workers from different industries, its marketing team is responsible for sending email campaigns to its users. These campaigns often include reminders for local events, weekly newsletters, and profile activity highlights.

In this scenario, WorkFriends has historically used a singular HTML template with its legacy branding. In an effort to align its brand identity, WorkFriends wants to verify if there’s any helpful information in this HTML template to leverage before transitioning to a new template.

{% details Here’s the response that the WorkFriends team would receive. %}

```json
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
{
"email_template_id": "WorkFriends_Email_Template_ID",
"template_name": "Promo template",
"description": "Promo template",
"subject": "WorkFriends Weekly Newsletter",
"preheader": "Another week, another WorkFriends update",
"body": "<!DOCTYPE html><html><head><title>WorkFriends Weekly Newsletter</title><style>body {font-family: Arial, sans-serif; color: #333;}.container {padding: 20px;}.header {background-color: #f2f2f2; padding: 10px; text-align: center;}.content {margin-top: 20px;}.footer {margin-top: 20px; font-size: 12px; text-align: center; color: #777;}</style></head><body><div class=\"container\"><div class=\"header\"><h2>WorkFriends Weekly Newsletter</h2></div><div class=\"content\"><p>Hello WorkFriends,</p><p>Welcome to another edition of our weekly newsletter. We've got some exciting updates and promos for you this week!</p><!-- Add more content here --><p>Don't forget to check out our latest promos and updates. Stay connected, stay informed!</p></div><div class=\"footer\"><p>Thank you for being a part of WorkFriends.</p><p>Unsubscribe | Update Preferences</p></div></div></body></html>",
"tags": "promo",
"created_at": "2020-07-10 13:00:00.000",
"updated_at": "2024-02-04 17:00:00.000"
}
```

{% enddetails %}

After reviewing this template information, WorkFriends can also use the [`/templates/email/update` endpoint]({{site.baseurl}}/api/endpoints/templates/email_templates/post_update_email_template/) to update the email template via API. The email template in the Braze dashboard will reflect these edits.
7 changes: 6 additions & 1 deletion _docs/_contributing/content_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ The primary sections on Braze Docs are:
- [Braze API Guide]({{site.baseurl}}/api/home)
- [Technology Partners]({{site.baseurl}}/partners/home)
- [Braze Help]({{site.baseurl}}/help/home)
- [Contributing to Braze Docs]({{site.baseurl}}/contributing/home/)

These primary sections can be accessed on the site header from any page on Braze Docs.
Other than **Contributing to Braze Docs**, these primary sections can be accessed on the site header from any page on Braze Docs.

![The primary sections as shown on the site header on Braze Docs.]({% image_buster /assets/img/contributing/styling_examples/header.png %})

Expand Down Expand Up @@ -167,6 +168,9 @@ collections:
output: true
default_nav_url: home/
page_order: 6
contributing:
output: true
default_nav_url: contributing/
hidden: # Hidden pages not directly linked via navigation
title: Braze
output: true
Expand All @@ -183,6 +187,7 @@ Each collection listed represents a directory within the `_docs` directory.
braze-docs
└── _docs
├── _api
├── _contributing
├── _developer_guide
├── _docs_pages
├── _help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nav_title: Cross-Referencing
article: Cross-referencing
description: "Learn how to cross-reference other pages on Braze Docs."
page_order: 4
page_order: 3
noindex: true
---

Expand Down
2 changes: 1 addition & 1 deletion _docs/_contributing/content_management/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nav_title: Images
article: Images
description: "Learn how to add, modify, and remove images on Braze Docs."
page_order: 2
page_order: 1
noindex: true
---

Expand Down
Loading