0 Replies Latest reply on Feb 18, 2015 9:02 AM by audra.b

    How do you use the action links in the Jive rest/JS api?

    audra.b

      Hello,

       

      I'm using Jive 7. I'm trying to create a notification that appears in a group owners inbox when they click a link to my add-on.

      My code is below. I am unsure about how to use the target field below. I want the accept option to add a user to a group.

      Note: the code in the below state doesn't work for me. It gives a 200 success response but nothing in the user's inbox.

      Any ideas about where I'm going wrong?

       

      var actionJSON={
                  "openSocial" : {
                      "actionLinks" : [
                          { "caption" : "Accept", "httpVerb" : "POST", "target" : "http://home.example.com/yes" },
                          { "caption" : "Reject", "httpVerb" : "POST", "target" : "http://home.example.com/no" }
                      ],
                      "deliverTo" : [
                          "/people/"+placeCreator.id
                      ]
                  },
                  "title" : "Request to join",
                  "content" : "${@actor} is requesting to join ${@target}",
                  "object" : {
                      "id" : "",
                      "summary" : ""
                  },
                  "verb" : "announced"
              };
      
      
              osapi.jive.corev3.activities.create(actionJSON).execute(function(response) {
                  if (!response.error) {
      
      
                      console.log("notification sent", response);
                  }else{
                      console.log("place creator", placeCreator);
                      console.log("notification failed", response);
                  }
      
      
              });
      

       

       

      Thanks,

       

      Audra