3 Replies Latest reply on May 6, 2015 5:39 AM by Ryan Rutan

    ExternalStreamActivity - Webhook callbacks?

    butch

      I'm attempting to get activity on my Stream Integration to work with webhooks with little success. 

       

      I am able to register callbacks that work with Place activity - but I believe the correct thing to do would be to register a Webhook on the Stream?  If this is not the case... disregard everything below!


      I think part of my problem is Jive REST Rest API v3.10 → Webhooks service is not clear on what are considered "events" - the information may be there, but I just can't seem to find it.

       

      I'm able to create a Stream integration.

      Screenshot from 2015-05-05 14:18:41.png

       

      Which registers with my backend service.

      Screenshot from 2015-05-05 14:19:36.png

       

      And I am able to use the API to post an entry via extstream 1137.

       

      Screenshot from 2015-05-05 15:00:19.png

       

      Creating a Webhook directly on place 1047 works and triggers the Webhook.

       

      curl --insecure -i \
      -X POST \
      -H 'Authorization: Bearer 1deaisp7z347r9m4xt8mt7acq7ibzkxm1u4paxyk.t' \
      -H 'Content-Type: application/json' \
      'https://jive-butch.polldev.com:8443/api/core/v3/webhooks' \
      -d '{ "object" : "https://jive-butch.polldev.com:8443/api/core/v3/places/1047", "callback": "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json" }'
      
      HTTP/1.1 201 Created
      Date: Tue, 05 May 2015 19:04:30 GMT
      Server: Apache
      X-Jive-Request-Id: 8ef83e70-f359-11e4-a4b5-525400124660
      X-Jive-Flow-Id: 8ef83e71-f359-11e4-a4b5-525400124660
      X-Frame-Options: SAMEORIGIN
      P3P: CP="CAO PSA OUR"
      Expires: 0
      Pragma: no-cache
      Location: https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1021
      Content-Type: application/json
      Set-Cookie: jive.login.ts=1430852670423; Path=/; HttpOnly
      Vary: Accept-Encoding,User-Agent
      Cache-Control: no-store
      X-JSL: D=13457 t=1430852670422363
      Transfer-Encoding: chunked
      
      {
        "id" : "1021",
        "resources" : {
          "self" : {
            "allowed" : [ "DELETE", "PUT", "GET" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1021"
          }
        },
        "object" : "https://jive-butch.polldev.com:8443/api/core/v3/places/1047",
        "events" : "",
        "callback" : "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json"
      

       

      This gives me the webhook https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1021

       

      Adding a reply hits the Webhook successfully at the endpoint https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json

       

      Screenshot from 2015-05-05 15:06:24.png

       

      The Webhook is successfully triggered on my end.

      I get all the headers + the JSON body.

      Webhooks callback: 
      HEADER X-Tenant-ID: 76406c34-5df8-432f-a869-59192cacdafd-dev
      HEADER Authorization: JiveEXTN algorithm=HmacSHA256&client_id=prq9iaiy15qrtrbnm1b67x23wr72prfk.i&jive_url=https%3A%2F%2Fjive-butch.polldev.com%3A8443&tenant_id=76406c34-5df8-432f-a869-59192cacdafd-dev&timestamp=1430852799260&signature=3F7Gj7n1RqCL9AipVdzYemZejPNW4Xa%2FJijgtkdWCGo%3D
      HEADER User-Agent: Jive SBS v8.0.0.0
      HEADER Host: butch3-dev.polldev.com
      HEADER Content-Length: 5118
      HEADER Content-Type: application/json; charset=UTF-8
      HEADER X-Forwarded-Proto: https
      HEADER X-SSL-cipher: ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
      HEADER X-Forwarded-For: 192.168.0.23
      Array
      (
          [0] => Array
              (
                  [webhook] => https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1021
                  [activity] => Array
                      (
                          [actor] => Array
                              (
                                  [image] => Array
                                      (
                                          [url] => https://jive-butch.polldev.com:8443/api/core/v3/people/2019/avatar?a=-1
                                      )
      
                                  [displayName] => Sylvester Depavia
                                  [id] => https://jive-butch.polldev.com:8443/api/core/v3/people/2019
                                  [published] => 2015-04-27T13:10:16.743+0000
                                  [updated] => 2015-05-05T18:46:58.533+0000
                                  [url] => https://jive-butch.polldev.com:8443/people/sylvester%40rna.com
                                  [objectType] => jive:person
                                  [jive] => Array
                                      (
                                          [externalContributor] => 
                                          [username] => sylvester@rna.com
                                      )
      
                              )
      
                          [provider] => Array
                              (
                                  [displayName] => Jive
                                  [url] => https://jive-butch.polldev.com:8443
                                  [objectType] => jive:instance
                              )
      
                          [verb] => jive:commented
                          [published] => 2015-05-05T19:06:31.020+0000
                          [title] => New Activity Title
                          [type] => activity
                          [updated] => 2015-05-05T19:06:31.020+0000
                          [content] => Sylvester Depavia commented on New Activity Title in Operations                    [url] => https://jive-butch.polldev.com:8443/external/1013#comments-1047
                          [jive] => Array
                              (
                                  [parent] => Array
                                      (
                                          [summary] => The informative description to my new activity
                                          [displayName] => New Activity Title
                                          [canLike] => 
                                          [id] => https://jive-butch.polldev.com:8443/api/core/v3/contents/1059
                                          [published] => 2015-05-05T18:05:00.779+0000
                                          [canComment] => 1
                                          [updated] => 2015-05-05T18:05:00.779+0000
                                          [url] => https://jive-butch.polldev.com:8443/external/1013
                                          [objectType] => jive:extStreamActivity
                                      )
      
                                  [parentReplyCount] => 1
                                  [canLike] => 1
                                  [iconCss] => jive-icon-med jive-icon-tile-activity-comment external-object-1068
                                  [onBehalfOf] => Array
                                      (
                                          [name] => John Doe
                                          [email] => john.doe@jivesoftware.com
                                      )
      
                                  [collection] => 105-1047
                                  [productName] => TemboSocial Recognition Stream
                                  [objectType] => 105
                                  [replyCount] => 0
                                  [discovery] => Array
                                      (
                                      )
      
                                  [objectViewed] => 
                                  [productIcon] => https://jive-butch.polldev.com:8443/api/core/v3/images/7465?a=1430400372634
                                  [canComment] => 1
                                  [collectionUpdated] => 2015-05-05T19:06:31.020+0000
                                  [objectID] => 1047
                                  [parentActor] => Array
                                      (
                                          [image] => Array
                                              (
                                                  [url] => https://jive-butch.polldev.com:8443/api/core/v3/people/-9223372036854775808/avatar?a=-1
                                              )
      
                                          [displayName] => SYSTEM
                                          [id] => https://jive-butch.polldev.com:8443/api/core/v3/people/-9223372036854775808
                                          [url] => https://jive-butch.polldev.com:8443/people/SYSTEM
                                          [objectType] => jive:person
                                          [jive] => Array
                                              (
                                                  [externalContributor] => 
                                                  [username] => SYSTEM
                                              )
      
                                      )
      
                              )
      
                          [object] => Array
                              (
                                  [summary] => Test #1
                                  [helpfulCount] => 0
                                  [author] => Array
                                      (
                                          [image] => Array
                                              (
                                                  [url] => https://jive-butch.polldev.com:8443/api/core/v3/people/2019/avatar?a=-1
                                              )
      
                                          [displayName] => Sylvester Depavia
                                          [id] => https://jive-butch.polldev.com:8443/api/core/v3/people/2019
                                          [published] => 2015-04-27T13:10:16.743+0000
                                          [updated] => 2015-05-05T18:46:58.533+0000
                                          [url] => https://jive-butch.polldev.com:8443/people/sylvester%40rna.com
                                          [objectType] => jive:person
                                          [jive] => Array
                                              (
                                                  [externalContributor] => 
                                                  [username] => sylvester@rna.com
                                              )
      
                                      )
      
                                  [displayName] => New Activity Title
                                  [id] => https://jive-butch.polldev.com:8443/api/core/v3/comments/1047
                                  [published] => 2015-05-05T19:06:30.995+0000
                                  [updated] => 2015-05-05T19:06:30.995+0000
                                  [url] => https://jive-butch.polldev.com:8443/external/1013#comments-1047
                                  [objectType] => jive:comment
                              )
      
                          [target] => Array
                              (
                                  [summary] => Where the developers go
                                  [image] => Array
                                      (
                                          [url] => https://jive-butch.polldev.com:8443/api/core/v3/places/1047/avatar
                                      )
      
                                  [displayName] => Operations
                                  [id] => https://jive-butch.polldev.com:8443/api/core/v3/places/1047
                                  [published] => 2015-04-28T12:10:30.886+0000
                                  [updated] => 2015-05-05T19:06:31.001+0000
                                  [url] => https://jive-butch.polldev.com:8443/community/operations
                                  [objectType] => jive:space
                              )
      
                      )
      
              )
      
      )
      
      

       

      However, when I register a webhook directly on the extstream I never get any events.

       

      No "events":

      curl --insecure -i \
      -X POST \
      -H 'Authorization: Bearer 1deaisp7z347r9m4xt8mt7acq7ibzkxm1u4paxyk.t' \
      -H 'Content-Type: application/json' 'https://jive-butch.polldev.com:8443/api/core/v3/webhooks' \
      -d '{ "object" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1137", "callback": "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json" }'
      
      HTTP/1.1 201 Created
      Date: Tue, 05 May 2015 19:10:19 GMT
      Server: Apache
      X-Jive-Request-Id: 5ed60cd0-f35a-11e4-a4b5-525400124660
      X-Jive-Flow-Id: 5ed60cd1-f35a-11e4-a4b5-525400124660
      X-Frame-Options: SAMEORIGIN
      P3P: CP="CAO PSA OUR"
      Expires: 0
      Pragma: no-cache
      Location: https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1022
      Content-Type: application/json
      Set-Cookie: jive.login.ts=1430853019165; Path=/; HttpOnly
      Vary: Accept-Encoding,User-Agent
      Cache-Control: no-store
      X-JSL: D=23245 t=1430853019164504
      Transfer-Encoding: chunked
      
      {
        "id" : "1022",
        "resources" : {
          "self" : {
            "allowed" : [ "DELETE", "PUT", "GET" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1022"
          }
        },
        "object" : "https://jive-butch.polldev.com:8443/api/core/v3/extstreams/1137",
        "events" : "",
        "callback" : "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json"
      
      

       

      "discussion" event

       

      curl --insecure -i \
      -X POST \
      -H 'Authorization: Bearer 1deaisp7z347r9m4xt8mt7acq7ibzkxm1u4paxyk.t' \
      -H 'Content-Type: application/json' 'https://jive-utch.polldev.com:8443/api/core/v3/webhooks' \
      -d '{ "object" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1137", "callback": "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json", "events": "discussion" }'
      
      HTTP/1.1 201 Created
      Date: Tue, 05 May 2015 19:15:43 GMT
      Server: Apache
      X-Jive-Request-Id: 2035ae80-f35b-11e4-a4b5-525400124660
      X-Jive-Flow-Id: 2035ae81-f35b-11e4-a4b5-525400124660
      X-Frame-Options: SAMEORIGIN
      P3P: CP="CAO PSA OUR"
      Expires: 0
      Pragma: no-cache
      Location: https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1023
      Content-Type: application/json
      Set-Cookie: jive.login.ts=1430853343592; Path=/; HttpOnly
      Vary: Accept-Encoding,User-Agent
      Cache-Control: no-store
      X-JSL: D=19709 t=1430853343591746
      Transfer-Encoding: chunked
      
      {
        "id" : "1023",
        "resources" : {
          "self" : {
            "allowed" : [ "DELETE", "PUT", "GET" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1023"
          }
        },
        "object" : "https://jive-butch.polldev.com:8443/api/core/v3/extstreams/1137",
        "events" : "discussion",
        "callback" : "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json"
      }
      

       

      "message" event:

      curl --insecure -i \
      -X POST \
      -H 'Authorization: Bearer 1deaisp7z347r9m4xt8mt7acq7ibzkxm1u4paxyk.t' \
      -H 'Content-Type: application/json' 'https://jive-utch.polldev.com:8443/api/core/v3/webhooks' \
      -d '{ "object" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1137", "callback": "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json", "events": "message" }'
      
      HTTP/1.1 201 Created
      Date: Tue, 05 May 2015 19:15:47 GMT
      Server: Apache
      X-Jive-Request-Id: 226c1680-f35b-11e4-a4b5-525400124660
      X-Jive-Flow-Id: 226c1681-f35b-11e4-a4b5-525400124660
      X-Frame-Options: SAMEORIGIN
      P3P: CP="CAO PSA OUR"
      Expires: 0
      Pragma: no-cache
      Location: https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1024
      Content-Type: application/json
      Set-Cookie: jive.login.ts=1430853347304; Path=/; HttpOnly
      Vary: Accept-Encoding,User-Agent
      Cache-Control: no-store
      X-JSL: D=34092 t=1430853347303455
      Transfer-Encoding: chunked
      
      {
        "id" : "1024",
        "resources" : {
          "self" : {
            "allowed" : [ "DELETE", "PUT", "GET" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/webhooks/1024"
          }
        },
        "object" : "https://jive-butch.polldev.com:8443/api/core/v3/extstreams/1137",
        "events" : "message",
        "callback" : "https://butch3-dev.polldev.com/api/v1/jive/webhooks/callback.json"
      }
      

       

       

       

      I also tried tilestreamentry, but it does not seem to exist as an event.

       

      Obligatory Ryan Rutan ping.

       

      Thanks for any info you can provide!