dcalatrava | 2021-05-04 12:25:23 UTC | #1
Dears,
I created a Data Action that use the external contact api of Zendesk to find an user by ID.
Here is the Data action Config :
{ "name": "Obtener Usuario por Cedula V2", "integrationType": "zendesk-data-actions", "actionType": "custom", "config": { "request": { "requestUrlTemplate": "https://humanasac.zendesk.com/api/v2/search.json?query=type:user%20cedula:${input.cedula}", "requestType": "GET", "headers": {}, "requestTemplate": "${input.rawRequest}" }, "response": { "translationMap": { "results": "$.results[*]" }, "translationMapDefaults": {}, "successTemplate": "{\"results\":${results}}" } }, "contract": { "input": { "inputSchema": { "type": "object", "properties": { "cedula": { "type": "string" } }, "additionalProperties": true } }, "output": { "successSchema": { "type": "object", "properties": { "results": { "type": "array", "items": { "title": "listaNdgndgCorrelationCode", "type": "object", "properties": { "id": { "type": "number" }, "url": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "createdat": { "type": "string" }, "updatedat": { "type": "string" }, "timezone": { "type": "string" }, "ianatimezone": { "type": "string" }, "phone": { "type": "string" }, "sharedphonenumber": { "type": "boolean" }, "localeid": { "type": "number" }, "locale": { "type": "string" }, "role": { "type": "string" }, "verified": { "type": "boolean" }, "tags": { "type": "array", "items": { "title": "tags", "type": [ "string", "null" ] }, "additionalItems": true }, "alias": { "type": "string" }, "active": { "type": "boolean" }, "shared": { "type": "boolean" }, "sharedagent": { "type": "boolean" }, "twofactorauthenabled": { "type": "boolean" }, "details": { "type": "string" }, "notes": { "type": "string" }, "moderator": { "type": "boolean" }, "ticketrestriction": { "type": "string" }, "onlyprivatecomments": { "type": "boolean" }, "restrictedagent": { "type": "boolean" }, "suspended": { "type": "boolean" }, "chatonly": { "type": "boolean" }, "reportcsv": { "type": "boolean" }, "userfields": { "type": "object", "properties": { "afiliadovip": { "type": "boolean" }, "casolegal": { "type": "boolean" }, "cedula": { "type": "number" } }, "additionalProperties": true }, "result_type": { "type": "string" } }, "additionalProperties": true }, "additionalItems": true }, "count": { "type": "number" } }, "additionalProperties": true } } }, "secure": false }
When Testing via the "Run action", all of the fields are filled with the correct data in JSON section but the entities not appear or empty.
In Architect Flow when i used the data action, not return data in any field.
Do you know where it can comes from?
Thanks in advance for your help.
Jason_Mathison | 2021-05-04 12:31:10 UTC | #2
Hi Daniel,
The entities not appearing or being empty in test mode indicates that the results of the data action are not matching your output contract. One trick I use is to initially set all of the items in the output contract to "required", as this will cause the data action to report a failure if you don't have everything getting a value.
In order for anyone to help you on the forum you will probably need to post an example of the response you are getting back from zendesk. Please cover any sensitive information (like xxxx over a name or phone number), however the keys and the shape / structure of the response needs to remain unchanged. If that isn't possible then I would recommend opening a case with customer care.
--Jason
dcalatrava | 2021-05-04 14:16:21 UTC | #3
Hi Jason,
That is the response from ZendesK on Postman.
{ "results": [ { "id": XXXXXX, "url": "XXXXXXXXX", "name": "XXXXXXX", "email": "XXXXXXXX", "createdat": "2021-03-03T21:59:16Z", "updatedat": "2021-04-28T16:32:24Z", "timezone": "American Samoa", "ianatimezone": "Pacific/PagoPago", "phone": "XXXXXXXX", "sharedphonenumber": false, "localeid": 1194, "locale": "es-419", "role": "end-user", "verified": true, "tags": [], "alias": "", "active": true, "shared": false, "sharedagent": false, "twofactorauthenabled": false, "details": "", "notes": "", "moderator": false, "ticketrestriction": "requested", "onlyprivatecomments": false, "restrictedagent": true, "suspended": false, "chatonly": false, "reportcsv": false, "userfields": { "afiliadovip": false, "casolegal": false, "cedula": XXXXXXXXX }, "result_type": "user" } ], "count": 1 }
In Genesys Cloud when i consume the service on the data action, the response is:
{ "results.alias": [ "" ], "results.userfields.cedula": [ XXXXXXXXXXXXx ], "results.url": [ "XXXXXXXXXXXXXXX" ], "results.verified": [ true ], "results.active": [ true ], "results.role": [ "end-user" ], "results.userfields.afiliadovip": [ false ], "results.userfields.casolegal": [ false ], "results.twofactorauthenabled": [ false ], "results.restrictedagent": [ true ], "results.notes": [ "" ], "results.onlyprivatecomments": [ false ], "results.chatonly": [ false ], "results.moderator": [ false ], "results.details": [ "" ], "results.phone": [ "XXXXXXXXXXXX" ], "results.ianatimezone": [ "Pacific/PagoPago" ], "results.resulttype": [ "user" ], "results.sharedphonenumber": [ false ], "results.createdat": [ "2021-03-03T21:59:16Z" ], "results.timezone": [ "American Samoa" ], "results.id": [ XXXXXXXXXXX ], "results.name": [ "XXXXXXXXXX" ], "results.sharedagent": [ false ], "results.suspended": [ false ], "results.shared": [ false ], "results.localeid": [ 1194 ], "results.updatedat": [ "2021-04-28T16:32:24Z" ], "results.locale": [ "es-419" ], "results.reportcsv": [ false ], "results.ticket_restriction": [ "requested" ], "results.email": [ "XXXXXXXX" ] }
Thanks in advance for your help.
system | 2021-06-04 14:16:22 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: 10806