【发布时间】:2017-08-16 01:01:04
【问题描述】:
我正在使用 Glip API 发布消息。我可以从 Glip UI 发布图像,但我没有看到发布图像的选项。有人知道怎么做吗?
【问题讨论】:
标签: ringcentral glip
我正在使用 Glip API 发布消息。我可以从 Glip UI 发布图像,但我没有看到发布图像的选项。有人知道怎么做吗?
【问题讨论】:
标签: ringcentral glip
Glip 最近推出了file upload API,可以用来附加图片。您也可以使用我们的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);
});
【讨论】: