Glip chat API 支持图片(照片)附件吗?
Does the Glip chat API support image (photo) attachments?
我正在使用 Glip API 到 post 消息。我可以 post 来自 Glip UI 的图片,但我没有看到 post 图片的选项。有人知道怎么做吗?
Glip 最近推出了file upload API which can be used to attach images. You could also try it out using our API Explorer。
万一有人在寻找工作示例时遇到这个问题,这就是我所做的(使用 Node 和 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);
});
我正在使用 Glip API 到 post 消息。我可以 post 来自 Glip UI 的图片,但我没有看到 post 图片的选项。有人知道怎么做吗?
Glip 最近推出了file upload API which can be used to attach images. You could also try it out using our API Explorer。
万一有人在寻找工作示例时遇到这个问题,这就是我所做的(使用 Node 和 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);
});