12 Replies Latest reply on Apr 13, 2018 6:25 AM by satyam@spglobal.com

    How to upload a image from a Custom View Tile?

    Robert Hanson

      My goal is to create a Jive status update with an image attachment from a Custom View Tile.

      The problem is that I can't find a way to upload image file to Jive?

       

      Here is my code for creating the update, which references an image URL.  Normally this URL would point to a temporary image that was uploaded to Jive.

      osapi.jive.corev3.contents.create({

          "type" : "update",

          "subject" : "A status update",

          "parent" : "https://example.jiveon.com/api/core/v3/people/1",

          "content" : {

            "type" : "text/html",

            "text" : "<span>Hello World</span>"

          },

          "attachments": [

              {

                  "doUpload": true,

                  "url": "https://somewebsite.com/someimage.jpg",

                  "contentType": "image/jpg"

              }

          ]

      }

      ).execute(function (res) {console.log(res)})

       

      The problem is that I can't find a temporary image/file service that works within a Custom View Tile.

       

      This works in Jive Apps, but after looking at the code it doesn't appear that it works in Custom View Tiles.

      Binary Data Storage Usage

       

      I've used the temporary image service via REST, but it doesn't appear to be a part of the JS API.

      Jive REST API v3.14 → Image service

       

      There is a REST API service that you can use from within a tile, but it doesn't support binary payloads.

      Making REST API calls directly from a Jive app or tile

       

      Is this possible at all without having to use an external service outside of Jive?