Hey Devs,
I’m trying to poll /jobs endpoint to ensure a new project is successfully created before moving onto other project related actions. Within Asana Developer, I’ve given my app full permissions related to Portfolios, Projects, Templates, and Workspaces.
I’ve been able to successfully call the following endpoints:
- /project_templates
- /projects
- /users
- /instantiateProject
- /portfolios
I’ve ensured I’ve provided the same scope when instantiating my Asana OAuth client.
However, when trying to poll it fails related to admin scope.
Code: 403.
Response: {
"errors": [
{
"message": "One of the following scopes must be present to use this endpoint: admin.object_exports. Alternatively, you can request full permissions."
"help": "For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors"
}]}"
Here is the relevant code.
const url = `https://app.asana.com/api/1.0/jobs/${jobGid}`;
const response = UrlFetchApp.fetch(url, {
method: 'get',
headers: { Authorization: `Bearer ${asanaService.getAccessToken()}` },
muteHttpExceptions: true
});
const responseCode = response.getResponseCode();
const responseText = response.getContentText();
if (responseCode !== 200) {
throw new Error(`ASANA_JOB_POLL_ERROR: Failed to poll job. Code: ${responseCode}. Response: ${responseText}`);
}
After any changes to oauth scope, I always clear and fetch a new auth token.
Any help or advice to troubleshoot this would be very welcome!
Thanks everyone ![]()