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?
            Asked
            
        
        
            Active
            
        
            Viewed 156 times
        
    2 Answers
1
            Glip recently launched the file upload API which can be used to attach images. You could also try it out using our API Explorer.
        Pawan
        
- 1,954
 - 4
 - 21
 - 27
 
1
            
            
        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);
    });
        piisexactly3
        
- 779
 - 7
 - 16