integrating Zendesk Talk API code in the telephony

2020-03-07 08:06发布

I have existing telephony system and now I want to integrate into zendesk, I have gone through Talk Partner Edition API .

I already asked you about this in this Zendesk Question, and thanks to a member with us jimmy Long, things are seems to be clear, but i wanna know more about how i will write code, so i have another Questions.

Question 1: if i wanna create a call ticket in the zendesk automatically from telephony system as a code java-script, should i write it in the telephony system like this ?? or there is another script ??

$.ajax({
    url: '/api/v2/channels/voice/tickets.json',
    contentType:'application/json',
    type: 'POST',
    data: JSON.stringify({
                            "ticket": {
                                            "via_id": 45,
                                            "description": "Voicemail from: +0000000000",
                                            "voice_comment": {
                                            "from": "+00000000000",
                                            "to": "+000000000000",
                                            "recording_url": "http://XXXXXX.zendesk.com/recordings/1.mp3",
                                            "started_at": "2019-02-26 14:08:36 +0000",
                                            "call_duration": 40,
                                            "answered_by_id": 374879813254,
                                            "transcription_text": "The transcription of the call",
                                            "location": "XXXX, YYYYY"
                                                                }
                                        }                           
                        })
  })
  .done(function(data) {
    console.log(data.ticket);
  });

Question 2: for example we have in the code a line contain ("transcription text": "The transcription of the call") ??

can i change the constant value ("The transcription of the call") to a variable , i mean can i change "The transcription of the call" to a dynamic variable,


Question 3: can i send all this information in a URL, i mean sending data in a url like (http://XXXX.zendesk.com/api/v2/channels/voice/tickets.json/data1/data2/data3....) ??

0条回答
登录 后发表回答