Legacy Dev Forum Posts

 View Only

Sign Up

Remotely Action/Test a Data Action

  • 1.  Remotely Action/Test a Data Action

    Posted 06-05-2025 18:49

    Lloyd | 2020-08-30 23:21:14 UTC | #1

    We have a data action that appears to fail randomly; We've confirmed it is the remote endpoint that causes this issue, and while we are waiting on the provider to resolve it we were looking at putting in some periodic testing.

    Currently I can test it remotely, but thought a better approach would be to remotely trigger the data action & confirm the response from a PureCloud perspective.

    But Looking at the Integrations API, I'm not sure of the process to do this. This is as far as I got...

    Example testing with a simple data action:

    I can retrieve the action properties

    GET/api/v2/integrations/actions?name=Get Estimated Wait Time v2

    returns

    { "entities": [ { "id": "custom-878b9d03-7b9f-4946-9b68-d91da6176be7", "name": "Get Estimated Wait Time v2", "integrationId": "8acb4c23-6a67-4ecd-b2de-8ee38332a912", "category": "PIH PureCloud Data Actions", "contract": { "output": { "successSchemaUri": "/api/v2/integrations/actions/custom-878b9d03-7b9f-4946-9b68-d91da6176be7/schemas/successschema.json", "errorSchemaUri": "/api/v2/integrations/actions/custom-878b9d03-7b9f-4946-9b68-d91da6176be7/schemas/errorschema.json" }, "input": { "inputSchemaUri": "/api/v2/integrations/actions/custom-878b9d03-7b9f-4946-9b68-d91da6176be7/schemas/inputschema.json" } }, "version": 1, "secure": false, "selfUri": "/api/v2/integrations/actions/custom-878b9d03-7b9f-4946-9b68-d91da6176be7" } ] }

    and from that my next guess was to get the schema using:

    GET/api/v2/integrations/actions/custom_-_878b9d03-7b9f-4946-9b68-d91da6176be7/schemas/inputschema.json

    which returned:

    { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Estimated Wait Time Request", "description": "The estimated wait time for a specific media type and queue.", "type": "object", "required": [ "QUEUEID", "MEDIATYPE" ], "properties": { "QUEUEID": { "description": "The queue ID.", "type": "string" }, "MEDIATYPE": { "description": "The media type of the interaction: call, chat, callback, email, social media, or video communication.", "type": "string", "enum": [ "call", "chat", "callback", "email", "socialExpression", "videoComm" ] } }, "additionalProperties": true }

    But at that point I wasn't sure what the next step was?

    Thanks


    Jason_Mathison | 2020-08-31 10:59:18 UTC | #2

    Hi Lloyd,

    You can execute the action by performing a post to /api/v2/integrations/actions/{actionId}/execute The body of the post should match your input schema, so in this case something like: { "QUEUEID" : "GUIDOFYOURQUEUE", "MEDIA_TYPE" : "call" }

    From there depending on the failure you may either be able to look at the HTTP response code or the response body to determine if the remote endpoint is failing.

    --Jason


    Lloyd | 2020-08-31 21:18:40 UTC | #3

    Thanks Jason!

    That worked perfectly! And also thanks to your response I've now got my head around the drafts/tests as well & can also create a draft & run that to find in detail where the data-action is failing from a PureCloud perspective too.

    -Lloyd


    system | 2020-10-01 21:18:42 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: 8692