최근 검색


최근 검색 없음

Update custom fields in the widget at runtime using ZenDesk API



2021년 6월 08일에 게시됨

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

댓글 1개

The solution is to call the api using "updatesettings" and pass in the data structure you use for initialization. The "prefill" command doesn't seem to actually work for anything other than name and email. This is something you should probably document for other users.

 

1


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물