Create Identification Key
POST /metadata/identification-keys |
Description
Creates the key used to identify customers. Your application must define the Identification Key prior to any customer identification attempt. You can build identification keys as a combination of attributes:
- One or more attributes of the customer profile.
- One or more attributes of an extension.
The following identification key representation identifies customers based on the PhoneNumber attribute.
{ "name": "idPhone", "attributes": ["PhoneNumber"]}
Let's imagine that the phone number is part of the contactExt extension; the corresponding object is:
{ "name": "idPhone", "source": "contactExt", "attributes": ["PhoneNumber "]}
This example assumes that one or more customers can share the same phone number, which could apply to members of a family for instance, and makes the identification key not unique across the calling customers. To make it unique, use the "unique" field of the identification key (see the Identification Key for further details).
Operation
Use the Set Server Mode operation to switch modes.
ID | CV.WS.PROF.META.7 | |||
---|---|---|---|---|
Method | POST | |||
URL | /metadata/identification-keys | |||
Parameter | Type | Mandatory | Description | |
Body: Includes the identification key to create. This body contains the IdentificationKey resource. | ||||
name | string | yes | The unique, case-insensitive name of the key. The name must start with a letter, and can be followed with letters, numbers, or underscores. The name is restricted to a maximum of 26 characters. (Maximum RDBMS shared limit on creation of index.) | |
source | string | no | Can take on one of the following values:
| |
attributes | string[] | yes | The array names of one or more attributes of the extension or of the profile. | |
unique | bool | no |
|
Response
The Context Management Service API answers with HTTP codes for every request. The following table shows the correct response for a successful request. See HTTP Response Codes and Errors for further details on the possible codes that this operation can return.
HTTP code | 201 |
---|---|
HTTP message | Created |
Header | Location: metadata/identification-keys/${key-name}
where:
|
Body | {"name": "${key-name}"}
where:
|
Example
The following sample creates a key which identifies the customer based on the provided phone ID. After this key is created, the further profile creations are indexed based on the Customer Phone ID. Operation
POST /metadata/identification-keys { "name": "idPhone", "extension": "contacts", "attributes": ["phone_number"] }
Result
HTTP 201 Created {"name": "idPhone"}