Hi, I am trying to use this service, but I am stuck at the point where token is generated. I tried it using proxy, but it did not woork. Then, am trying using esri/request. The code is below. Can you help me please? var layersRequest = esriRequest({
url: "https://www.arcgis.com/sharing/rest/oauth2/token/",
content: { f: "json" },
handleAs: "json",
callbackParamName: "callback",
usePost: "true",
form: {
'f': 'json',
'client_id': 'YOUR_APPLICATIONS_CLIENT_ID',
'client_secret': 'YOUR_APPLICATIONS_CLIENT_SECRET',
'grant_type': 'client_credentials',
'expiration': '1440'
}
});
layersRequest.then(
function(response) {
console.log("Success: ", response.layers);
}, function(error) {
console.log("Error: ", error.message);
});
... View more