Pushing and merging identities

This example outlines pushing an identity server side to the Seeka API. This example demonstrates how to create and merge an identity, manage privacy consent state and retrieve a Seeka Profile ID that can be used to resolve the identity in future.

Organisation ID and public key can be retrieved from the Seeka app. The public key is Seeka brand specific.

Considerations for software vendors: The organisation ID and public key provided in your request will linked to the Seeka brand you are sending data on behalf of.

Pushing an identity to Seeka

The below tokens in the code example should be replaced with your own values.
TokenRequiredDescriptionExample
<organisation ID>YesYour organisation ID or the organisation ID of the Seeka organisation you are sending data on behalf of
<public key>YesYour public key or the public key of the Seeka brand you are sending data on behalf of
<seeka profile ID>Seeka profile ID retrieved from the browser SDK.

See retrieving the SeekaPId.

Highly recommended
sk.1.1709215400100.4182463348
<integration version>Version of your software build or the version of your integration.1.0.0
<integration name>Name of your software or the name of your integration.ticketsaurus
<TCF consent>TCF v2.2 consent string that will replace the existing consent for the identity.See privacy SDK for formatting and requirements
Node.js - AxiosNode.js - Axios
Node.js - FetchNode.js - Fetch
PHP - cURLPHP - cURL
C# - HttpClientC# - HttpClient
C# - RestSharpC# - RestSharp
Go - HTTP ClientGo - HTTP Client
const axios = require('axios');
async function sendIdentityToSeeka(data) {
try {
// Headers
const headers = {
"Content-Type": "application/json",
"X-OrgId": "<organisation ID>",
"X-Converge-Key": "<public key>",
"X-Sdk-Client-Version": "<integration version>",
"X-Sdk-Client-Type": "<integration name>/server"
};
const response = await axios({
url: 'https://router.seeka.services/api/identity',
method: 'POST',
data: data,
headers: headers
});
if(response.status !== 200) {
console.error('Unexpected response code when trying to send identity to Seeka', response.status);
}
else {
console.log('Completed send identity to Seeka');
}
}
catch (error) {
console.error('Error when attempting to send identity to Seeka', error);
}
}
// Create identity
const identity = {
"id": {
"seekaPId": "<seeka profile ID>",
"email": [
"jane.doe@gmail.com"
],
"phone": [
"+61422333444"
],
"firstName": [
"Jane"
],
"lastName": [
"Doe"
],
"address": [
{
"addressLine1": "Shop 6",
"addressLine2": "2500 Gold Coast Hwy",
"locality": "Mermaid Waters",
"state": "Queensland",
"stateCode": "QLD",
"postcode": "4218",
"country": "Australia",
"countryCode": "AU"
}
],
"dob": [
"1991-04-24"
],
"privacy": {
"tcfConsentString": "<TCF consent>"
}
}
};
// Send identity
await sendIdentityToSeeka(identity);

Response

The API endpoint will return a response containing either the Seeka Profile/Person ID that was provided in the request or a new ID.

If the same details are provided to this endpoint that resolve back to the same identity, the ID returned by the endpoint becomes a part of the identity and ID graph for that identity.

The ID in the response cannot be relied on as a "lookup" for a profile however the ID can always be used to resolve the same identity and be relied on to attach activities to the profile.

{
  "result": {
    "personId": "sk.1.1629777826314.1255481207"
  }
}