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

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": []
    }
  ]
}```

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:

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

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