Skip to main content

Wyng Profiles API (1.0)

Introduction

This API can be used to create, update, and access profiles in the Wyng platform Consumer service.

Base api url: /api/v1/consumer

Authentication

PrivateHeaderAccessToken

Security Scheme Type API Key
Header parameter name: X-Access-Token

PrivateUrlAccessToken

Url parameter e.g. ?access_token=lifUzxEAWau9VBhcqcOkinZtgyqQYe

Security Scheme Type API Key
Query parameter name: access_token

PublicHeaderAccessToken

Security Scheme Type API Key
Header parameter name: X-Access-Token

PublicUrlAccessToken

Url parameter e.g. ?access_token=lifUzxEAWau9VBhcqcOkinZtgyqQYe

Security Scheme Type API Key
Query parameter name: access_token

Field

TDM fields can have different data types. The data type will be defined in the TDM. Data types that are available are text, date, bool, numeric, set, and choice

Field Type: text

This is the default data type that will be used for most fields. This fields type will contain string values that can be any value.

Field Type: date

A date field (format for this field still has to be decided)

Field Type: bool

A boolean field containing True or False

Field Type: num

Numeric fields. Values can be either integers or floats.

Field Type: set

A list of values. Values can be added to, or removed from the Profile without prior knowledge of the current values that are in the Set. The possible values are defined in the values attribute of the TDM, if allow_other_values is set to false, the Set will only accept values that are defined in the values attribute of the TDM.

Field Type: choice (not yet implemented)

Predefined values that can be chosen. Possible values are defined in the values attribute of the TDM. A profile can only use one value at a time, but the value must be one of the values set in the values attribute.

id
required
string

Field id must be unique within a TDM instance.

name
required
string

User friendly field name.

type
string

Field type.

status
required
string
Enum: "active" "inactive"

Field state, allows a field to be disabled/archived.

is_key
boolean
Default: false

Use to look up profiles.

is_internal
boolean
Default: false

Indicates a particular attribute should not be displayed directly to the consumer; for example, should not be included when portal template experience is generated

relevance_window
integer
Default: null

Optional window of time in days since last update that the value can still be considered relevant for personalization.

retention_window
integer
Default: null

Optional window of time in days since last update that the value can be used for any purpose. After retention_window expires, the attribute will be deleted

Example
[
  • {
    },
  • {
    }
]

TDM

Permissions

Direct access to this endpoint is restricted. The "Profiles" tab on the Wyng platform is the recommended way to add and configure a data model.

Create

Create data model

Authorizations:
Request Body schema: application/json
required
Array of objects[ items ]

TDM fields can have different data types.
please refer to this section of the documentation.

strong_id
required
string

ID which will be used for merging profiles

ids_priority
Array of strings

List of strings. Id fields in high to low order of priority. Used for lookups when multiple profiles with different ids are found. The profile with the highest priority Id field will be returned

Responses

Request samples

Content type
application/json
{
  • "fields": [
    ],
  • "strong_id": "email",
  • "ids_priority": [
    ]
}

Data Model

Permissions

This endpoint requires a private access token. This endpoint should not generally be used by developers. The "Profiles" tab on the Wyng platform is the recommended way to add or configure a data model.

Retrieve

Get data model configuration

Authorizations:
path Parameters
tdm_id
required
string
Example: 5f68bf46030feaa8f4b5bb7b

ID of the data model

Responses

Response samples

Content type
application/json
{
  • "id": "5f68bf46030feaa8f4b5bb7b",
  • "fields": [
    ],
  • "strong_id": "email",
  • "ids_priority": [
    ]
}

Update

Update a data model instance

Authorizations:
path Parameters
tdm_id
required
string
Example: 5f68bf46030feaa8f4b5bb7b

ID of the data model

Request Body schema: application/json
required
Array of objects[ items ]
strong_id
required
string

ID be used fo merging profiles

ids_priority
Array of strings

List of strings. Id fields in high to low order of priority. Used for lookups when multiple profiles with different ids are found. The profile with the highest priority Id field will be returned

Responses

Request samples

Content type
application/json
{
  • "fields": [
    ],
  • "strong_id": "email",
  • "ids_priority": [
    ]
}

Create or Update Profiles

Upsert

