Skip to content

Commit

Permalink
Merge pull request #315 from IABTechLab/gwh-APIDOCS-1745-uid2-server-…
Browse files Browse the repository at this point in the history
…side-sdk-docs

Gwh apidocs 1745 uid2 server side sdk docs
  • Loading branch information
genwhittTTD authored Oct 6, 2023
2 parents 2b824d7 + 7d89400 commit dad4391
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
16 changes: 10 additions & 6 deletions docs/sdks/uid2-sdk-ref-cplusplus.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,26 @@ The interface allows you to decrypt UID2 advertising tokens and return the corre
If you're a DSP, for bidding, call the interface to decrypt a UID2 advertising token and return the UID2. For details on the bidding logic for handling user opt-outs, see [DSP Integration Guide](../guides/dsp-guide.md).

The following example calls the decrypt method in C++:
The following is the decrypt method in C++:

```cpp
#include <uid2/uid2client.h>
public Response Decrypt(String encryptedToken)
using namespace uid2;

const auto client = UID2ClientFactory::Create(baseUrl, apiKey, secretKey);
client->Refresh(); //Note that Refresh() should be called once after create(), and then once per hour
const auto result = client->Decrypt(adToken);
```
### Response Content
Available information returned through the SDK is outlined in the following table.
| Property | Description |
| Function | Description |
| :--- | :--- |
| `Status` | The decryption result status. For a list of possible values and definitions, see [Response Statuses](#response-statuses). |
| `UID2` | The raw UID2 for the corresponding UID2 advertising token. |
| `Established` | The timestamp indicating when a user first established the UID2 with the publisher. |
| `GetStatus()` | The decryption result status. For a list of possible values and definitions, see [Response Statuses](#response-statuses). |
| `GetUid()` | The raw UID2 for the corresponding UID2 advertising token. |
| `GetEstablished()` | The timestamp indicating when a user first established the UID2 with the publisher. |
### Response Statuses
Expand Down
7 changes: 5 additions & 2 deletions docs/sdks/uid2-sdk-ref-csharp-dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ The interface allows you to decrypt UID2 advertising tokens and return the corre
If you're a DSP, for bidding, call the interface to decrypt a UID2 advertising token and return the UID2. For details on the bidding logic for handling user opt-outs, see [DSP Integration Guide](../guides/dsp-guide.md).

The following example calls the decrypt method in C#:
The following is the decrypt method in C#:

```cs
using UID2.Client.IUID2Client
DecryptionResponse Decrypt(string token)

var client = UID2ClientFactory.Create(_baseUrl, _authKey, _secretKey);
client.Refresh(); //Note that refresh() should be called once after create(), and then once per hour
var result = client.Decrypt(_advertisingToken);
```

### Response Content
Expand Down
15 changes: 9 additions & 6 deletions docs/sdks/uid2-sdk-ref-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,25 @@ The interface allows you to decrypt UID2 advertising tokens and return the corre
If you're a DSP, for bidding, call the interface to decrypt a UID2 advertising token and return the UID2. For details on the bidding logic for handling user opt-outs, see [DSP Integration Guide](../guides/dsp-guide.md).

The following example calls the decrypt method in Java:
The following is the decrypt method in Java:

```java
import com.uid2.client.IUID2Client
DecryptionResponse decrypt(String token)

IUID2Client client = UID2ClientFactory.create(TEST_ENDPOINT, TEST_API_KEY, TEST_SECRET_KEY);
client.refresh(); //Note that refresh() should be called once after create(), and then once per hour
DecryptionResponse result = client.decrypt(TEST_TOKEN);
```

### Response Content

Available information returned through the SDK is outlined in the following table.

| Property | Description |
| Function | Description |
| :--- | :--- |
| `Status` | The decryption result status. For a list of possible values and definitions, see [Response Statuses](#response-statuses). |
| `UID2` | The raw UID2 for the corresponding UID2 advertising token. |
| `Established` | The timestamp indicating when a user first established the UID2 with the publisher. |
| `GetStatus()` | The decryption result status. For a list of possible values and definitions, see [Response Statuses](#response-statuses). |
| `GetUid()` | The raw UID2 for the corresponding UID2 advertising token. |
| `GetEstablished()` | The timestamp indicating when a user first established the UID2 with the publisher. |

### Response Statuses

Expand Down
23 changes: 11 additions & 12 deletions docs/sdks/uid2-sdk-ref-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,26 @@ The interface allows you to decrypt UID2 advertising tokens and return the corre
If you're a DSP, for bidding, call the interface to decrypt a UID2 advertising token and return the UID2. For details on the bidding logic for handling user opt-outs, see [DSP Integration Guide](../guides/dsp-guide.md).

The following example calls the decrypt method in Python:
The following is the decrypt method in Python:

```python
from uid2_client import Uid2ClientFactory
client = Uid2ClientFactory.create(base_url, auth_key, secret_key)
decrypt_result = client.decrypt(ad_token)

client = Uid2ClientFactory.create('https://prod.uidapi.com', 'my-auth-token', 'my-secret-key')
client.refresh_keys() # Note that refresh_keys() should be called once after create(), and then once per hour
decrypted_token = client.decrypt(advertising_token)
```

### Response Content

Available information returned through the SDK is outlined in the following table.

| Property | Description |
| Instance Variable | Description |
| :--- | :--- |
| `Status` | The decryption result status. For a list of possible values and definitions, see [Response Statuses](#response-statuses). |
| `UID2` | The raw UID2 for the corresponding UID2 advertising token. |
| `Established` | The timestamp indicating when a user first established the UID2 with the publisher. |
| `uid2` | The raw UID2 for the corresponding UID2 advertising token. |
| `established` | The timestamp indicating when a user first established the UID2 with the publisher. |

>NOTE: If there is a decryption failure, an `EncryptionError` exception is raised.
### Response Statuses

Expand Down Expand Up @@ -117,11 +120,7 @@ The following instructions provide an example of how you can implement sharing u
from uid2_client import Uid2ClientFactory
client = Uid2ClientFactory.create(base_url, auth_key, secret_key)
```
<!-- Alternative to the above for EUID:
```python
from uid2_client import EuidClientFactory
client = EuidClientFactory.create(base_url, auth_key, secret_key)
``` -->

2. Refresh once at startup, and then periodically (recommended refresh interval is hourly):

```python
Expand Down

0 comments on commit dad4391

Please sign in to comment.