16 Replies Latest reply on May 8, 2015 9:21 AM by butch

    Creating comment on extStream activity?

    butch

      Hey Ryan, Markus and I have been tinkering with the Jive REST Rest API v3.10 → ExternalStreamActivity entity and Jive REST Rest API v3.10 → Comment service

      in attempt to reply to an extstreams entry with no luck so far.


      I have an activity I want to comment on - but can't seem to figure out the correct payload to send.

       

      This is the activity: https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179/activities/1020

      throw 'allowIllegalResourceCall is false.';
      {
        "id" : "1020",
        "resources" : {
          "comments" : {
            "allowed" : [ "GET", "POST" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179/activities/1020/comments"
          },
          "attachments" : {
            "allowed" : [ "GET", "POST" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179/activities/1020/attachments"
          },
          "self" : {
            "allowed" : [ "DELETE", "PUT", "GET" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179/activities/1020"
          },
          "extprops" : {
            "allowed" : [ "DELETE", "GET", "POST" ],
            "ref" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179/activities/1020/extprops"
          }
        },
        "published" : "2015-05-07T20:10:38.161+0000",
        "tags" : [ ],
        "updated" : "2015-05-07T20:10:38.161+0000",
        "author" : {
          "id" : "1",
          "resources" : {
            "reports" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@reports"
            },
            "followingIn" : {
              "allowed" : [ "GET", "POST" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/followingIn"
            },
            "images" : {
              "allowed" : [ "GET", "POST" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/images"
            },
            "activity" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/activities"
            },
            "manager" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@manager"
            },
            "social" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@social"
            },
            "streams" : {
              "allowed" : [ "GET", "POST" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/streams"
            },
            "recognition" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@recognition"
            },
            "trendingContent" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@trendingContent"
            },
            "trendingPlaces" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@trendingPlaces"
            },
            "avatar" : {
              "allowed" : [ "PUT", "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/avatar?a=1171"
            },
            "followers" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@followers"
            },
            "pages" : {
              "allowed" : [ "GET", "POST" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/pages"
            },
            "colleagues" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@colleagues"
            },
            "following" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/@following"
            },
            "members" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/members/people/1"
            },
            "self" : {
              "allowed" : [ "DELETE", "PUT", "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1"
            },
            "html" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/people/admin"
            },
            "securityGroups" : {
              "allowed" : [ "GET" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/securityGroups"
            },
            "extprops" : {
              "allowed" : [ "DELETE", "GET", "POST" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/extprops"
            },
            "tasks" : {
              "allowed" : [ "GET", "POST" ],
              "ref" : "https://jive-butch.polldev.com:8443/api/core/v3/people/1/tasks"
            }
          },
          "displayName" : "TemboSocial Recognition Stream",
          "emails" : [ {
            "jive_label" : "Email",
            "primary" : true,
            "type" : "work",
            "value" : "butch@tembosocial.com",
            "jive_displayOrder" : 3,
            "jive_summaryDisplayOrder" : 2,
            "jive_showSummaryLabel" : true
          } ],
          "jive" : {
            "level" : {
              "imageURI" : "https://jive-butch.polldev.com:8443/api/core/v3/images/status/statusicon-48.gif",
              "name" : "Wayfarer",
              "points" : 87
            },
            "externalContributor" : false,
            "username" : "admin"
          },
          "name" : {
            "formatted" : "Administrator"
          },
          "type" : "person"
        },
        "content" : {
          "text" : "
      ",
          "editable" : false,
          "type" : "text/html"
        },
        "parent" : "https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179",
        "status" : "published",
        "subject" : "Happy birthday sly!",
        "viewCount" : 1,
        "action" : {
          "name" : "posted",
          "description" : "Recognition"
        },
        "actor" : {
          "name" : "Administrator",
          "email" : "butch@tembosocial.com"
        },
        "object" : {
          "image" : "http://i1.wp.com/bitcast-a-sm.bitgravity.com/slashfilm/wp/wp-content/images/ZZ182886EA-550x308.jpg?resize=550%2C308",
          "type" : "website",
          "url" : "http://www.google.com"
        },
        "properties" : {
          "creatorID" : "1",
          "tileInstanceDidUserMatch" : "true",
          "__onbehalfofmeta" : "{\"name\":\"Administrator\",\"email\":\"butch@tembosocial.com\"}",
          "onBehalfOfUserID" : "1",
          "onBehalfOfUserName" : "Administrator"
        },
        "externalStreamID" : 1179,
        "attachments" : [ ],
        "type" : "extStreamActivity"
      }
      

       

       

      A post to https://jive-butch.polldev.com:8443/api/jivelinks/v1/extstreams/1179/activities/1020/comments

       

      Attempt #1

       

      {"type":"comment","content":{"type":"text\/html","text":"
      

      test"},"actor":{"name":"Administrator","email":"butch@tembosocial.com"}}

       

          [body] => {
        "error" : {
          "message" : "Missing required field 'author'",
          "status" : 400
        }
      }
          [totaltime] => 0.080145
          [contenttype] => application/json
          [requestsize] => 421
          [json_body] => Array
              (
                  [error] => Array
                      (
                          [message] => Missing required field 'author'
                          [status] => 400
                      )
      
              )
      
      )

       

      Attempt #2

      {"type":"comment","content":{"type":"text\/html","text":"
      

      test"},"author":{"name":"Administrator","email":"butch@tembosocial.com"}}

       

          [body] => {
        "error" : {
          "message" : "Missing required field 'externalID'",
          "status" : 400
        }
      }
          [totaltime] => 0.030092
          [contenttype] => application/json
          [requestsize] => 422
          [json_body] => Array
              (
                  [error] => Array
                      (
                          [message] => Missing required field 'externalID'
                          [status] => 400
                      )
      
              )
      
      )

       

      Attempt #3

      {"type":"comment","content":{"type":"text\/html","text":"
      

      test"},"externalID":1,"author":{"name":"Administrator","email":"butch@tembosocial.com"}}

      [body] => {
        "error" : {
          "message" : "An author name and email are required to comment as a guest",
          "status" : 400
        }
      }
          [totaltime] => 0.038362
          [contenttype] => application/json
          [requestsize] => 493
          [json_body] => Array
              (
                  [error] => Array
                      (
                          [message] => An author name and email are required to comment as a guest
                          [status] => 400
                      )
      
              )
      
      )
      
      

       

       

      Any ideas?