Create or update a profile in a data model instance.

This endpoint accepts a set of fields, and either creates or updates the corresponding profile. Profiles may be matched by any of three key fields: email, phone, uid. If any key fields provided match a profile, we will update that profile. ids_priority setting on TDM will be used to decide which profile to update, if multiple profiles match. If no matching profile exists, we will create a new one. If the action would result in multiple profiles having the same strong_id, those profiles will be merged.

Authorizations:
Request Body schema: application/json
object

TDM fields data

consent
string

Text value that encodes some consent information about the attribute.

source
string

Text value that encodes where the attribute came from. The Profiles Connector will put an experience_id in here.

timestamp
string
Default: "Current DateTime."

Date and time that should be set as the last update time for the fields that are being changed.

Responses

Request samples

Content type
application/json
Example
{
  • "fields": {
    },
  • "timestamp": "2021-09-22 07:23"
}

Response samples

Content type
application/json
Example
{
  • "tdm_id": "60f9c1e7395ea00202ea36f2",
  • "segment_id": [
    ],
  • "fields": [
    ]
}

Profile Lookup

Lookup

Search the data model instance for a profile that matches on one or more of the given IDs. Returns a canonical profile ID that can be used to retrieve a profile.

IDs to match on should be passed as URL parameters.

/profiles/lookup?uid=<example_uid>&email=<example_email>

Responses

Response samples

Content type
application/json
Example
{
  • "id": "5f68bf46030feaa8f4b5bb7b"
}

Profile Endpoint

Retrieve a Profile

Returns the full JSON for a profile object matching canonical profile ID, including all fields, values, and field update timestamps.

Authorizations:
PrivateUrlAccessTokenPrivateHeaderAccessTokenPublicUrlAccessToken (can be used in combination with a JWT) PublicHeaderAccessToken (can be used in combination with a JWT)
path Parameters
profile_id
required
string
Example: 5f633bc86feb832df525d51f

Cannonical Profile ID

query Parameters
relevant
number
Default: 1
Enum: 0 1
Example: relevant=0

By default, API returns full profile data that includes relevant and not relevant attributes. You may modify that behavior using a query parameter to get only relevant or not relevant attributes.

jwt
string
Example: jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0ZG1faWQiOiI2MG[…]tqgNcQiPs4tZdtrtM32X0P73jAaaLOS-KVKqcsn56kflZURdLJ-qbx37XKjE-Svra3KV2SA

Can be used when using a public token. If omitted when using a public token, no private data will be returned.

Responses

Response samples

Content type
application/json
Example
{
  • "tdm_id": "5f68bf46030feaa8f4b5bb7b",
  • "created_at": "2020-01-22T16:11:00.347000",
  • "parent_profiles": [ ],
  • "updated_at": "2022-01-19T20:02:54.145000",
  • "segments": [
    ],
  • "fields": {
    },
  • "field_list": [
    ]
}

Individual fields

Get

Returns single relevant field value and metadata for a profile object matching canonical profile ID.

path Parameters
profile_id
required
string
Example: 5f633bc86feb832df525d51f

Cannonical Profile ID

field_id
required
string
Example: email

Field ID

Responses

Response samples

Content type
application/json
{
  • "id": "email",
  • "name": "Email",
  • "type": "text",
  • "status": "active"
}

Profile Segments

Retrieve

Returns the list of segments for canonical Profile ID.

path Parameters
profile_id
required
string
Example: 5f633bc86feb832df525d51f

Cannonical Profile ID

Responses

Response samples

Content type
application/json
[
  • "60c857159543dbd15581e00f",
  • "000000000000000000000000"
]

Profile JWT

Create

Returns an identity JWT for a given Profile ID.

path Parameters
profile_id
required
string
Example: 5f633bc86feb832df525d51f

Cannonical Profile ID

Responses

Response samples

