url = "https://api-demo.sambasafety.io/oauth2/v1/token";
headers = {
"x-api-key": "WJDBWMdYFX3FbAlf3WY8DWBzaG3MaQI9SPbWE0j7",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic MG9hMTl5Yjlod2dyU3VnNVMzNTg6ZHBvNGFYLWZlWFBqQ2tHanF1YjgwdTc2OG5PY0pUQ3ZGSmtlOTVXUkc2RVFNbWdmMlQxWlUzOUthOEEtT0dnMA=="
};
params = map();
params.put("grant_type", "client_credentials");
params.put("scope", "API");
x = invokeurl
[
url: url
type: POST
parameters:params
headers: headers
];
//info x;
access_token = x.get("access_token");
/////////////////////////////////////////////
/////////////////////////////////////////////////////////
url = "https://api-demo.sambasafety.io/organization/v1/groups/92790";
headers = {
"x-api-key": "WJDBWMdYFX3FbAlf3WY8DWBzaG3MaQI9SPbWE0j7",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Bearer " + access_token
};
x = invokeurl
[
url: url
type: get
headers: headers
];
info x;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter