Class: WebhooksClient
Defined in: custom-code/webhooksClient.ts:28
Remarks
Represents a collection of functions to interact with the Webhooks API endpoints.
Extends
BaseClient
Constructors
new WebhooksClient()
new WebhooksClient(
optionalArgs
?):WebhooksClient
Defined in: custom-code/webhooksClient.ts:32
optionalArgs?
authenticationProvider
IAuthenticationProvider
sdkManager
SdkManager
Returns
Overrides
BaseClient.constructor
Accessors
authenticationProvider
Get Signature
get authenticationProvider():
IAuthenticationProvider
Defined in: node_modules/@aps_sdk/autodesk-sdkmanager/dist/src/baseClient.d.ts:4
Returns
IAuthenticationProvider
Set Signature
set authenticationProvider(
value
):void
Defined in: node_modules/@aps_sdk/autodesk-sdkmanager/dist/src/baseClient.d.ts:5
Parameters
value
IAuthenticationProvider
Returns
void
Inherited from
BaseClient.authenticationProvider
Methods
createSystemEventHook()
Operation: Create a Webhook for an Event
createSystemEventHook(
system
,event
,hookPayload
,optionalArgs
?):Promise
<void
>
Defined in: custom-code/webhooksClient.ts:65
Adds a new webhook to receive notifications of the occurrence of a specified event for the specified system.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
event
string
The ID of the event the webhook monitors. See Supported Events for a full list of events.
hookPayload
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<void
>
Throws
createSystemHook()
Operation: Create Webhooks for All Events
createSystemHook(
system
,hookPayload
,optionalArgs
?):Promise
<Hook
>
Defined in: custom-code/webhooksClient.ts:114
Adds a new webhook to receive notifications of all events for the specified system.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
hookPayload
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<Hook
>
Throws
createToken()
Operation: Create Secret Token
createToken(
tokenPayload
,optionalArgs
?):Promise
<Token
>
Defined in: custom-code/webhooksClient.ts:569
Sets a secret token to verify the authenticity of webhook payloads.
When a webhook event occurs, the service calculates a hash signature using the token and includes it in the event notification. The receiving application listening at the callback URL can verify the payload’s integrity by comparing the calculated signature to the one received.
The webhooks affected by this operation are determined by the type of access token you use.
- Two-legged Access Token: Sets the secret token for all webhooks owned by calling the app.
- Three-legged Access Token: Sets the secret token for all webhooks owned by the calling user
Note: Use the Update Webhook operation to set a token for a specific webhook.
See the Secret Token section in API Basics for more information.
Parameters
tokenPayload
The payload containing the token information.
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<Token
>
Throws
deleteSystemEventHook()
Operation: Delete a Webhook
deleteSystemEventHook(
system
,event
,hookId
,optionalArgs
?):Promise
<void
>
Defined in: custom-code/webhooksClient.ts:162
Deletes the webhook specified by its ID.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
event
string
The ID of the event the webhook monitors. See Supported Events for a full list of events.
hookId
string
The ID of the webhook to delete.
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<void
>
Throws
deleteToken()
Operation: Delete Secret Token
deleteToken(
optionalArgs
?):Promise
<void
>
Defined in: custom-code/webhooksClient.ts:619
Removes an existing secret token from the webhooks impacted by this operation.
The webhooks affected by this operation are determined by the type of access token you use.
- Two-legged Access Token: Sets the secret token for all webhooks owned by calling the app.
- Three-legged Access Token: Sets the secrety token for all webhooks owned by the calling user
Note that there can be a delay of up to 10 minutes while the change takes effect. We recommend that your callback accept both secret token values for a period of time to allow all requests to go through.
See the Secret Token section in API Basics for more information.
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<void
>
Throws
getAppHooks()
Operation: List All Webhooks for an App
getAppHooks(
optionalArgs
?):Promise
<Hooks
>
Defined in: custom-code/webhooksClient.ts:225
Retrieves a paginated list of webhooks created by the calling application. Each page includes up to 200 webhooks.
If the pageState
parameter is not provided, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
Note: This operation requires an access token through a Client Credentials flow (two-legged OAuth).
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
pageState
string
Base64 encoded string to fetch the next page of the list of webhooks. If you do not provide this parameter, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
sort
Specifies the sorting order of the list of webhooks by their lastUpdatedDate
attribute.
asc
- Ascending order.desc
- (Default) Descending order.
status
Filters retrieved webhooks by their current state. Possible values are
active
- Successfully delivered most recent event notifications.inactive
- Failed to deliver most recent event notification and has been deactivated.reactivated
- Previously inactive but was reactivated. No events have occurred since reactivation.
If this parameter is not specified, the filter is not applied. See Event Delivery Guarantees for more information on how the state of a webhook changes.
Returns
Promise
<Hooks
>
Throws
getHookDetails()
Operation: Get Webhook Details
getHookDetails(
system
,event
,hookId
,optionalArgs
?):Promise
<HookDetails
>
Defined in: custom-code/webhooksClient.ts:274
Retrieves the details of the webhook for the specified event within the specified system.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
event
string
The ID of the event the webhook monitors. See Supported Events for a full list of events.
hookId
string
The ID of the webhook to delete. *
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<HookDetails
>
Throws
getHooks()
Operation: List All Webhooks
getHooks(
optionalArgs
?):Promise
<Hooks
>
Defined in: custom-code/webhooksClient.ts:330
Retrieves a paginated list of webhooks available to the provided access token within the specified region. Each page includes up to 200 webhooks.
If the pageState
parameter is not provided, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
pageState
string
Base64 encoded string to fetch the next page of the list of webhooks. If you do not provide this parameter, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
status
Filters retrieved webhooks by their current state. Possible values are
active
- Successfully delivered most recent event notifications.inactive
- Failed to deliver most recent event notification and has been deactivated.reactivated
- Previously inactive but was reactivated. No events have occurred since reactivation.
If this parameter is not specified, the filter is not applied. See Event Delivery Guarantees for more information on how the state of a webhook changes.
Returns
Promise
<Hooks
>
Throws
getSystemEventHooks()
Operation: List All Webhooks for an Event
getSystemEventHooks(
system
,event
,optionalArgs
?):Promise
<Hooks
>
Defined in: custom-code/webhooksClient.ts:388
Retrieves a paginated list of webhooks for the specified event. The returned list contains a subset of webhooks accessible to the provided access token within the specified region. Each page includes up to 200 webhooks.
If the pageState
parameter is not provided, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
event
string
The ID of the event the webhook monitors. See Supported Events for a full list of events.
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
pageState
string
Base64 encoded string to fetch the next page of the list of webhooks. If you do not provide this parameter, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
scopeName
string
Filters retrieved webhooks by the scope name used to create hook. For example : folder
. If this parameter is not specified, the filter is not applied.
status
Filters retrieved webhooks by their current state. Possible values are
active
- Successfully delivered most recent event notifications.inactive
- Failed to deliver most recent event notification and has been deactivated.reactivated
- Previously inactive but was reactivated. No events have occurred since reactivation.
If this parameter is not specified, the filter is not applied. See Event Delivery Guarantees for more information on how the state of a webhook changes.
Returns
Promise
<Hooks
>
Throws
getSystemHooks()
Operation: List All Webhooks for a System
getSystemHooks(
system
,optionalArgs
?):Promise
<Hooks
>
Defined in: custom-code/webhooksClient.ts:450
Retrieves a paginated list of webhooks for the specified system. The returned list contains a subset of webhooks accessible to the provided access token within the specified region. Each page includes up to 200 webhooks.
If the pageState
parameter is not provided, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
pageState
string
Base64 encoded string to fetch the next page of the list of webhooks. If you do not provide this parameter, the first page of results is returned. Use the next
value from the previous response to fetch subsequent pages.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
status
Filters retrieved webhooks by their current state. Possible values are
active
- Successfully delivered most recent event notifications.inactive
- Failed to deliver most recent event notification and has been deactivated.reactivated
- Previously inactive but was reactivated. No events have occurred since reactivation.
If this parameter is not specified, the filter is not applied. See Event Delivery Guarantees for more information on how the state of a webhook changes.
Returns
Promise
<Hooks
>
Throws
patchSystemEventHook()
Operation: Update a Webhook
patchSystemEventHook(
system
,event
,hookId
,modifyHookPayload
,optionalArgs
?):Promise
<void
>
Defined in: custom-code/webhooksClient.ts:510
Updates the webhook specified by the hook_id
parameter. Currently the only attributes you can update are:
- filter
- status
- hook attribute
- token
- auto-reactivate hook flag
- hook expiry
- callbackWithEventPaylaod flag
See the modifyHookPayload
parameter documentation for more information.
Parameters
system
string
The ID of the system the webhook applies to. For example data for Data Management. See Supported Events for a full list of supported systems and their IDs.
event
string
The ID of the event the webhook monitors. See Supported Events for a full list of events.
hookId
string
The ID of the webhook to delete.
modifyHookPayload
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<void
>
Throws
putToken()
Operation: Update Secret Token
putToken(
tokenPayload
,optionalArgs
?):Promise
<void
>
Defined in: custom-code/webhooksClient.ts:671
Replaces an existing secret token with a new one.
Note that there can be a delay of up to 10 minutes while the change takes effect. We recommend that your callback accept both secret token values for a period of time to allow all requests to go through.
The webhooks affected by this operation are determined by the type of access token you use.
- Two-legged Access Token: Sets the secret token for all webhooks owned by calling the app.
- Three-legged Access Token: Sets the secrety token for all webhooks owned by the calling user
Note: Use the Update Webhook operation to set a token for a specific webhook.
See the Secret Token section in API Basics for more information.
Parameters
tokenPayload
optionalArgs?
accessToken
string
An access token obtained by a call to GetThreeLeggedTokenAsync() or GetTwoLeggedTokenAsync().
options
ApsServiceRequestConfig
Override http request option.
region
Specifies the geographical location (region) of the server the request must be executed on. This also corresponds to the region where the Webhook data is stored. It is also the location of the server that will make request to your callback URL. Possible values:
US
- (Default) Data center dedicated to serve the United States region.EMEA
- Data center dedicated to serve the European Union, Middle East, and Africa regions.APAC
- (Beta) Data center dedicated to serve the Australia region.
Note: Beta features are subject to change. Please avoid using them in production environments.
Returns
Promise
<void
>