-
Notifications
You must be signed in to change notification settings - Fork 0
[2026-04-16] C-583: Document S2S player session endpoint v2/identify #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MrJoy
wants to merge
10
commits into
main
Choose a base branch
from
feat/c-583-server-to-server-login-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+131
−0
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
299645b
Document S2S player session endpoint v2/identify (C-583)
MrJoy 25ab745
Remove internal IDs and user_profile from S2S identify response docs …
MrJoy 2737069
Add session_id, rate limiting, and opt-out docs to S2S identify (C-583)
MrJoy b975082
Document email parameter for S2S identify (C-583)
MrJoy 1f1f16a
Replace timezone with timezone_id, document ad ID and validation beha…
MrJoy c49f7d4
Add 400 Bad Request error response documentation (C-583)
MrJoy 6274b19
Update modules/ROOT/pages/other/v2_identify.adoc
MrJoy 0ac96d6
Update modules/ROOT/pages/other/v2_identify.adoc
MrJoy 5fb0989
Address PR #5 feedback: rewrite intro, fix deep_link docs (C-583)
MrJoy 3911c4c
Document client_ip/country_code geolocation requirement (C-583)
MrJoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| = Server to Server Player Sessions | ||
| :endpoint: v2/identify | ||
| :rate_limit: 200 | ||
|
|
||
| The POST `{endpoint}` endpoint records that a player has started a session and returns data about the player. This is useful for games that cannot integrate the Teak SDK. | ||
|
|
||
| Each call to this endpoint tracks a new session. This drives the xref:ROOT:user-guide:page$audiences.adoc#_played[Played, window=_blank] event in the Audience builder. If Teak has not seen this player before, it also tracks an xref:ROOT:user-guide:page$audiences.adoc#_installed[Installed, window=_blank] event. | ||
|
|
||
| NOTE: If a player has been permanently opted out via xref:page$other/v2_exclusions.adoc[exclusion], the session will still be tracked but no push tokens, email addresses, or advertising identifiers will be stored or updated for the player. | ||
|
|
||
| == Recording a Player Session | ||
| [cols="1h,3a", frame="none", grid="none"] | ||
| |=== | ||
| | Endpoint | ||
| | https://api.gocarrot.com/{endpoint} | ||
| | Request Type | ||
| | POST | ||
| | Content-Type | ||
| | application/json or application/x-www-form-urlencoded | ||
| | Rate Limiting | ||
| | {rate_limit} requests per second | ||
| |=== | ||
|
|
||
| === Required Parameters | ||
| [cols="1,3a", stripes="even"] | ||
| |=== | ||
| |Name | Description | ||
|
|
||
| | game_id | ||
| | Your Teak App ID | ||
| | secret_key | ||
| | Your Teak Server Secret | ||
| | user_id | ||
| | The Game Assigned Player ID. This must match the value provided by the game client's Teak SDK integration. | ||
| |=== | ||
|
|
||
| === Optional Parameters | ||
| [cols="1,3a", stripes="even"] | ||
| |=== | ||
| |Name | Description | ||
|
|
||
| | timezone_id | ||
| | The player's IANA timezone name (e.g. `America/Los_Angeles`). Used for timezone-aware message scheduling. When omitted, UTC is assumed. | ||
| | client_ip | ||
| | The player's IP address. Used for GeoIP country resolution. Either `client_ip` or `country_code` must be provided. If both are provided, `client_ip` takes priority. If neither the player's IP address nor country are known, pass `127.0.0.1`. | ||
| | country_code | ||
| | Two-letter ISO country code (e.g. `US`, `DE`). Used when the player's IP address is not available but their country is known. Either `client_ip` or `country_code` must be provided. If both are provided, `client_ip` takes priority. | ||
| | An email address for this player. When provided, Teak will store or update the player's email address for use in email marketing campaigns. If the player has been permanently opted out, the email address will not be stored. | ||
| | deep_link | ||
| | A deep link to return in the response. If the link is a Teak managed link — either a `teak` custom scheme URL or a URL matching a Teak link domain — it is resolved to a custom scheme deep link with xref:ROOT:user-guide:page$custom-tags.adoc[Liquid templating, window=_blank] applied. xref:ROOT:user-guide:page$player-properties.adoc[Player Properties, window=_blank] values can be substituted using `\{{property_name}}` syntax. Other links are returned as-is. | ||
| |=== | ||
|
|
||
| === Example Request | ||
| [source, json] | ||
| ---- | ||
| { | ||
| "game_id": "your_teak_app_id", | ||
| "secret_key": "your_server_secret", | ||
| "user_id": "player_123", | ||
| "timezone_id": "America/Los_Angeles", | ||
| "client_ip": "203.0.113.42", | ||
| "email": "player@example.com", | ||
| "deep_link": "teak12345:///reward?level={{player_level}}" | ||
| } | ||
| ---- | ||
|
|
||
| === Success Response | ||
| [cols="1,3a"] | ||
| |=== | ||
| | Status Code | ||
| | 201 | ||
| | Response Body | ||
| | JSON dictionary. | ||
| [cols="1,3a", stripes="even"] | ||
| !=== | ||
| ! country_code | ||
| ! Two-letter ISO country code. When `client_ip` is provided, this is derived from GeoIP lookup. When `country_code` is provided instead, this echoes the provided value. Empty string if GeoIP lookup fails. | ||
| ! session_id | ||
| ! An identifier for this player session. Present when a session is successfully tracked. | ||
| ! opt_out_states | ||
| ! A dictionary of channel opt-out states for this player. Contains keys `email`, `push`, and `sms`, each with a `state` value indicating the player's current opt-out preference for that channel. | ||
| ! deep_link | ||
| ! _(Only present if `deep_link` was provided in the request.)_ The processed deep link. Teak managed links — `teak` custom scheme URLs and Teak link domain URLs — are resolved to a custom scheme deep link with Liquid templating applied. xref:ROOT:user-guide:page$player-properties.adoc[Player Properties, window=_blank] values are substituted for `\{{property_name}}` placeholders. Other links are returned unmodified. | ||
| !=== | ||
| | Example | ||
| | [source, json] | ||
| ---- | ||
| { | ||
| "country_code": "US", | ||
| "session_id": "12345", | ||
| "opt_out_states": { | ||
| "email": {"state": "opt_in"}, | ||
| "push": {"state": "opt_in"}, | ||
| "sms": {"state": "opt_out"} | ||
| }, | ||
| "deep_link": "teak12345:///reward?level=elite" | ||
| } | ||
| ---- | ||
| |=== | ||
|
|
||
| === Error Responses | ||
|
|
||
| ==== Bad Request | ||
|
|
||
| :response-code: 400 | ||
| :response-body: JSON dictionary with 'status' and 'errors' keys. 'status' will be 'error'. 'errors' will be a dictionary containing keys for each invalid parameter, with values being an array of human readable error messages. All validation errors are returned at once. | ||
| :response-example: {"status":"error","errors":{"timezone_id":["Mars/Olympus_Mons is not a recognized IANA timezone name"],"location":["either client_ip or country_code must be provided"]}} | ||
| include::partial$response.adoc[] | ||
|
|
||
| ==== Forbidden | ||
|
|
||
| :response-code: 403 | ||
| :response-body: JSON dictionary with 'status' and 'errors' keys. 'status' will be 'error'. 'errors' will be a dictionary containing keys indicating which parameters were invalid, with values being an array of human readable error messages. | ||
| :response-example: {"status":"error","errors":{"authorization":["is invalid"]}} | ||
| include::partial$response.adoc[] | ||
|
|
||
| ==== Not Found | ||
|
|
||
| :response-code: 404 | ||
| :response-body: JSON dictionary with an 'error' key containing a dictionary with 'code' and 'message' keys. | ||
| :response-example: {"error":{"code":404,"message":"Could not find game with id unknown_app_id"}} | ||
| include::partial$response.adoc[] | ||
|
|
||
| ==== Rate Limit Response | ||
|
|
||
| :response-code: 429 | ||
| :response-body: JSON dictionary with 'status' and 'errors' keys. 'status' will be 'rate_limit'. 'errors' will contain the key 'rate_limit' | ||
| :response-example: {"status":"rate_limit","errors":{"rate_limit":["/{endpoint} may only be called {rate_limit} times per second. Please wait a second and try again"]}} | ||
| include::partial$response.adoc[] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.