Update webhook

put
https://api.box.com/2.0
/webhooks/:webhook_id/

Updates a webhook.

Request

Bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
3321123

The ID of the webhook.

Request Body

stringin bodyoptional
https://example.com/webhooks

The URL that is notified by this webhook

objectin body

The item that will trigger the webhook

stringin bodyoptional
1231232

The ID of the item to trigger a webhook

stringin bodyoptional
file

The type of item to trigger a webhook

Value is one of file,folder

string arrayin bodyoptional
["FILE.UPLOADED"]

An array of event names that this webhook is to be triggered for

Response

application/jsonWebhook

Returns the new webhook object.

application/jsonClient error

Returns an error if the parameters were incorrect.

application/jsonClient error

Returns an error if the application does not have the permission to manage webhooks.

application/jsonClient error

Returns an error if the target item or webhook could not be found

application/jsonClient error

Returns an error if the a webhook for this combination of target, application, and user already exists.

application/jsonClient error

An unexpected client error.

put
Update webhook
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X PUT "https://api.box.com/2.0/webhooks/3321123" \
     -H "Authorization: Bearer <ACCESS_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "triggers": [
         "FILE.DOWNLOADED"
       ]
     }'
Java
BoxWebHook webhook = new BoxWebHook(api, id);
BoxWebHook.Info info = webhook.new Info();
info.setAddress(url);
webhook.update(info);
Python
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))
iOS
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)\"")
}

Response Example

{
  "type": "error",
  "code": "item_name_invalid",
  "help_url": "http://developers.box.com/docs/#errors",
  "message": "Method Not Allowed",
  "request_id": "abcdef123456",
  "status": 400
}