For a customer i need to call an API to get a JSON String. I didn’t succeed, doing this with xojo.
I know how to call the Interface with php:
header('Content-type: application/json');
define('API_ID', '1234');
define('API_KEY', 'abcdefghijk1234567890');
define('API_FORMAT', 'json'); #or xml
define('API_URL', 'https://api.service.tld/vxyz/'.API_FORMAT.'/'.API_ID.'/'.API_KEY.'/');
# Get statistics
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, API_URL.'ACD/Statistics/Agents');
curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
echo curl_exec($ch);
curl_close($ch);
Running this code on a webserver i get the JSON-String in the browser.
I think i know how to parse this string in xojo, but i don’t have an idea how to call the API, and then parse the result, and getting the data from the string.
Thanks for any kind of tip…