Grokify
Grokify

Reputation: 16354

Does the Glip chat API support image (photo) attachments?

I'm using the Glip API to post messages. I can post images from the Glip UI but I don't see an option to post images. Does anyone know how to do this?

Upvotes: 1

Views: 160

Answers (2)

piisexactly3
piisexactly3

Reputation: 779

In case someone comes across this looking for a working example, here's what I did (using Node and the RingCentral SDK):

var RC = require('ringcentral');
var fs = require('fs');
var FormData = require('form-data');

// {login to Glip and generate the platform object (https://github.com/ringcentral/ringcentral-js)}

var formData = new FormData();
formData.append('attachment', fs.createReadStream('image.png'));

platform
   .send({
       method: 'POST',
       url: '/glip/files',
       body: formData,
       query: {
          groupId: '1234', // whatever group you want to post to
       }
    })
    .then(function(){
       console.log('file uploaded');
    })
    .catch(function(e){
       console.log(e.message);
    });

Upvotes: 1

Pawan
Pawan

Reputation: 2014

Glip recently launched the file upload API which can be used to attach images. You could also try it out using our API Explorer.

Upvotes: 1

Related Questions