3 Replies Latest reply on Aug 4, 2014 4:28 AM by pawans

    Does JIVE API support adding followers to a project using userid... ?

    abhram

      Does JIVE API V3 support the following?


      POST api/core/v3/projects/{id}/followers Start following the specified container.


      Or is there any way to add followers to a project through REST API?


        • Re: Does JIVE API support adding followers to a project using userid... ?
          pawans

          As per what I know, since jive 6 apis there is no direct link between a user and a project/group he is following.

          The connection is through a stream.

          From API, you have to first get a user's stream and then associate the project with this stream.

          Only after this the api/core/v3/projects/{id}/followers starts showing this user as a follower.

           

          The post url will be then api/core/v3/streams/{streamID}/associations

          and the param will be uri of the project.

          1 person found this helpful
            • Re: Does JIVE API support adding followers to a project using userid... ?
              abhram

              Thanks for the reply. I will try this and will get back to you.

                • Re: Does JIVE API support adding followers to a project using userid... ?
                  pawans

                  Just for everyone who is new to apis, Here are the exact series of api calls I have in my code to achieve this.

                  At a given time I have the group id (project id in your case as project is a type of place) and username.

                   

                  Get the user data by calling this api "api/core/v3/people/username/{username}"

                  The response you get will have a streams url, something like this "https://{jive_url}/api/core/v3/people/{userid}/streams"

                  This url will give you list if streams.

                  Now in our system we have "Email Watches" stream for every user.

                  So I fetch the stream with name "Email Watches" from this list.

                  Then I will get the association link particular to this stream which looks like this "https://{jive_url}/api/core/v3/streams/{stream_id}/associations"

                   

                  Now I have this group id which i will use to create a group uri like this "https://{jive_url}/api/core/v3/places/{groupID}"

                   

                  Now I wil post with url as the association url --> "https://{jive_url}/api/core/v3/streams/{stream_id}/associations"

                  and params as array of stuff to follow, in my case just one group --> ["https://{jive_url}/api/core/v3/places/{groupID}"]

                  you can add group, project, a user or a content's uri in this array to follow.

                   

                  Thats it