6 Replies Latest reply on Dec 18, 2012 12:40 PM by agentalpha

    Activity API

    wb9tpg

      I've been reading the new V3 REST API Documentation and it looks like the new API now allows creating Activity Stream entries through the API (Jive REST API v3.0).   Previously we had to go through the Application Gateway API / Home Server approach which was very painful for me.

       

      Can someone from Jive confirm if I'm reading this correctly.   Does this function in the new API replace the old approach or is any functionality missing?

       

      I hope it's true as it'll greatly simplify inserting activities into Jive and I can't wait to get upgraded to 6

        • Re: Activity API

          You are reading this correctly! It does not replace the Gateway API -- They are different approaches. Specifically, when you use the gateway API, the user, on behalf of which the application is posting, must have the app installed. When you use the REST api, you authenticate with basic auth so the API is invoked directly.

            • Re: Activity API
              wb9tpg

              Excellent!   We've been talking about what external events we wanted to post into the activity stream and the ability to call the REST API directly will make life much simpler for me.  Opportunities are already published from Siebel into our integration layer and adding the REST API as another subscriber is a simple task.

                • Re: Activity API

                  Sweeet! Would love to see a demo of it once you get it working. I'm very interested in understanding your use case a bit more. Also, did you happen to see my blog post where I talk about using What Matters for workflow?? What Matters? Workflow! -- Use Jive's activity stream to surface multi-system workflow!

                    • Re: Activity API
                      agentalpha

                      This sounded like a cool idea as I didn't realize you could do this in the REST API now. I wanted to try it real quick within my Firebug console on a Jive 6 instance so I did:

                       

                      $j.ajax

                        ({

                        type: "POST",

                        //the url where you want to sent the userName and password to

                        url: '/api/core/v3/activities',

                        dataType: 'json',

                        async: false,

                        //json object to sent to the authentication url

                        data: '{"title": "Simple activity title","content": "See this activity!"}',

                        success: function () {

                       

                        console.log("Thanks!");

                        }

                        });

                       

                      but I get an error 400 and the returned JSON is:

                      {"error":{"message":"A JSONObject text must begin with '{' at character 0 of ","status":400}}

                       

                      ....I'm sending valid JSON in the data field so I'm not sure what I'm missing

                       

                      Thanks.

                       

                      -Gary

                        • Re: Activity API

                          You seem to be missing the contentType option. Without it, jQuery will not send the POST body. Try this:

                          $j.ajax

                            ({

                              type: "POST",

                              // the url where you want to sent the userName and password to

                              url: '/api/core/v3/activities',

                              dataType: 'json',

                              contentType: 'application/json',

                              // json object to sent to the authentication url

                              data: '{"title": "Simple activity title","content": "See this activity!"}',

                              success: function () {

                                console.log("Thanks!");

                              }

                            });

                          1 person found this helpful