Hi Enrico, thanks a lot. As you describe, we have the solution currently implemented. However, when creating a contact using the POST method, the ID parameter on the developer center is listed as optional in the parameter documentation, so I thought (I was wondering that) it might be possible to use a custom ID. Just like Genesys Engage could :). So now I know it's not possible. Thanks a lot.
Martin
Original Message:
Sent: 03-03-2023 11:25
From: Enrico Preite
Subject: Create an external contact using the API and custom ID
For sure.
First of all you should create a custom field.
In my environment I used "identifier" because is also searchable. You can find list here: https://help.mypurecloud.com/articles/custom-field-types/
You can create in: Admin -> Directory -> External Contacts in "Custom Contact Types" choosing as "field Type" the field identifier
I create field with name "identifier" and field label "id"
Than import the following Data Action to create External Contact. You shoud use in XXXXXXXXXXXXXXX the id of the custom field that you create.
{ "name": "Create External Contact - Exported 2023-03-03 @ 17:14", "integrationType": "purecloud-data-actions", "actionType": "custom", "config": { "request": { "requestUrlTemplate": "/api/v2/externalcontacts/contacts", "requestType": "POST", "headers": { "Content-Type": "application/json", "UserAgent": "PureCloudIntegrations/1.0" }, "requestTemplate": "{\n \"firstName\": \"${input.firstName}\",\n \"lastName\": \"${input.lastName}\",\n \"schema\": {\n \"id\": \"XXXXXXXXXXXXXXX\",\n \"version\": 7,\n \"selfUri\": \"/api/v2/externalcontacts/contacts/schemas/XXXXXXXXXXXXXXX/versions/7\"\n },\n \"customFields\": {\n \"id_identifier\": \"${input.id_identifier}\"\n }\n}" }, "response": { "translationMap": { "externalContactId": "$.id" }, "translationMapDefaults": {}, "successTemplate": "{\n \"externalContactId\": ${externalContactId}\n}" } }, "contract": { "input": { "inputSchema": { "title": "Ext Contact creation Request", "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "id_identifier": { "type": "string" } }, "additionalProperties": true } }, "output": { "successSchema": { "title": "externalContactId", "type": "object", "properties": { "externalContactId": { "type": "string" } }, "additionalProperties": true } } }, "secure": false}
------------------------------
Enrico Preite
Vodafone Procurement Company S.a.r.l.
Original Message:
Sent: 03-03-2023 02:14
From: Martin Myska
Subject: Create an external contact using the API and custom ID
Hello everyone, I was wondering if anyone has tried creating an external contact using the API and using a custom ID. Please see example below:
Example:
POST /api/v2/externalcontacts/contacts HTTP/1.1
Host: api.mypurecloud.de
Authorization: Bearer **************************************************************************************
Content-Type: application/json
{"id":"cdf805f1-8fb9-42b4-9a74-8e9a2d5b9d0g","firstName":"Karel","lastName":"Novak"}
Response:
{
"id": "d9233e0b-b3ee-494b-aca9-82d2d78a1595",
"firstName": "Karel",
"lastName": "Novak",
"modifyDate": "2023-03-03T07:06:05Z",
"createDate": "2023-03-03T07:06:05Z",
"type": "curated",
"selfUri": "/api/v2/externalcontacts/contacts/d9233e0b-b3ee-494b-aca9-82d2d78a1595"
}
Is it even possible to use a custom ID when creating a contact? We would like to do this for the sake of easier and more unambiguous mapping of the contact to the customer's CRM ID. The API responses with different ID and the one used to create the contact was ignored.
Thank you
#Implementation
------------------------------
Martin Myska
NTT Czech Republic s.r.o
------------------------------