Skip to content

Commit b018f83

Browse files
authored
Merge pull request #3237 from segmentio/Profile-API-Update
Profile API Formatting Updates
2 parents ebbadfc + 33ff8a6 commit b018f83

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/personas/profile-api.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Your access token enables you to call the Profile API and access customer data.
4343
> info "European Union requirements"
4444
> To implement the Profile API in the European Union, you must complete the following steps within an EU workspace. View the [regional Segment documentation](/docs/guides/regional-segment/#create-a-new-workspace-with-a-different-region) for more information.
4545
46-
1. Navigate to the API Access settings page *Personas > <personas_space> > Settings > API Access*.
46+
1. Navigate to the API Access settings page **Personas > Settings > API Access**.
4747

4848
2. Create your **Access Token** with a name that describes your use case, for example `testing/development`. Take note of the **space ID** value, you'll pass this into the Profile API request URL in a later step.
4949

@@ -55,24 +55,24 @@ Your access token enables you to call the Profile API and access customer data.
5555

5656
### Find a user's external id
5757

58-
1. Navigate to Personas > *personas_space* > Explorer and select the user you want to query through the API.
58+
1. Navigate to **Personas > Profiles > Explorer** and select the user you want to query through the API.
5959
2. Take note of the user's available identifiers. For example, this user has a `user_id` with the value `9800664881`. The Profile API requires both the type of ID and the value separated by a colon. For example, `user_id:9800664881`.
6060
![Retrieving a user's identifiers with the Personas Explorer](images/profile_api_user_id.png)
6161

6262
> warning ""
63-
> To query phone numbers that contain a plus sign (`+`), insert the escape characters `%2B` in place of the plus sign. <br>
63+
> To query phone numbers that contain a plus sign (`+`), insert the escape characters `%2B` in place of the plus sign.
6464
> For example, if a `phone_number` identifier has the value `+5555550123`, enter `phone_number:%2B5555550123` in your query.
6565
6666
### Query the user's event traits
6767

6868
1. From the HTTP API testing application of your choice, configure the authentication as described above.
6969
2. Prepare the request URL by replacing `<space_id>` and `<external_id>` in the request URL:
70-
`https://profiles.segment.com/v1/spaces/<your-namespace-id>/collections/users/profiles/<external_id>/traits`
70+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/traits`
7171

7272

7373
If you're using the Profile API in the EU, use the following URL for all requests:
7474

75-
`https://profiles.euw1.segment.com/v1/spaces/<your-namespace-id>/collections/users/profiles/<external_id>/traits`
75+
`https://profiles.euw1.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/traits`
7676
3. Send a `GET` request to the URL.
7777

7878
### Explore the user's traits in the response
@@ -104,37 +104,37 @@ The response is returned as a JSON object which contains the queried user's assi
104104

105105
- **Search by an External ID**: You can query directly by a user's user_id or other external_id.
106106

107-
`https://profiles.segment.com/v1/spaces/<space-id>/collections/users/profiles/<user_identifier>/events`
107+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<user_identifier>/events`
108108

109-
- **External IDs**: You can query all of a user's external IDs such as `anonymous_id`, `user_id`.
109+
- **External IDs**: You can query all of a user's external IDs such as `anonymous_id` or `user_id`.
110110

111-
`https://profiles.segment.com/v1/spaces/<space-id>/collections/users/profiles/<user_identifier>/external_ids`
111+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<user_identifier>/external_ids`
112112

113113

114114
**Traits**
115-
You can query a user's traits (first_name, last_name, ...):
115+
You can query a user's traits (such as `first_name`, `last_name`, and more):
116116

117117

118-
`https://profiles.segment.com/v1/spaces/<your-namespace-id>/collections/users/profiles/<your-segment-id>/traits`
118+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/traits`
119119

120120
By default, the response includes 20 traits. You can return up to 200 traits by appending `?limit=200` to the querystring. If you wish to return a specific trait, append `?include={trait}` to the querystring (for example `?include=age`). You can also use the ``?class=audience​`` or ``?class=computed_trait​`` URL parameters to retrieve audiences or computed traits specifically.
121121

122122
**Metadata**
123-
You can query all of a user's metadata (created_at, updated_at, ...):
123+
You can query all of a user's metadata (such as `created_at`, `updated_at`, and more):
124124

125-
`https://profiles.segment.com/v1/spaces/<your-namespace-id>/collections/users/profiles/<your-segment-id>/metadata`
125+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/metadata`
126126

127127
**Search an account profile**
128128

129129
If you're sending group calls to Segment, you can now access your account profiles as well. Retrieve your account traits, computed traits, and audience traits by querying the `group_id` you are interested in:
130130

131-
`https://profiles.segment.com/v1/spaces/<your-namespace-id>/collections/accounts/profiles/group_id:12345/traits`
131+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/accounts/profiles/group_id:12345/traits`
132132

133133
**Search for linked users or accounts**
134134

135135
If you're looking to find all the users linked to an account, you can search for an account's linked users, or a user's linked accounts.
136136

137-
`https://profiles.segment.com/v1/spaces/<your-namespace-id>/collections/accounts/profiles/group_id:12345/links`
137+
`https://profiles.segment.com/v1/spaces/<space_id>/collections/accounts/profiles/group_id:12345/links`
138138

139139
The return limit for the `/links` endpoint is 20 records. You can request up to 20 records by appending `?limit=20` to the query string.
140140

@@ -145,7 +145,7 @@ You can also request using cURL:
145145
```bash
146146
export SEGMENT_ACCESS_SECRET="YOUR_API_ACCESS_TOKEN_SECRET_HERE"
147147

148-
curl https://profiles.segment.com/v1/spaces/<your-space-id>/collections/users/profiles/<your-segment-id>/traits -u $SEGMENT_ACCESS_SECRET:
148+
curl https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/traits -u $SEGMENT_ACCESS_SECRET:
149149
```
150150

151151
## API reference
@@ -255,16 +255,16 @@ Request-Id: 1111-2222-3333-4444
255255
The Profile API supports the following routes. These routes are appended the Profile API request URL:
256256

257257
```
258-
https://profiles.segment.com/v1/spaces/:space_id:/
258+
https://profiles.segment.com/v1/spaces/<space_id>/
259259
```
260260

261261
| Name | Route |
262262
| ---------------------------- | ------------------------------------------------------ |
263-
| Get a Profile's Traits | `collections/users/profiles/:identifier:/traits` |
264-
| Get a Profile's External IDs | `collections/users/profiles/:identifier:/external_ids` |
265-
| Get a Profile's Events | `collections/users/profiles/:identifier:/events` |
266-
| Get a Profile's Metadata | `collections/users/profiles/:identifier:/metadata` |
267-
| Get a Profile's Links | `collections/users/profiles/:identifier:/links` |
263+
| Get a Profile's Traits | `collections/users/profiles/<identifier>/traits` |
264+
| Get a Profile's External IDs | `collections/users/profiles/<identifier>/external_ids` |
265+
| Get a Profile's Events | `collections/users/profiles/<identifier>/events` |
266+
| Get a Profile's Metadata | `collections/users/profiles/<identifier>/metadata` |
267+
| Get a Profile's Links | `collections/users/profiles/<identifier>/links` |
268268

269269

270270
#### Get a profile's traits
@@ -280,7 +280,7 @@ GET /v1/spaces/<space_id>/collections/<users>/profiles/<external_id>/traits
280280
| **Argument** | **Description** | **Example** |
281281
| ------------ | -------------------------------------------------------- | ------------------------------------------ |
282282
| `class` | Supports returning all audiences, or all computed traits | `class=audience` or `class=computed_trait` |
283-
| `include` | A comma-separated list of property keys to include. | `first_name,city` |
283+
| `include` | A comma-separated list of property keys to include | `first_name,city` |
284284
| `limit` | Defines how many traits are returned in one call | `100` |
285285
| `verbose` | True for verbose field selection | `true`,`false` |
286286

@@ -300,7 +300,7 @@ GET /v1/spaces/lg8283283/collections/users/profiles/user_id:u1234/traits
300300
**Request**
301301

302302
```bash
303-
curl https://profiles.segment.com/v1/spaces/:space_id:/collections/users/profiles/<id_type:ext_id>/traits
303+
curl https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<id_type:ext_id>/traits
304304
-X GET
305305
-u $SEGMENT_ACCESS_SECRET:
306306
```
@@ -368,7 +368,7 @@ GET /v1/spaces/<space_id>/collections/<users>/profiles/<id_type:ext_id>/external
368368
**Request**
369369

370370
```bash
371-
curl https://profiles.segment.com/v1/spaces/:space_id:/collections/users/profiles/<id_type:ext_id>/external_ids
371+
curl https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<id_type:ext_id>/external_ids
372372
-X GET
373373
-u $SEGMENT_ACCESS_TOKEN:
374374
```
@@ -411,7 +411,7 @@ curl https://profiles.segment.com/v1/spaces/:space_id:/collections/users/profile
411411

412412
| **Argument** | **Description** | **Example** |
413413
| ------------ | ------------------------------------------------------ | ------------------------- |
414-
| `include` | A comma-separated list of external id type to include. | `user_id`, `anonymous_id` |
414+
| `include` | A comma-separated list of external ids to include | `user_id`, `anonymous_id` |
415415
| `limit` | Defines how many external ids are returned in one call | `25` |
416416
| `verbose` | True for verbose field selection | `true`,`false` |
417417

@@ -428,7 +428,7 @@ Get up to 14 days of a profile's historical events within a collection using an
428428
**Request**
429429

430430
```js
431-
curl https://profiles.segment.com/v1/spaces/:space_id:/collections/users/profiles/<external_id>/events
431+
curl https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/events
432432
-X GET
433433
-u $SEGMENT_ACCESS_SECRET:
434434
```
@@ -533,7 +533,7 @@ Get a single profile's metadata within a collection using an `external_id`.
533533
**Request**
534534

535535
```bash
536-
curl https://profiles.segment.com/v1/spaces/:space_id:/collections/users/profiles/<external_id>/metadata
536+
curl https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/metadata
537537
-X GET
538538
-u $SEGMENT_ACCESS_SECRET:
539539
```
@@ -583,7 +583,7 @@ GET /v1/spaces/<space_id>/collections/<users>/profiles/<external_id>/links
583583
**Request**
584584

585585
```bash
586-
curl https://profiles.segment.com/v1/spaces/:space_id:/collections/users/profiles/<external_id>/links
586+
curl https://profiles.segment.com/v1/spaces/<space_id>/collections/users/profiles/<external_id>/links
587587
-X GET
588588
-u $SEGMENT_ACCESS_SECRET:
589589
```

0 commit comments

Comments
 (0)