Content type
application/json
{
  • "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0ZG1faWQiOiI2MGY5YzFlNzM5NWVhMDAyMDJlYTM2ZjIiLCJwcm9maWxlX2lkIjoiNjFlODZlNmU5ZjU4YzBjZTVkZjcwNDhmIiwiaXNzIjoiY29uc3VtZXIiLCJpYXQiOjE2NDI2MjM4MjksImV4cCI6MTY0MjYyNDEyOX0.orjzmugi-SM920tT3gu713KxjjxgTN7Ck1NbZp2BWxKhZzio96PareDIw8Pnjk70VS7M8vWbOQ_gXUsGnZMMAAK4oKe8IyhC0yjwlMWMsVSOeYdfeCeFfauYZsfXXoteG1_vz_kZ33ko3WIcoP_o1TlROaxUEzdSmGPVa2MQTGY2wqvnCBLcPw4QKflOBel60y822nEUValehJDQsymjfFeD8PMem8dE7A6tze1t3T-4uagsxh0lQH5ETmoJlocswlMC2fNa_pInVqDG3VYmDkn6ZlqEYU6ADNLnGIZVfxMF8qTxlJEIfngUzuPZ4HlZUcDVxITy_1DTU5r7aP6BimR3oGbQ2nR0wLPb5Ri14i1d5edTb6WH04Fu9SdLy1U9dqugfAXgE7xdwGhjy2s-fquzAWernLk85_lvUHCiCy-5HQaRAeTZCV-_sncEPSzjcjnRJzFc6fzO8KZ6oqxTDDl8d-pMHDS5EkwGE-UBayRtrMPjthsG_-2Gh1C9w8dZ-orweDYhTqxtDM_aUDPEijO4x6WJfWWa1c2R36gcZ1cnJ3EbSJ2D28vpQ6FiGjqN6OF0apJxTa1wBcoH60QHeGjYEvqVzmhy8IhFtqgNcQiPs4tZdtrtM32X0P73jAaaLOS-KVKqcsn56kflZURdLJ-qbx37XKjE-Svra3KV2SA"
}

Exchange JWT

Exchange a JWT received using Identity Verification in an experience for a Profiles JWT that can be used to retrieve private Profile information

Request Body schema: application/json
jwt
required
string

JWT received from verification service after Identity Verification has been completed

key_field
required
string

id of the TDM field that contains the email address of the Profile

Responses

Request samples

Content type
application/json
{
  • "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJlbWFpbCI6InJlbmUuc2Ftc29uKzIwMjIuMi43XzZAd3luZy5jb20iLCJleHBlcmllbmNlSWQiOiI2MGY5ZTU4ZWY3ZjZiOTAwMGU4M2YwMTMiLCJ2ZXJpZmllZCI6dHJ1ZSwiaXNzIjoidmVyaWZpY2F0aW9uLXNlcnZpY2UiLCJpYXQiOjE2NDQyOTAwMTQsImV4cCI6MTY0NDMxMTYxNH0.U_dU_lWK0q14fQmR6UrcCdhDfiL7Flx6gm2ZghrbPNHLoU98iI0b4PVgKTfGi_pHWAf2z22xfzxzO7zX3NBiXu-bU2m2YjNxvHRIqOP14qf_IIllPbnMweXp4GcpQbyTULzhx47GRObJXjUhtdcG8VeGydD1ko-q9RUxdFaH2soYvYUjqSgwh1ibB5mVsD6Qu5cxbhAPFzqPYEAHczNDMdUJ33n1Y1LU4E21PeUFbvxcpe9bPG2gjrdSh3qZdmjQXwxO90oYarBa3E0M-W9fRzVvTlIz1SHxz8hStFuj20YQKtoC-0F8Z6YAfB17gL1WHgz0ioS1f-OWEmnlYvf6XWutTBoArVgB9g0RNAH6HZFN23e0GNQs9OKDe6o1Q0EQF8VBnfCvNYCvL51G556FI2vJv0UwlkXRrvmcfRpH7sOOZRLt7sCKtz2XO6YSr1_gdtbIl4aOg-mHfgbgXr1BVn4sw2liHu5zqzqIGBKzkDv28hTiG31zQukjATQw7UNtW_l_7ZCbH0Il6fNH5LiuBS-IpAD4-5ir94Pl2UpCUnknW2DLvozN7KsGYOL_oN9mRXfgsRM2I-Ym0tZ05o2ROfx83BI6XZ3uuJj198dqlDBLxLGDFLLc-378XlhVX_7wSAD3o8W7CBhnZig2WzWQyihLOClx3wJszh0MaOaqTE8",
  • "key_field": "email"
}

