Create documents automatically in Jive 6 with API v3.3

Version 2
    Share This:

    Since our upgrade from Jive SBS 4.5 to SBS 6, their REST API has completely changed from XML (v.1) to JSON (v.3).  Even the capabilities of the API has changed, adding and removing many features.  In any case, I have updated my Java code which maintains the TAP partner and The specified item was not found.directories.

     

    You don't have to use Java, you can use anything that can send JSON REST calls, including the curl command line tool.  I also recommend the RESTClient addon for Firefox that will let you tweak your calls easily:

    RESTClient.JPG.jpg

     

    The Java code is attached.  You will need to supply your own Communities login.  Also, you will need to remove all the ART (Remedy AR System) code and supply your own code for getting and building the document subject/body.  The key method in the code is push2Jive:

    private HashMap<String, String> push2Jive(String body, String title, String description,String internalDocID, long kbCat)

     

    The description field isn't used.  The internalDocID is not the "DOC-1234" external document ID.  For newer docs, is the the numeric portion, 1234, but for older documents, they don't always match.  To create a new doc, just put in "" for the docID.

     

    The kbCat value is the object ID of the space where you want to create the document.  It is not the same as the communityID (2926) available in the admin tool, but can be found with this call:

    https://communities.bmc.com/api/core/v3/places?filter=entityDescriptor(14,2926)

    You can see the objectID (118406) in the "self" value:

    "self" : {

      "ref" : "https://communities.bmc.com/api/core/v3/places/118406",

     

    You need lots of libraries to make all this work, attached, but you can remove the Remedy stuff if you are using other sources:

    JiveLibraries.JPG.jpg