Legacy Dev Forum Posts

 View Only

Sign Up

Creating Callback for 24 hours from current date/time via Data Action

  • 1.  Creating Callback for 24 hours from current date/time via Data Action

    Posted 06-05-2025 18:45

    Aaron_Shirley | 2024-01-26 21:29:44 UTC | #1

    Hello,

    I'm trying to build a data action to create a scheduled callback for a contact via data action. Essentially, using the Rule Manage to execute the action if a specific criterion is met. What I want to have happen is for the call back to be created with a value equal to 24 hours in the future from the time the action is fired. My draft is below but I am receiving a failed validation error due to malformed syntax.

    What am I missing here?

    {
      "scriptId": "",
      "queueId": "${input.QueueID}",
      "routingData": {},
      "callbackUserName": "${input.ScheduledCallbackCount}",
      "callbackNumbers": [
        "${input.CallBackNumber}"
      ],
      "callbackScheduledTime": "${dateAdd(now(), 24, 'hours').toISOString()}",
      "countryCode": "",
      "validateCallbackNumbers": true,
      "data": {},
      "callerId": "",
      "callerIdName": ""
    }

    ` { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "c627da17-b66f-4738-af8d-4c2d5a33de05", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [ { "message": "Action failed validation. Errors: [Template validation failed for 'config.request.requestTemplate'. Details: Encountered \"(now(), 24, \\'hours\\').toISOString()}\\\",\\n \\\"countryCode\\\": \\\"\\\",\\n \\\"validateCallbackNumbers\\\": true,\\n \\\"data\\\": {},\\n \\\"callerId\\\": \\\"\\\",\\n \\\"callerIdName\\\": \\\"\\\"\\n\" at validate config.request.requestTemplate[line 9, column 38]\nWas expecting one of:\n \"[\" ...\n \"|\" ...\n \"}\" ...\n \"}\" ...\n ]", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }`


    Jason_Mathison | 2024-02-04 04:58:48 UTC | #2

    Hi Aaron, I don't have any immediate solutions to what you are trying to do.

    As far as I can tell, the API for creating a callback is expecting an ISO string, and is not expecting anything like now() to be passed to it: https://developer.genesys.cloud/devapps/api-explorer#post-api-v2-conversations--conversationId--participants--participantId--callbacks

    Data actions currently do not have any tools for creating or manipulating dates and times. Here is an idea you can vote for as well as adding your use case: https://genesyscloud.ideas.aha.io/ideas/OP-I-337

    --Jason


    system | 2024-03-06 04:59:26 UTC | #3

    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: 24314