Skip to content

Commit 17cc5e2

Browse files
authored
Merge pull request #430 from segmentio/repo-sync
repo sync
2 parents 45cc440 + 773722f commit 17cc5e2

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

src/connections/spec/common.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,10 @@ Other libraries only collect `context.library`, any other context variables must
276276
| screen.height | |||
277277
| screen.width | |||
278278
| traits | |||
279-
| userAgent || ||
279+
| userAgent || ||
280280
| timezone | |||
281281

282-
- IP Address is not collected by Segment's libraries, but instead filled in by Segmen'ts servers when it receives a message for **client side events only**.
282+
- IP Address isn't collected by Segment's libraries, but is instead filled in by Segment's servers when it receives a message for **client side events only**.
283283
- The Android library collects `screen.density` with [this method](/docs/connections/spec/common/#context-fields-automatically-collected).
284284

285285
## Integrations

src/engage/profiles/user-subscriptions/set-user-subscriptions.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,37 @@ For example, a user might reach out to you after accidentally unsubscribing to y
4747
4848
-->
4949

50-
## Managing user subscriptions with Segment APIs
50+
## Manage user subscriptions with Segment APIs
5151

52-
Use Segments APIs to manage user subscriptions programmatically on an ongoing, real-time basis. You can choose between a [standard `track` call](/docs/connections/spec/track/), for non-critical subscription updates, or the [Public API](https://api.segmentapis.com/docs/){:target="_blank"}, for critical updates that require immediate confirmation, like unsubscribes.
52+
With Segment's APIs, you can manage user subscriptions programmatically on a real-time basis. Use the APIs for ongoing subscription status updates, like when users subscribe to your marketing campaigns on a website form or modify their subscription from within a notification center.
5353

54-
Managing subscriptions with Segment's APIs allows you to handle continuous updates of subscription statuses, like when users subscribe to your marketing campaigns on a website form or modify their subscription from within a notification center.
54+
### The Track call compared to the Public API Identify call
5555

56-
### Receive subscription confirmation with the Public API
56+
To update Engage user subscriptions with Segment's APIs, first choose between a [standard Track call](/docs/connections/spec/track/), for non-critical subscription updates, or the [Public API Identify call](https://api.segmentapis.com/docs/){:target="_blank"}, for critical updates that require immediate confirmation, like unsubscribes.
5757

58-
To receive an API response that confirms Segment has both received and processed subscription status requests, use Segment's [Public API](https://api.segmentapis.com/docs/spaces/#replace-messaging-subscriptions-in-spaces){:target="_blank"}.
58+
When you use the Track call, Segment replies with a standard HTTP `200 OK` status response code if it successfully received the request. Because the Track call updates user traits asynchronously, though, the `200 OK` code indicates that Segment has received, but not yet processed, the request. As a result, use the Track call for non-critical subscription updates, like form signups on your website or adding a subscription from within the user's notification center.
5959

60-
For example, if a user updates their subscription state in your notification center:
60+
When you make Identify calls to Segment's Public API, however, you'll get an immediate response that confirms that Segment both received and processed the request. Use the Public API, then, for unsubscribes, so users immediately find out if their subscription updated.
6161

62-
1. Use the [Public API](https://api.segmentapis.com/docs/spaces/#replace-messaging-subscriptions-in-spaces){:target="_blank"} synchronous call to update their subscription state.
63-
2. The API returns an immediate success or failure response.
64-
3. For successful requests, Segment instantly updates subscription states in your workspace. `Subscribed` email and phone numbers will receive messages from Engage campaigns that they are a part of.
65-
4. You can then display successful updates or error messages with users in your notification center.
62+
### Format the Identify call payload
6663

67-
## The `track` call versus using the Public API
64+
For Segment to process the subscription status request, your Identify call payload must include at least one object with a subscription contact vector, the subscription type, and the subscription status.
6865

69-
When you use the `track` call, Segment replies with a standard HTTP `200 OK` status response code if it successfully received the request. Because the `track` call updates user traits asynchronously, though, the `200 OK` code indicates that Segment has received, but not yet processed, the request. As a result, use the `track` call for non-critical subscription updates, like form signups on your website or adding a subscription from within the user's notification center.
66+
The following array contains example objects that update both SMS and email subscription statuses:
7067

71-
When you make calls to Segment's Public API, however, you'll get an immediate response that confirms that Segment both received and processed the request. Use the Public API, then, for user unsubscribes. If a user unsubscribes from your marketing campaigns within their notification center, they'll know immediately whether or not their request was processed.
68+
```json
69+
"messaging_subscriptions": [
70+
{
71+
"key": "(123) 555-5555",
72+
"type": "SMS",
73+
"status": “SUBSCRIBED” | “UNSUBSCRIBED”| “DID_NOT_SUBSCRIBE”
74+
},
75+
{
76+
77+
"type": "EMAIL",
78+
"status": “SUBSCRIBED” | “UNSUBSCRIBED”| “DID_NOT_SUBSCRIBE”
79+
}
80+
]
81+
```
82+
83+
For successful requests, Segment instantly updates subscription states in your workspace. You can then display successful updates or error messages with users in your notification center.

0 commit comments

Comments
 (0)