Response samples

Content type
application/json
{
  • "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0ZG1faWQiOiI2MGY5YzFlNzM5NWVhMDAyMDJlYTM2ZjIiLCJwcm9maWxlX2lkIjoiNjFlODZlNmU5ZjU4YzBjZTVkZjcwNDhmIiwiaXNzIjoiY29uc3VtZXIiLCJpYXQiOjE2NDI2MjM4MjksImV4cCI6MTY0MjYyNDEyOX0.orjzmugi-SM920tT3gu713KxjjxgTN7Ck1NbZp2BWxKhZzio96PareDIw8Pnjk70VS7M8vWbOQ_gXUsGnZMMAAK4oKe8IyhC0yjwlMWMsVSOeYdfeCeFfauYZsfXXoteG1_vz_kZ33ko3WIcoP_o1TlROaxUEzdSmGPVa2MQTGY2wqvnCBLcPw4QKflOBel60y822nEUValehJDQsymjfFeD8PMem8dE7A6tze1t3T-4uagsxh0lQH5ETmoJlocswlMC2fNa_pInVqDG3VYmDkn6ZlqEYU6ADNLnGIZVfxMF8qTxlJEIfngUzuPZ4HlZUcDVxITy_1DTU5r7aP6BimR3oGbQ2nR0wLPb5Ri14i1d5edTb6WH04Fu9SdLy1U9dqugfAXgE7xdwGhjy2s-fquzAWernLk85_lvUHCiCy-5HQaRAeTZCV-_sncEPSzjcjnRJzFc6fzO8KZ6oqxTDDl8d-pMHDS5EkwGE-UBayRtrMPjthsG_-2Gh1C9w8dZ-orweDYhTqxtDM_aUDPEijO4x6WJfWWa1c2R36gcZ1cnJ3EbSJ2D28vpQ6FiGjqN6OF0apJxTa1wBcoH60QHeGjYEvqVzmhy8IhFtqgNcQiPs4tZdtrtM32X0P73jAaaLOS-KVKqcsn56kflZURdLJ-qbx37XKjE-Svra3KV2SA"
}

Segments

Retrieve

Returns the list of defined segments for the TDM associated to the request Access Token.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Post

define segment for the TDM associated to the request Access Token.

Request Body schema: application/json
name
string

Segment Name

any (SegmentExpression)

Representation of a Expression operation

Responses

Request samples

Content type
application/json
{
  • "name": "test3",
  • "expression": {
    }
}

Response samples

Content type
application/json
{
  • "id": "612cd80b8f7dc59afd836639",
  • "name": "test3",
  • "tdm_id": "60f9c1e7395ea00202ea36f2",
  • "expression": {
    },
  • "updated_at": "2021-08-30T13:07:23.777000",
  • "created_at": "2021-07-14T13:07:23.777000"
}

Specific Segment

Retrieve

Returns the specific segment of a TDM.

path Parameters
segment_id
required
string
Example: 612cd80b8f7dc59afd836639

Segment's ID

Responses

Response samples

Content type
application/json
{
  • "id": "612cd80b8f7dc59afd836639",
  • "name": "test3",
  • "tdm_id": "60f9c1e7395ea00202ea36f2",
  • "expression": {
    },
  • "updated_at": "2021-08-30T13:07:23.777000",
  • "created_at": "2021-07-14T13:07:23.777000"
}

Update

Update the specific segment of a TDM.

path Parameters
segment_id
required
string
Example: 612cd80b8f7dc59afd836639

Segment's ID

Request Body schema: application/json
name
string

Segment Name

any (SegmentExpression)

Representation of a Expression operation

Responses

Request samples

Content type
application/json
{
  • "name": "test3",
  • "expression": {
    }
}

Response samples

Content type
application/json
{
  • "id": "612cd80b8f7dc59afd836639",
  • "name": "test3",
  • "tdm_id": "60f9c1e7395ea00202ea36f2",
  • "expression": {
    },
  • "updated_at": "2021-08-30T13:07:23.777000",
  • "created_at": "2021-07-14T13:07:23.777000"
}

Remove

Deletes specific segment from a TDM.

path Parameters
segment_id
required
string
Example: 612cd80b8f7dc59afd836639

Segment's ID

Responses