diff --git a/README.md b/README.md index 0878ad3..77a405a 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ print(decrypted_token.uid2) >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. - >`do_not_generate_tokens_for_opted_out()` 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. + >`do_not_generate_tokens_for_opted_out()` 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 @@ -175,3 +175,6 @@ make example_auto_refresh BASE_URL=https://prod.uidapi.com AUTH_KEY=my-auth-key ### 2.2.0 (07/26/2023) * Added support for /token/generate * Added support for /token/refresh + +### 2.3.0 (10/11/2023) + * Update from deprecated "policy" parameter to "optout_check" parameter diff --git a/tests/test_publisher_client.py b/tests/test_publisher_client.py index d312a6a..b117802 100644 --- a/tests/test_publisher_client.py +++ b/tests/test_publisher_client.py @@ -1,3 +1,4 @@ +import json import os import unittest @@ -56,6 +57,7 @@ def test_integration_optout_generate_token(self): publisher_client = Uid2PublisherClient(self.EUID_BASE_URL, self.EUID_API_KEY, self.EUID_SECRET_KEY) tc_string = "CPhJRpMPhJRpMABAMBFRACBoALAAAEJAAIYgAKwAQAKgArABAAqAAA" input = TokenGenerateInput.from_email("optout@example.com").do_not_generate_tokens_for_opted_out().with_transparency_and_consent_string(tc_string) + self.assertEqual(1, json.loads(input.get_as_json_string())['optout_check']) token_generate_response = publisher_client.generate_token(input) self.assertTrue(token_generate_response.is_optout()) self.assertFalse(token_generate_response.is_success()) diff --git a/uid2_client/token_generate_input.py b/uid2_client/token_generate_input.py index 8b71edf..06cf366 100644 --- a/uid2_client/token_generate_input.py +++ b/uid2_client/token_generate_input.py @@ -62,7 +62,7 @@ def _create_json_request_for_generate_token(property, value, tc_string, generate if tc_string is not None: json_object["tcf_consent_string"] = tc_string if not generate_for_opted_out: - json_object["policy"] = 1 + json_object["optout_check"] = 1 return json.dumps(json_object) def create_hashed_json_request_for_generate_token(self):