Hi Jorge,
The minimum information you need to enter on this API appears to be the contacts firstname and lastname. Once these are populated the API submits. What I found in testing was that you need to remove a lot of content when not passing values against it. For example, you have the Whatsapp element in your text above so it's expected data to be passed but you aren't including anything.
I have taken the data you supplied above and created the contact in our org for testing, the code used is shown below. As you'll see I removed the schema section completely along with anything else that I wasn't populating. The example below needs to have your Org ID for CARP added (highlighted with XXXX), but you should be able to submit Create Contact request then successfully.
{
"firstName": "Juan",
"middleName": "Jose",
"lastName": "Lopez",
"salutation": "Sr.",
"title": "DT",
"workPhone": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"cellPhone": {
"display": "+541141114444",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "+541141114444",
"countryCode": "AR"
},
"homePhone": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"otherPhone": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"workEmail": "jjlopez@carp.com.ar",
"personalEmail": "",
"otherEmail": "",
"address": {
"address1": "Av. Figueroa Alcorta 6800",
"address2": "",
"city": "Buenos Aires",
"state": "CABA",
"postalCode": "8888",
"countryCode": "AR"
},
"twitterId": {
"id": "1",
"name": "1",
"screenName": "1"
},
"lineId": {
"ids": [
{
"userId": "1"
}
],
"displayName": "Juan José López"
},
"facebookId": {
"ids": [
{
"scopedId": "1"
}
],
"displayName": "1"
},
"modifyDate": "",
"createDate": "",
"externalOrganization": {
"id": "XXXX",
"name": "CARP",
"companyType": "",
"industry": "",
"primaryContactId": "",
"address": {
"address1": "",
"address2": "",
"city": "",
"state": "",
"postalCode": "",
"countryCode": ""
},
"phoneNumber": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"faxNumber": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"employeeCount": 0,
"revenue": 0,
"tags": [],
"websites": [],
"tickers": [
{
"symbol": "",
"exchange": ""
}
],
"twitterId": {
"id": "1",
"name": "",
"screenName": "1"
},
"externalSystemUrl": "",
"modifyDate": "",
"createDate": "",
"trustor": {
"enabled": true
}
}
}
------------------------------
Gareth James
CALLSCAN AUSTRALIA PTY. LTD.
------------------------------
Original Message:
Sent: 12-10-2020 18:54
From: Jorge Negri
Subject: External Contact creation using the API
Hi,
I'm trying to make a test using the API Explorer in order to create a new External Contact:
/api/v2/externalcontacts/contacts
While attempting to create this new External Contact, completed the "required" fields, with some test informations.
Please find below what has been managed:
{
"firstName": "Juan",
"middleName": "José",
"lastName": "López",
"salutation": "Sr.",
"title": "DT",
"workPhone": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"cellPhone": {
"display": "+541141114444",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "+541141114444",
"countryCode": "AR"
},
"homePhone": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"otherPhone": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"workEmail": "jjlopez@carp.com.ar",
"personalEmail": "",
"otherEmail": "",
"address": {
"address1": "Av. Figueroa Alcorta 6800",
"address2": "",
"city": "Buenos Aires",
"state": "CABA",
"postalCode": "8888",
"countryCode": "AR"
},
"twitterId": {
"id": "1",
"name": "1",
"screenName": "1"
},
"lineId": {
"ids": [
{
"userId": "1"
}
],
"displayName": "Juan José López"
},
"whatsAppId": {
"phoneNumber": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"displayName": "-"
},
"facebookId": {
"ids": [
{
"scopedId": "1"
}
],
"displayName": "1"
},
"modifyDate": "",
"createDate": "",
"externalOrganization": {
"id": "1",
"name": "CARP",
"companyType": "",
"industry": "",
"primaryContactId": "",
"address": {
"address1": "",
"address2": "",
"city": "",
"state": "",
"postalCode": "",
"countryCode": ""
},
"phoneNumber": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"faxNumber": {
"display": "",
"extension": 0,
"acceptsSMS": true,
"userInput": "",
"e164": "",
"countryCode": ""
},
"employeeCount": 0,
"revenue": 0,
"tags": [],
"websites": [],
"tickers": [
{
"symbol": "",
"exchange": ""
}
],
"twitterId": {
"id": "1",
"name": "",
"screenName": "1"
},
"externalSystemUrl": "",
"modifyDate": "",
"createDate": "",
"trustor": {
"enabled": true
},
"schema": {
"name": "",
"version": 1,
"enabled": true,
"jsonSchema": {
"id": "",
"$schema": "",
"title": "",
"description": "",
"type": "",
"required": [],
"properties": {},
"additionalProperties": {}
}
},
"customFields": {}
},
"surveyOptOut": true,
"externalSystemUrl": "",
"schema": {
"name": "",
"version": 1,
"enabled": true,
"jsonSchema": {
"id": "",
"$schema": "",
"title": "",
"description": "",
"type": "",
"required": [],
"properties": {},
"additionalProperties": {}
}
},
"customFields": {}
}
But wihile sending the request the answer is the following:
cache-control
no-cache, no-store, must-revalidate
content-type
application/json
inin-correlation-id
6867efc7-07df-4f22-a035-df9a1fd1e19e
inin-ratelimit-allowed
300
pragma
no-cacheAnd:with the following body:
{"message": "A schema ID must be specified when using customFields.","code": "custom.fields.validation.failed","status": 422,"contextId": "eb9a789f-304d-4336-96d8-7d393e2a69f6","details": [],"errors": []}Need to know how to correct this error, as when I try to consult nay schema associated to the External Contacts, there's nothing (I have configured manually one External Contact before attempting to create a second one using the API Explorer:The result of the External Contacts consultation using the APiI (/api/v2/externalcontacts/contacts
is the following:{"entities": [{"id": "7a168918-5ae3-4707-b432-281fa198c77c","firstName": "Jorge","middleName": "Marcelo","lastName": "Negri","modifyDate": "2020-07-28T15:51:45Z","createDate": "2020-07-28T15:51:45Z","surveyOptOut": false,"selfUri": "/api/v2/externalcontacts/contacts/7a168918-5ae3-4707-b432-281fa198c77c"}],"pageSize": 20,"pageNumber": 1,"total": 1,"firstUri": "/api/v2/externalcontacts/contacts?pageSize=20&pageNumber=1","selfUri": "/api/v2/externalcontacts/contacts?pageSize=20&pageNumber=1","lastUri": "/api/v2/externalcontacts/contacts?pageSize=20&pageNumber=1","pageCount": 1} And furthermore, no Schemas can be found if consulted using the API:
/api/v2/externalcontacts/contacts/schemas
with the following response found after consulting these Schemas:
cache-control
no-cache, no-store, must-revalidate
content-type
application/json
inin-correlation-id
23fe81f2-3177-43af-ae25-53d25818d338
inin-ratelimit-allowed
300
pragma
no-cache
BODY
{
"total": 0,
"entities": []
}
It would be also great if someone can provide an example of the minimum information that must be entered on the Body of the request, to create a simple External Contact using the corresponding API
#Ask Me Anything (AMA)
#Integrations
#SystemAdministration
------------------------------
Jorge Marcelo Negri
Senior Project Consultant
Genesys PureCloud Certified Associate
In Motion Argentina
Ciudad Autónoma de Buenos Aires
Argentina
------------------------------