Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Webhooks API v2 limitations is there a way around them

New post

Comments

8 comments

  • Murtza

     You can setup a webhook on any Box folder to track events in that folder and its child folders. The only exception to this is it is not possible to setup a webhook on a user's root folder.

     

     

    0
    Comment actions Permalink
  • Dave-M

    Thanks for the reply, I want to confirm my understanding of your reply.

     

    If I understand you correct you are suggesting that the V2 Box API allows you to set a webhook on a folder and receive notifications for changes to any children of that folder. 

    That implies if I put a webhook on each folder within the root folder I would receive notifications for any changes to any files or folders below them, is that correct?

     

    There is a massive hole in this rather neat logic, if you are not allowed to put a webhook on the root folder how to you get notifications of any additions to the root folder contents, either new folders or files?

     

    The documentation implies that you need to set a webhook on EVERY file and folder, it seems from what you replied above this is not true, so the documentation is very unclear and  confusing, suggest it urgently needs an update.

     

    Cheers

    Dave

     

     

    0
    Comment actions Permalink
  • JoeWarwick

    I would also like a clarification on this!

     

    Yes the hole in the implementation is really strange.

    Also need to confirm if a webhook on a folder gets events for all items changed within that folder AND its subfolders.

     

    Thanks.

    0
    Comment actions Permalink
  • dylandechant

    I too would like clarification on this...

    0
    Comment actions Permalink
  • Murtza

       I have added clarifications in-line below. Please let me know if you have follow-up questions?

     

    "If I understand you correct you are suggesting that the V2 Box API allows you to set a webhook on a folder and receive notifications for changes to any children of that folder."

    - That is correct. The only exception is setting up a webhook on the root folder. You can set up a webhook on any folder, and monitor that folder and its child folders. 

     

    "That implies if I put a webhook on each folder within the root folder I would receive notifications for any changes to any files or folders below them, is that correct?"

    - That is correct. As you described, the workaround to not being able to set up a webhook on the root folder is to set up webhooks on the folders within the root folder. To further address this limitation, you can also set up webhooks on the files within the root folder.

     

    "Also need to confirm if a webhook on a folder gets events for all items changed within that folder AND its subfolders."

    - That is correct. 

    0
    Comment actions Permalink
  • dylandechant

    Thanks Murtza,

     

    Another question on webhooks, it seems you can only have one webhook per folder, how does box advise working with these in different environments when developing? (dev, staging production)

    0
    Comment actions Permalink
  • Murtza

    I updated our Webhooks V2 docs page based on everybody's feedback in this thread. Thanks for sharing these comments!

     

     There are two options. The first approach is to create different Box applications for each of your environments. The second approach is to setup a gateway on your server where you listen for Box webhooks and then route them to the correct environment.

    0
    Comment actions Permalink
  • siharpsdk

    Thanks for the clarification 

     

    Please can you advise if there is a way to view all webhooks created rather than individually?

     

    Ideally i would make a GET request to https://api.box.com/2.0/webhooks using my developer oauth bearer token for a complete list of all webhooks created under v2 on the account.

    0
    Comment actions Permalink

Please sign in to leave a comment.