Updates a webhook.
3321123
The ID of the webhook.
https://example.com/webhooks
The URL that is notified by this webhook
The item that will trigger the webhook
1231232
The ID of the item to trigger a webhook
file
The type of item to trigger a webhook
Value is one of file
,folder
["FILE.UPLOADED"]
An array of event names that this webhook is to be triggered for
Returns the new webhook object.
Returns an error if the parameters were incorrect.
Returns an error if the application does not have the permission to manage webhooks.
Returns an error if the target item or webhook could not be found
Returns an error if the a webhook for this combination of target, application, and user already exists.
An unexpected client error.
curl -X PUT https://api.box.com/2.0/webhooks/3321123 \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-H 'Content-Type: application/json" '
-d '{
"triggers": [
"FILE.DOWNLOADED"
]
}'
var updates = new BoxWebhookRequest()
{
Id = "12345",
Address = "https://example.com/webhooks/fileActions
};
BoxWebhook updatedWebhook = await client.WebhooksManager.UpdateWebhookAsync(updates);
BoxWebHook webhook = new BoxWebHook(api, id);
BoxWebHook.Info info = webhook.getInfo();
info.addPendingChange("address", url);
webhook.update(info);
update_object = {
'triggers': ['FILE.COPIED'],
'address': 'https://newexample.com',
}
webhook = client.webhook(webhook_id='12345').update_info(update_object)
print('Updated the webhook info for triggers: {0} and address: {1}'.format(webhook.triggers, webhook.address))
client.webhooks.update('678901', {address: "https://example.com/webhooks/fileActions"})
.then(webhook => {
/* webhook -> {
id: '1234',
type: 'webhook',
target: { id: '22222', type: 'folder' },
created_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
created_at: '2016-05-09T17:41:27-07:00',
address: 'https://example.com/webhooks/fileActions',
triggers: [ 'FILE.DOWNLOADED', 'FILE.UPLOADED' ] }
*/
});
client.webhooks.update(webhookId: "1234", targetType: "file", targetId: "1234", address: "www.testurl.com") { (result: Result<Webhook, BoxSDKError>) in
guard case let .success(webhook) = result else {
print("Error updating webhook")
return
}
print("Updated webhook address to \"\(webhook.address)\"")
}