Set participant data using a script during an outbound call

Hi there,

I'm trying to set the participant data using a script.

So when an agent fills in ali_callbacknumber and ali_callbacktime fields, it will show up in the conversation/interaction details.

How do I go about it? Thank you!

Set the values to Output
image

2 Likes

Thank you for your help!

It's showing on the Participant Data, however I'd like to add it to the customer info. Would there be a way to do so?

Appreciate it!

The only way to do this would be through a data action. You would need to identify the customer participant id (which is available in the script) and set it via API after the button is presssed to create the callback.

Update Attributes on a Conversation | PATCH /api/v2/conversations/callbacks/{conversationId}/participants/{participantId}/attributes

1 Like

I'm having issues setting up the data action, not sure what is needed for PATCH requests. so far this is what I have:



I'm getting this error:

{
  "message": "The request could not be understood by the server due to malformed syntax.",
  "code": "bad.request",
  "status": 400,
  "messageParams": {},
  "contextId": "768e27d9-3b00-4a50-a05a-2ad251177806",
  "details": [
    {
      "errorCode": "ACTION.REMOTE_ENDPOINT"
    }
  ],
  "errors": [
    {
      "message": "REST call for action execute failed. Message: Request to backend service failed.  Response from web service: {\"message\":\"Bad Request\",\"code\":\"bad.request\",\"status\":400,\"messageWithParams\":\"Bad Request\",\"messageParams\":{\"message\":\"'attributes' is a required property for this operation\"},\"contextId\":\"9ec96586-9607-41ef-b13f-ad7b914dacd0\",\"details\":[],\"errors\":[]} [768e27d9-3b00-4a50-a05a-2ad251177806]",
      "code": "BAD_REQUEST",
      "status": 400,
      "messageParams": {},
      "details": [],
      "errors": []
    }
  ]
}

Hi,

you need a body like so:
{
"attributes": {
"AttributeName": "AttributeValue
}
}

In the body template

1 Like

That worked! Thank you so much!

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