11 Replies Latest reply on Apr 23, 2015 1:12 PM by butch

    Webhooks - any issue with creating 100,000's of them?

    butch

      I'm hoping I can get a little feedback on best practises when using the Jive API.  We're making architectural decisions right now on how best to sync our system with the activities it creates in Jive.

       

      Basically, when things happen in our system, we create Activity entries within Jive.

       

      The plan is that for every Jive activity we create we issue a Webhook request for that activity.  By doing this we will be able to keep our product in sync (such as likes/updates/deletions) with any activity that happen within Jive so that our GUI is in sync.

       

      Side: We are planning on using the credentials that the Jive App registered with us on the initial installation - could this have any problems?

       

      Given how our product has worked in the past - this could build to 500,000+ Webhooks over a few years of the product being installed.

       

      Alternatively - we could use a System Webhook on the "stream".  But I believe this would mean our system would be notified about all activity in Jive, right?  I am afraid this may be considered a security concern for some clients?

       

      Thanks for any feedback!  Ryan, what do you think of this plan?

        • Re: Webhooks - any issue with creating 100,000's of them?
          Ryan Rutan

          When you add a stream activity entry, you are binding that stream to a place.  IMO, it makes more sense to create a single webhook for the place and ignore all the extra webhook entries.

           

          You can obtain a token and create the webhook during the Tile configuration page if you’d like … this way you have a token that is scoped to that place; however, if you’d like to use a single token that you capture during add-on configuration … that would work as well.

           

          In the end, you definitely don’t want to create a webhook per individual piece of content.

           

          Note, depending on what you need to get from the system, you may consider using the Data Export Service to scan for events periodically and take action …

          https://community.jivesoftware.com/docs/DOC-99916

           

          Both are acceptable patterns, it just depends on how you want to structure it.

           

          Let me know if that doesn’t help.

            • Re: Webhooks - any issue with creating 100,000's of them?
              butch

              Hi Ryan,

               

              My concern with this approach is security when a client configures their instance to post updates to the top-level "Jive" place rather than a "recognition" place.

               

              Would this would mean we receive any event, regardless as to its content?

               

              I guess a follow up question would be is it possible to subscribe a Webhook to a subset of Activity events based on ActivityObject objectType?

                • Re: Webhooks - any issue with creating 100,000's of them?
                  Ryan Rutan

                  There isn’t a way to subscribe just to activity, but you can subscribe to the entire place.

                   

                  For example,  Place ABC and Place DEF in Jive.  With Place ABC you add the Activity Tile from TemboSocial for Activity in Recognition Place 123.  You do the same for Place DEF, except you use Place 456.  During the configuration of each Activity Tile, you have an Oauth Grant button that creates a token from the person configuring the Tile for that specific Place.  When you save the tile you have the following details:

                   

                     

                  •   -Tiles URL, accessToken w/refresh for the tile and config parent (place)

                     

                  •   -You will also have stored the Oauth access/refresh tokens for the general purpose API.

                   

                  At this point, you call and register a WebHook for Place ABC/DEF respectively using the appropriate access/token you captured in the configuration process.

                   

                  This should create the place level activity from the Jive place.  If you’d like to have all the web hooks come back to the same URL, that is fine, or you can give each webhook you create a predictable  URL, such as /webhooks/inbound/jive/content/place/abc)

                   

                  Conversely, if you’d like to use 1 set of credentials to create/manage these web hooks … you can also do that…but the pattern remains the same.

                   

                  Does that help at all?