Update a subscription
PATCH
v1/subscriptions/{subscriptionId}
Partially update some properties of the subscription corresponding to the path parameter subscriptionId.
Resource Information
Method and URI | PATCH https://developer.api.autodesk.com/fevnt/v1/subscriptions/:subscriptionId |
Authentication Context | user context optional |
Required OAuth Scopes | data:read data:write |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via either a two-legged or three-legged OAuth flow. |
Content-Type* string | Must be application/json |
x-request-id string | GUID used by the service team track the request |
region string | Specifies the geographical location (region) of the server that the request is executed on. Default is US. |
collection-id string | Specifies the collection ID being subscribed to. The request will be routed to the region containing the collection. The region header and region query parameter always have precedence over this header. |
locale-container-id string | Specifies the Locale Service container ID. The request is routed to the region specified by this ID. The region header and region query parameter always have precedence over this header. |
* Required
Request
URI Parameters
subscriptionId string | The subscription ID for the operation. |
Request
Query String Parameters
region string | Specifies the geographical location (region) of the server that the request is executed on. Default is US. The region header also specifies the region. If you specify both, the region header has precedence. |
locale-container-id string | Specifies the Locale Service container ID. The request is routed to the region specified by this ID. The region header and region query parameter always have precedence over this query parameter. |
Request
Body Structure
The request body is a JSON object describing the parameters of the subscription to be updated.
hookToken string | Optional parameter when using the “HTTPS” protocol to set a secret token to prevent callback spoofing. Providing null removes the hook token. The token must be between 32 and 64 alpha-numeric characters (inclusive). When you set your secret token, Data Events Service uses it to create a hash signature for each payload. This hash signature is passed along with each request, as the header x-adsk-signature. In order to validate that the request came from Data Events Service, subscribers compute a hash using their token and ensure that it matches the hash from the Data Events Service. Data Events Service uses an HMAC hexdigest to compute the hash. |
subscriptionExpiry string | ISO8601 formatted date and time when the subscription should expire and automatically be deleted. For the HTTP protocol, null or not present means the subscription never expires. For the WSS protocol, a value is required. The expiry may not be more than 1 year into the future. Providing null updates the hook so that it never expires. |
status string | “active” if the subscription is active, or “inactive” if the subscription is inactive. Inactive subscriptions do not receive events. |
Response
HTTP Status Code Summary
200 OK | The subscription was successfully updated |
400 Bad Request | Bad Request response includes title with the general reason for the failure as well as detail containing the description of the problem. When necessary, the response can include additional error details in errors array, each element of which contains both title and detail, as well as field identifying the source of the error. |
401 Unauthorized | Request has not been applied because it lacks valid authentication credentials for the target resource. |
403 Forbidden | The server understood the request but refuses to authorize it. |
404 Not Found | The resource cannot be found. |
429 Too Many Requests | User has sent too many requests in a given amount of time. |
500 Internal Server Error | An unexpected error occurred on the server. |
503 Service Unavailable | Service temporarily unavailable. |
Example
The subscription was successfully updated
Request
curl -v 'https://developer.api.autodesk.com/fevnt/v1/subscriptions/:subscriptionId' \
-X 'PATCH' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"hookToken": "8M18VVe9KcmdwharRA8t2MRhYm5XJfkI",
"subscriptionExpiry": "2021-07-15T01:15:36Z",
"status": "inactive"
}'
Show More
Response
{}