Update custom fields in the widget at runtime using ZenDesk API



Publicado 08 jun 2021

I'm attempting to update the zendesk widget at runtime using data I've loaded asynchronously from a server.  I can initialize the values of the custom fields, but at runtime I'm only able to update the name and email address. 

- Is it possible to update a custom field post-initialization
- What is the correct syntax for the payload. 

I am using a react package to call the API.  https://www.npmjs.com/package/react-zendesk

The example I tried is listed below

API Call
ZendeskAPI('webWidget', 'prefill', test);

Payload
var test =
//{ id: '360044430071', prefill: { '*': '1. This is prefilled session text' }};
{
name: {
value: 'isamu',
readOnly: true // optional
},
email: {
value: 'isamu@voltron.com',
readOnly: true // optional
},
‘360044430071’: {
value: '9a74b148-35ed-4f41-afc5-d9f3301ea180',
readOnly: true
}
}


0

1

0 comentarios

      Iniciar sesión para dejar un comentario.

      ¿No encontró lo que buscaba?

      Nueva publicación