Skip to main content

Try the API

Before writing code to call the k-ID API, you can test it yourself using your API key and the API Documentation. Get the test API key from the Publisher Portal and go to Developer Settings page of a selected product at the route /products/[productId]/developer.

Publisher Dashboard

Test Mode vs Live Mode

Test Mode

Test mode Test Mode allows developers to test integrations without affecting real data or production systems. When using a Test Mode API key, requests are sent to the test environment at https://game-api.test.k-id.com. This environment is designed to simulate the live system but operates with mock or sandboxed data.

Live Mode

Live mode Live Mode is used for production. When using a Live Mode API key, requests are sent to the production environment at https://game-api.k-id.com. This environment processes real data and interacts with live systems.

Note: Always verify that you are using the correct API key and endpoint for the intended mode to avoid unintended impacts on production data.

Set up API

From API Documentation page, ensure that you have the test server selected.

Select Server

Locate the Authorize button, and click it to enter the API key from your k-ID Product in the Developer Dashboard.

Dialog

Now open the /age-gate/check API section, and click the Try it out button

Try It Out

Now click the Execute button

Try It Out

In the section below you will see the successful result of the /age-gate/check call using

{
"jurisdiction": "US-CA",
"dateOfBirth": "2005-04-15"
}

as the post body.

Try It Out Result

You've now made a successful call to k-ID!

Try the Family Portal

To see the parent experience in the Family Portal, you need to create a Consent Challenge. To do that, make another call to /age-gate/check again using the Execute button, this time with the age of a child below the age of digital consent in the US jurisdiction.

Use

{
"jurisdiction": "US-CA",
"dateOfBirth": "2015-04-15"
}

which results in a response that looks something like this:

{
"challenge": {
"challengeId": "<guid>",
"childLiteAccessEnabled": false,
"oneTimePassword": "<one time password>",
"type": "CHALLENGE_PARENTAL_CONSENT",
"url": "https://family.k-id.com/authorize?otp=<one time password>"
},
"status": "CHALLENGE"
}

You can then navigate to the URL in the url field in a browser. You will be asked for an email address, and then you will receive an email with a link to the Family Portal where you can grant consent to play the game. Once you finish the consent flow in the browser, you can call the challenge/await API with the challengeId field above. You will get a response like the following:

{
"approverEmail": "email@example.com",
"sessionId": "<guid>",
"status": "PASS"
}

You have now successfully created a k-ID Session! You can see it by supplying the sessionId field as a parameter to /session/get.

{
"ageStatus": "DIGITAL_MINOR",
"dateOfBirth": "2015-04-15",
"etag": "<guid>",
"jurisdiction": "US",
"permissions": [],
"sessionId": "<guid>",
"kuid": "<guid>",
"status": "ACTIVE"
}