PUT /service/api/notifications/subscriptions/{subscriptionId}
Edits the information of a specific subscription.
When changing the webhook's DeliveryContext or DeliveryUrl value, a synchronous validation call to the webhook DeliveryUrl will be made. The webhook has to respond successfully and with the expected ValidationResponse value in the response (the value must match the ValidationContext value provided in the webhook request). Otherwise the subscription will not be modified and an error is returned.
See the subchapter about "Webhook Calls: Validation Message" in the webhook section of the Notifications Guide for more information.
Request Information
URI Parameters
Name | Description | Type | Additional Information |
---|---|---|---|
subscriptionId |
The identifier of the subscription to modify. |
string |
Required |
URI Sample(s)
PUT
|
https://unityapi.webrootcloudav.com/service/api/notifications/subscriptions/3b07cdf1-746c-4c12-8bfe-aa46226d1f6d
|
Body Parameters
The modifications information for the subscription.
Values that are not provided will be left unchanged.
EditSubscriptionRequestModelName | Description | Type | Additional Information |
---|---|---|---|
DeliveryType |
The delivery type to change the subscription to. Valid values are: "fetch" or "webhook". |
string |
None. |
EventTypes |
The list of event types the subscription should be changed to. This will replace the previous list of subscribed event types. |
Collection of string |
None. |
Webhook |
Webhook related properties that should be updated or set for the subscription. |
EditSubscriptionRequestModelWebhook |
Required, if webhook properties should be changed or when changing the subscription's DeliveryType to "webhook". |
Sample Request
{ "DeliveryType": "webhook", "EventTypes": [ "Endpoint.FileDetection" ], "Webhook": { "DeliveryContext": "MyCustomCorrelationString", "DeliveryRateInSeconds": 90, "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook" } }
<EditSubscriptionRequestModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models"> <DeliveryType>webhook</DeliveryType> <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>Endpoint.FileDetection</d2p1:string> </EventTypes> <Webhook> <DeliveryContext>MyCustomCorrelationString</DeliveryContext> <DeliveryRateInSeconds>90</DeliveryRateInSeconds> <DeliveryUrl>https://my.company.com/wrunity/notifications/webhook</DeliveryUrl> </Webhook> </EditSubscriptionRequestModel>
Response Information
Resource Description
Information about the modified subscription.
EditSubscriptionResponseModelName | Description | Type | Additional Information |
---|---|---|---|
SubscriptionId |
The subscription identifier. |
string |
None. |
DeliveryType |
The delivery type of the subscription. |
string |
None. |
Domain |
The domain the subscription has been created for. |
SubscriptionResponseModelDomain |
None. |
EventTypes |
The list of subscribed event types. |
Collection of string |
None. |
Webhook |
Information about webhook properties set for the subscription. This value is null, if DeliveryType is anything other than "webhook". |
SubscriptionResponseModelWebhook |
None. |
CreatedDate |
The time when the subscription was created. |
date |
None. |
UpdatedDate |
The time when the subscription was last updated. |
date |
None. |
Sample Response
{ "SubscriptionId": "801502ec-2397-4703-a135-2930ff959183", "DeliveryType": "webhook", "Domain": { "Type": "Site", "Values": [ { "Name": "GSMKey", "Value": "76F1-D80F-D801-4641-8373" }, { "Name": "SiteKey", "Value": "DA78-91ED-9955-492B-AF86" } ] }, "EventTypes": [ "Endpoint.FileDetection" ], "Webhook": { "DeliveryContext": "MyCustomCorrelationString", "DeliveryRateInSeconds": 90, "DeliveryUrl": "https://my.company.com/wrunity/notifications/webhook", "Suspended": false, "Statistics": null }, "CreatedDate": "2024-09-02T10:39:35.6120722Z", "UpdatedDate": "2024-12-02T10:37:35.6120722Z" }
<EditSubscriptionResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Notifications.Models"> <CreatedDate>2024-09-02T10:39:35.6120722Z</CreatedDate> <DeliveryType>webhook</DeliveryType> <Domain> <Type>Site</Type> <Values> <SubscriptionResponseModelDomainValue> <Name>GSMKey</Name> <Value>76F1-D80F-D801-4641-8373</Value> </SubscriptionResponseModelDomainValue> <SubscriptionResponseModelDomainValue> <Name>SiteKey</Name> <Value>DA78-91ED-9955-492B-AF86</Value> </SubscriptionResponseModelDomainValue> </Values> </Domain> <EventTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>Endpoint.FileDetection</d2p1:string> </EventTypes> <SubscriptionId>801502ec-2397-4703-a135-2930ff959183</SubscriptionId> <UpdatedDate>2024-12-02T10:37:35.6120722Z</UpdatedDate> <Webhook> <DeliveryContext>MyCustomCorrelationString</DeliveryContext> <DeliveryRateInSeconds>90</DeliveryRateInSeconds> <DeliveryUrl>https://my.company.com/wrunity/notifications/webhook</DeliveryUrl> <Statistics i:nil="true" /> <Suspended>false</Suspended> </Webhook> </EditSubscriptionResponseModel>