Working on implementing a basic webhook based smartsheet connector to fetch usage data for users under one organization. During the Oauth2.0 flow, requested for following scopes "READ_USERS, ADMIN_USERS, ADMIN_WEBHOOKS".
I am making the following javascript-sdk api calls : -
- smartsheetClient.users.listAllUsers
- smartsheetClient.sheets.listOrganizationSheets
- smartsheetClient.webhooks.createWebhook
- smartsheetClient.webhooks.updateWebhook
As I am the admin of my company's smartsheet account, generated the access token using my admin account (authorization). Here, first I created the integration app in Developer Tools via my account. The connector flow is working fine, i am able to fetch a list of sheets under my org account (https://smartsheet-platform.github.io/api-docs/#list-org-sheets) and then able to create webhook per sheet (https://smartsheet-platform.github.io/api-docs/#create-webhook), and then whenever a smartsheet event is occuring on those sheet, I am able to receive a webhook payload event.
However, now when a external customer (admin user of some org) authorizes us access for their smartsheet account (with same scopes "READ_USERS, ADMIN_USERS, ADMIN_WEBHOOKS"), fetching of sheets (smartsheetClient.sheets.listOrganizationSheets) is working fine, however creating webhook per sheet is not working). Getting the following error : -
[Smartsheet] 2019-09-10T16:49:26.281Z[ INFO] POST https://api.smartsheet.com/2.0/webhooks/
[Smartsheet] 2019-09-10T16:49:26.564Z[ ERROR] Request failed after 0 retries
[Smartsheet] 2019-09-10T16:49:26.565Z[ ERROR] POST https://api.smartsheet.com/2.0/webhooks/
[Smartsheet] 2019-09-10T16:49:26.565Z[ ERROR] Response: Failure (HTTP 404)
Error Code: 1151 - Scope 'sheet', object id <id> was not found.
Ref ID: xb9zhox8mpu3
https://smartsheet-platform.github.io/api-docs/#create-webhook is failing.
Please let me know in case I am doing something wrong is access scopes requested or any other kind of error.