5 Replies Latest reply on Jul 4, 2016 2:21 PM by jr.cardenas

    REST API call to export the contents of a list of Documents

    david.barrish Novice

      I am trying to figure out the REST API call to do a flat file export of the content of a couple hundred Documents.   These Documents are all in a single Container but they are owned by a several different Authors within that container.

        • Re: REST API call to export the contents of a list of Documents
          Ryan Rutan Guru

          Your best bet is to start with the REST API:

          • Jive REST API v3.14 → Place service
            • You'll need to get the Place ID for the place you want to filter on.  If you dont know already, you can find it out.
            • The easiest way is to use the /api/core/v3/places?filter=entityDescriptor(placeType,placeID)&fields=resources.self
              • placeType = 600 = Project, 700 = Groups, and 14=Space
              • placeID = Get this easily, by going to place home page, click on the Actions Menu and hover/copy the Feeds URL.  You will see a community=XXXX value.  Use this value for Place ID
              • Run the API query, and use the URI located in resources/self/ref API Place URI (/api/core/v3/places/YYYYY) moving forward.
          • Next you need to do the same for all authors, see: Jive REST API v3.14 → Person service
            • /api/core/v3/people/username/bob.smith?fields=resources.self
            • Same as above, record the value of the resources > self > ref for each user
          • Now it's time to frame your API Query:
            • /api/core/v3/contents?filter=place(/api/core/v3/places/YYYYY)&filter=author(/api/core/v3/people/ZZZZZ1,/api/core/v3/people/ZZZZZ2)&fields=-resources,-author.resources&count=50
              • Note: the -resources and -author.resources are added to reduce the payload size of the request.
              • Note:  You can add more fields like: subject,content.text and more to target exactly the data you want to pull out.
              • Note:  I set your record count to 50 (pages of 50), but you can go up to a max of 100.
          • At this point, all you need to do is iterate of the ["list"] object ... check the "next" link to get the next batch.


          Hope this helps =)

          4 people found this helpful