8 Replies Latest reply on Sep 12, 2013 7:03 AM by markus@tembosocial.com

    Activities API help!

    wb9tpg

      I'm trying to test out posting to the activity stream using the new REST API and I'm having difficulty.  It appears that it posts (201 returned) but I can't see anything.

       

      The ruby program I use to post looks like this

       

        def post(payload=nil)

          result = self.class.post('/api/core/v3/activities',

            :body => {

              "openSocial" => {

                "deliverTo" => [ "https://example.jiveon.com/api/core/v3/people/2103" ]

              },

              "title" => "Get Ready for Office Remodelling",

              "content" => "${@actor} A major remodel project is slated to begin next week.",

              "object" => {

                "id" => "https://example.jiveon.com/api/core/v3/contents/1234",

                "summary" => "See the attached document for more information.",

              },

              "verb" => "announced"

            }.to_json,

            :headers => {'Content-Type' => 'application/json', 'Authorization' => @auth})

          puts result.inspect

        end

       

      I looks like it works and returns this.   It looks successful but I can't find anything at all in the activity stream.   I get a not authorized error if I try to look at the url retured ( "url"=>"https://sandbox.jiveon.com/streamentry/1050").   Any help would be appreciated.

       

      -> "HTTP/1.1 201 Created\r\n"

      -> "Server: Apache-Coyote/1.1\r\n"

      -> "X-Jive-Request-Id: dd5d9c20-58e9-11e2-a04f-0050568b8a3f\r\n"

      -> "X-Jive-Flow-Id: dd5d9c21-58e9-11e2-a04f-0050568b8a3f\r\n"

      -> "X-Frame-Options: SAMEORIGIN\r\n"

      -> "P3P: CP=\"CAO PSA OUR\"\r\n"

      -> "X-JIVE-USER-ID: 2103\r\n"

      -> "Location: https://sandbox.jiveon.com/api/core/v3/activities/\r\n"

      -> "Content-Type: application/json\r\n"

      -> "Expires: Mon, 07 Jan 2013 16:47:03 GMT\r\n"

      -> "Content-Encoding: gzip\r\n"

      -> "Cache-Control: no-store, no-cache, must-revalidate, private, max-age=0\r\n"

      -> "X-JSL: D=186831 t=1357577223856348\r\n"

      -> "Content-Length: 657\r\n"

      -> "Date: Mon, 07 Jan 2013 16:47:04 GMT\r\n"

       

      <HTTParty::Response:0x7f8187364970 parsed_response={"object"=>{"id"=>"https://example.jiveon.com/api/core/v3/contents/1234", "summary"=>"See the attached document for more information.", "published"=>"2013-01-07T16:47:03.983+0000", "updated"=>"2013-01-07T16:47:03.983+0000"}, "id"=>"https://sandbox.jiveon.com/api/core/v3/streamEntries/1050", "content"=>"<a class=\"jive-username-link jiveTT-hover-user\" data-userid=\"2103\" href=\"/people/wb9tpg\">Gary Mitchell</a> A major remodel project is slated to begin next week.", "provider"=>{"displayName"=>"Jive", "objectType"=>"jive:instance", "url"=>"https://sandbox.jiveon.com"}, "url"=>"https://sandbox.jiveon.com/streamentry/1050", "actor"=>{"id"=>"https://sandbox.jiveon.com/api/core/v3/people/2103", "displayName"=>"Gary Mitchell", "objectType"=>"jive:person", "image"=>{"url"=>"https://sandbox.jiveon.com/api/core/v3/people/2103/avatar"}, "url"=>"https://sandbox.jiveon.com/people/wb9tpg", "published"=>"2013-01-04T20:03:00.905+0000", "updated"=>"2013-01-07T16:47:03.931+0000"}, "generator"=>{"id"=>"https://sandbox.jiveon.com/api/core/v3/activities/", "content"=>"A service permitting external systems to publish activity through Jive", "displayName"=>"Inbound Activity Service", "objectType"=>"jive:inboundActivity", "url"=>"https://sandbox.jiveon.com/api/core/v3/activities/", "author"=>{"displayName"=>"Jive Software"}, "published"=>"2012-06-12T18:56:45.950+0000", "updated"=>"2012-06-12T18:56:45.950+0000"}, "title"=>"Get Ready for Office Remodelling", "published"=>"2013-01-07T16:47:03.983+0000", "verb"=>"announced", "jive"=>{}, "updated"=>"2013-01-07T16:47:03.983+0000", "openSocial"=>{}}, @response=#<Net::HTTPCreated 201 Created readbody=true>, @headers={"server"=>["Apache-Coyote/1.1"], "x-jive-request-id"=>["dd5d9c20-58e9-11e2-a04f-0050568b8a3f"], "x-jive-flow-id"=>["dd5d9c21-58e9-11e2-a04f-0050568b8a3f"], "x-frame-options"=>["SAMEORIGIN"], "p3p"=>["CP=\"CAO PSA OUR\""], "x-jive-user-id"=>["2103"], "location"=>["https://sandbox.jiveon.com/api/core/v3/activities/"], "content-type"=>["application/json"], "expires"=>["Mon, 07 Jan 2013 16:47:03 GMT"], "cache-control"=>["no-store, no-cache, must-revalidate, private, max-age=0"], "x-jsl"=>["D=186831 t=1357577223856348"], "content-length"=>["657"], "date"=>["Mon, 07 Jan 2013 16:47:04 GMT"], "connection"=>["close"], "set-cookie"=>["jive.user.loggedIn=true; Path=/;HttpOnly", "jive.server.info=\"serverName=sandbox.jiveon.com:serverPort=443:contextPath=:localName=gmv10.vmhosted.jiveland.com:localPort=9200:localAddr=127.0.0.1\"; Version=1; Path=/;HttpOnly", "jive.user.loggedIn=true; Path=/;HttpOnly", "jive.server.info=\"serverName=sandbox.jiveon.com:serverPort=443:contextPath=:localName=gmv10.vmhosted.jiveland.com:localPort=9200:localAddr=127.0.0.1\"; Version=1; Path=/;HttpOnly", "BIGipServerpool_sandbox.jiveon.com=2428609290.20480.0000; path=/"]}>