You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sdks/sdk-ref-python.md
+18-14Lines changed: 18 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,12 @@ You can use the SDK for Python on the server side to facilitate the process of g
15
15
16
16
This SDK simplifies integration with UID2 for any DSPs or UID2 sharers who are using Python for their server-side coding. The following table shows the functions it supports.
17
17
18
-
| Encrypt Raw UID2 to UID2 Token for Sharing | Decrypt UID2 Token to Raw UID2 | Generate UID2 Token from DII | Refresh UID2 Token | Map DII to Raw UID2s | Monitor Rotated Salt Buckets |
18
+
| Encrypt Raw UID2 to UID2 Token for Sharing | Decrypt UID2 Token to Raw UID2 | Generate UID2 Token from DII | Refresh UID2 Token | Map DII to Raw UID2s | Monitor Rotated Salt Buckets*|
*Only applicable to SDK versions referencing versions of the POST /identity/map endpoint prior to version 3.
23
+
22
24
## UID2 Account Setup
23
25
24
26
To integrate with UID2, you'll need to have a UID2 account. If you haven't yet created an account, first follow the steps described on the [Account Setup](../getting-started/gs-account-setup.md) page.
@@ -156,7 +158,7 @@ Decryption response codes, and their meanings, are shown in the following table.
156
158
157
159
`do_not_generate_tokens_for_opted_out()` applies `optout_check=1` in the [POST /token/generate](../endpoints/post-token-generate.md) call. Without this, `optout_check` is omitted to maintain backwards compatibility.
158
160
159
-
####Client-Server Integration
161
+
### Client-Server Integration
160
162
161
163
If you're using client-server integration (see [Client-Server Integration Guide for JavaScript](../guides/integration-javascript-client-server.md)), follow this step:
162
164
@@ -218,9 +220,10 @@ If you're using server-side integration (see [Publisher Integration Guide, Serve
218
220
219
221
There are two operations that apply to Advertisers/Data Providers:
220
222
- [Map DII to Raw UID2s](#map-dii-to-raw-uid2s)
221
-
- [Monitor rotated salt buckets](#monitor-rotated-salt-buckets)
223
+
- [Monitor rotated salt buckets](#monitor-rotated-salt-buckets) (only applicable to versions of the POST /identity/map endpoint prior to version 3)
222
224
223
225
### Map DII to Raw UID2s
226
+
To mapDII to raw UIDs, follow these steps:
224
227
225
228
1. Create an IdentityMapV3Client as an instance variable:
226
229
```py
@@ -264,7 +267,7 @@ There are two operations that apply to Advertisers/Data Providers:
264
267
```
265
268
266
269
>**Note:** The SDK automatically handles email normalization and hashing, ensuring that raw email addresses and phone numbers do not leave your server.
The following sections provide information about the changes you'll need to make to upgrade from an earlier version of the SDK, that uses the POST /v2/identity/map endpoint, to the latest version, which uses the POST /v3/identity/map endpoint.
297
301
298
-
### Migration Overview
302
+
#### Migration Overview
299
303
300
-
Improvements provided by the new Identity Map version:
304
+
Improvements provided by the POST v3/identity/map endpoint:
301
305
-**Support for Multiple Identity Types**: Process emails and phones in a single request
302
306
-**Simpler refresh management**: Re-map on reaching refresh timestamps instead of monitoring salt buckets
303
307
-**Previous raw UID2 availability**: You can see previous UID2for90 days after rotation
304
308
-**Improved performance**: The new API uses significantly less bandwidth for the same amount of DIIs
305
309
306
-
### Required Changes
310
+
#### Required Changes
307
311
308
312
1. **Update dependency version**:
309
313
```bash
@@ -324,8 +328,8 @@ Improvements provided by the new Identity Map version:
324
328
from uid2_client import IdentityMapV3Client, IdentityMapV3Input, IdentityMapV3Response, UnmappedIdentityReason
325
329
```
326
330
327
-
### Recommended Changes
328
-
331
+
#### Recommended Changes
332
+
To migrate from version 2 to version 3 of the POST/identity/map endpoint, follow these steps:
329
333
1. **Update input construction**:
330
334
```py
331
335
# Before
@@ -365,14 +369,14 @@ Improvements provided by the new Identity Map version:
# Alternatively you can get reason as a string, values match the old ones
372
+
# Alternatively, you can retrieve the reason as a string. Values match V2 unmapped values.
369
373
raw_reason= unmapped.raw_reason
370
374
```
371
375
372
-
## Previous Version (V2 Identity Map)
376
+
### Previous Version (V2 Identity Map)
373
377
374
378
:::note
375
-
The V2 Identity Map SDKis an older version maintained for backwards compatibility. Migrate to the current SDKfor improved performance, multi-identity type support, and better UID rotation management.
379
+
The V2 Identity Map SDKis an older version maintained for backwards compatibility. Migrate to the current SDKfor improved performance, multi-identity type support, and better UID2 rotation management.
376
380
New integrations should not use this version.
377
381
See [Migration From Older Identity Map Version](#migration-from-older-identity-map-version) for instructions.
378
382
:::
@@ -410,7 +414,7 @@ To map email addresses, phone numbers, or their respective hashes to their raw U
0 commit comments