I hope someone can help, I’m trying to make use of the API using the Lua programming language (which I’m learning) - I’ve been successful with other 3rd party apis but not Sipgate .
With sipgate I get the following errors ., using the code below..
local mime = require("mime")
local http = require "socket.http"
local data = ""
local username = "user"
local password = "pass"
local function collect(chunk)
if chunk ~= nil then
data = data .. chunk
end
return true
end
local ok, statusCode, headers, statusText = http.request {
method = "GET",
headers = {
["Content-Type"] = "application/json",
["authentication"] = "Basic " .. (mime.b64(username ..":" .. password)),
},
sink = collect
}
--debug -
print("enc64", mime.b64(username ..":" .. password))
print("ok\t", ok);
print("statusCode", statusCode)
print("statusText", statusText)
print("headers:", headers)
print("data", data)