Hello,
I'm trying to fetch a list of instances using JSON endpoint:
var request = new XMLHttpRequest(); request.open('POST', 'https://www.botlibre.com/rest/json/get-all-instances', true); request.setRequestHeader('Content-Type', 'application/json'); var json = JSON.stringify({'application': '721375371321663745'}); request.onreadystatechange = function() { console.log(request.responseText); }; request.send(json);
However, I got the following response:
Missing application id. You can obtain an application id from your user page.
Am I doing something wrong? What is the correct way to pass an application id to this JSON endpoint?
The same request body format works fine with JSON "/rest/json/chat":
var request = new XMLHttpRequest(); request.open('POST', 'https://www.botlibre.com/rest/json/chat', true); request.setRequestHeader('Content-Type', 'application/json'); var json = JSON.stringify({ "application": "721375371321663745", "instance": "909409", "message": "Hello" }); request.onreadystatechange = function() { console.log(request.responseText); }; request.send(json);
|