kbowen | 2022-09-08 16:00:17 UTC | #1
Hello,
I am attempting to use PUT /api/v2/externalcontacts/contacts/{contactId} to import the custom fields we have in a schema.
I have used GET /api/v2/externalcontacts/contacts/{contactId} to see if I could figure out how to form the PUT request. This get shows that the customFields section would be formatted as:
"customFields": { "businessnametext": "Business Co.", "accountnumbertext": "1234567890".
}
However, in the PUT request, it is calling for another key.
I'm not sure what other key is needed here. I have tried putting in the contact's GUID or even duplicating one of the field keys with no luck.
This is how it looks without that field: "customFields": { "": { "businessname_text": "Business Co" } }
Getting the error: The request failed with response code: 422. Message: The custom field values for the entity were not valid.
I know the field is valid because of the GET to verify the field names
Jerome.Saint-Marc | 2022-09-08 17:19:10 UTC | #2
Hello,
That seems to be a problem caused by the API Endpoint schema provided by Engineering.
I think I understand what Engineering had in mind with specifying Map<string, object>. Their idea was probably to imply that object could be string/number/boolean (Key/value with value being a string, a number or a boolean).
The problem is that the API Explorer tool interprets it literally.
It'd be necessary to raise a ticket with Customer Care to get Engineering resolve this.
As an alternative way, you can also use the legacy API Developer Tool - you can put your JSON directly into the tool. You can connect via https://developer.genesys.cloud/developer-tools/ and select API Explorer tile.
Regards,
kbowen | 2022-09-08 17:19:36 UTC | #3
Thank you Jerome,
Trying it out in legacy worked. I will raise a case on this as well.
system | 2022-10-09 17:19:46 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 16205