Skip to main content

I am attempting to execute the following code, but every time I get the error message that the credentials are unrecognised.  The APIKey I am using the the APIKey associated with the administrator account.  I have also tried with the email address and password with the same effect. 

									client.request.get(

"https://"+<<domain>>+"/api/v2/agents",

{ headers: {

"Content-Type": "applicationi/json",

"Authorisation" :"Basic "+ btoa(`<<APIKey>>:X`)

}}

).then(

function(data){

Agents=data;

}

); 

 

Basically, I am after the list of agents and groups, which I have noticed is always loaded whenever a page is loaded, even for non-admin users.


i.e. https://<domain>>/api/_/bootstrap/agentGroups.


As this is available (via browser development tools), I'm not sure why there is no equivalent API available to Apps?

  



Resolved.  The problem is I was using the English rather than American spelling.  It should have been "Authorization"