I have programmed some code in accordance with the rest API, to integrate a chat bot to Viber.
The core part of it is -:
$.ajax({
url : url ,
dataType : "jsonp",
type : 'POST',
jsonpCallback: 'fn',
headers: {
'X-Viber-Auth-Token': '45a53f0fcb325002-41552d1f93cd0d0f-1a8d7fa78758d158'
},
data : {
"url": "",
"event_types": ["delivered", "seen", "failed", "subscribed","unsubscribed", "conversation_started"]
},
success : function (data) {
//console.log(data);
},
error : function (data, errorThrown) {
//console.log(data);
alert(errorThrown);
}
});
I am getting a parse error and the parse error is "Uncaught SyntaxError: Unexpected token :". You can visit the code from -: https://manveer695.github.io/hello-world/viberStuff.html and check the errors yourself.
Any syntax error or some other problem? Thanks in advance. :)