2 Replies Latest reply on Sep 28, 2014 7:42 PM by whoiskevin

    Create Static Content

    chrisbrown Beginner

      I want to upload a file to the statics folder of our Jive instance through REST. Is this possible? Is this following the right method?


      From here: Jive REST Rest API v3.8 → Static service


      It says one can create static content as follows:

      Create Static

      POST /statics

      Create a Static associated with the place identified by the placeURI field. The minimum amount of information required is:

       { "filename" : "{filename of the static resource}", "placeURI" : "{URI of the place this static resource should be associated with}" } 


      What is the syntax of the filename? I'm trying to reference a file on the file system of the machine I'm making the call from.

        • Re: Create Static Content
          it2000 Advanced

          I didn't test it but I assume that the the filename dles not have to match your local filename - 'foo.png' should be fine.

          You will likely need to post the content of your local file in a multipart request:

          'A multipart of subtype form-data that will include a section with a JSON object describing the static resource to be created, and another section containing the content of the static resource.'

          This can be tricky as Jive has it's own idea how multipart request must be formed to be accepted. See also Rest Api Examples.

          • Re: Create Static Content
            whoiskevin Expert

            You might want to start with the createStaticData which takes a file data resource (form-data).  The method is for createStatic is expecting the supplied filename to already exist so that it can reference it which means you have to create the static resource first.