Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you're using the SDK's HTTP implementation, follow these steps.

>IMPORTANT: Be sure to call this function only when you have obtained legal basis to convert the user’s [directly identifying information (DII)](https://unifiedid.com/docs/ref-info/glossary-uid#gl-dii) to UID2 tokens for targeted advertising.

>`doNotGenerateTokensForOptedOut()` applies `policy=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#token-generation-policy) call. Without this, `policy` is omitted to maintain backwards compatibility.
>`doNotGenerateTokensForOptedOut()` applies `optout_check=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) call. Without this, `optout_check` is omitted to maintain backwards compatibility.
#### Standard Integration

If you're using standard integration (client and server) (see [UID2 SDK for JavaScript Integration Guide](https://unifiedid.com/docs/guides/publisher-client-side)), follow this step:
Expand Down Expand Up @@ -102,7 +102,7 @@ If you're using server-only integration (see [Publisher Integration Guide, Serve
2. Body: `envelope.getEnvelope()`
>IMPORTANT: Be sure to call this endpoint only when you have obtained legal basis to convert the user’s [directly identifying information (DII)](https://unifiedid.com/docs/ref-info/glossary-uid#gl-dii) to UID2 tokens for targeted advertising.

>`doNotGenerateTokensForOptedOut()` applies `policy=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#token-generation-policy) call. Without this, `policy` is omitted to maintain backwards compatibility.
>`doNotGenerateTokensForOptedOut()` applies `optout_check=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) call. Without this, `optout_check` is omitted to maintain backwards compatibility.

4. If the HTTP response status code is _not_ 200, see [Response Status Codes](https://unifiedid.com/docs/endpoints/post-token-generate#response-status-codes) to determine next steps. Otherwise, convert the UID2 identity response content into a `TokenGenerateResponse` object:

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/uid2/client/TokenGenerateInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static String createJsonRequestForGenerateToken(String property, String
json.addProperty("tcf_consent_string", tcString);
}
if(!generateForOptedOut){
json.addProperty("policy", 1);
json.addProperty("optout_check", 1);
}
return json.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/uid2/client/PublisherTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public void requestToNotGenerateTokensForOptedOutUsers() {
TokenGenerateInput input = TokenGenerateInput.fromEmail("test@example.com").doNotGenerateTokensForOptedOut();

JsonObject json = new Gson().fromJson(input.getAsJsonString(), JsonObject.class);
assertEquals(1, json.get("policy").getAsInt());
assertEquals(1, json.get("optout_check").getAsInt());
}

private String encrypt(String body) {
Expand Down