Code: Select all
function jobArrived( s : Switch, job : Job )
{
var theHTTP = new HTTP( HTTP.SSL );
theHTTP.authScheme = HTTP.OauthAuth;
theHTTP.authorization = "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
theHTTP.url = "https://app.keyline-mis.com/api/v2/sales/orders";
theHTTP.get();
while( !theHTTP.waitForFinished( 3 ) )
{
job.log( 1, "API CALL IN PROGRESS!" );
}
if( theHTTP.finishedStatus == HTTP.Ok && theHTTP.statusCode == 200 )
{
job.log(1,"RESPONSE: ",theHTTP.getServerResponse().toString( "UTF-8" ));
}
}
Docs: https://keyline-mis.de/docs/api#
How can i make this work?
lg
Ben