Insert records into a contact list through an action in genesys cloud

Hi all!

I am trying to use the api to insert records through actions in genesys cloud, but when I try to create the action it gives me the following error:

I have previously generated the contract as an array and it still gives me an error.

My question is the following: I have read in some posts here in the forum where it says that it is possible "Data Actions only allow a very simple input schema of a root object with key/value pairs, where the values are simple types like string/number /boolean.

To handle more complicated situations like this you will need to setup your input to have a root object with contactListId and phone number fields. Then use a request template to setup the basic body, and insert the values into the right spots.

Documentation for this is here: Request configuration for data actions - Genesys Cloud Resource Center"

But I don't understand, do I finally need a middleware to make this request? or is it not necessary?

My JSON request is the following:

[{
"data": {
"PHONE": "3208012311",
"NAME": "camilo",
"TTS" : "Test Operation",
"SCOPE" : "",
"RECORDDATE": "today",
"EVENT" : "Massive",
"LEVEL_1" : "3227620093",
"LEVEL_2" : "3227620093",
"LEVEL_3" : "3227620093",
"LEVEL_4" : "3227620093",
"LEVEL_5" : "3227620093",
"ACCEPTED": "",
"TIMEZONE": "America/Bogota"
}
}]

The api I am using is: /api/v2/outbound/contactlists/509885fa-fc34-4a9b-a5f6-c3a843a5122d/contacts?priority=true&doNotQueue=true

I have already found the solution, the problem was in the output of my contract, it was just leaving an array as output and it worked!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.