【问题标题】:Does the Glip chat API support image (photo) attachments?Glip 聊天 API 是否支持图片(照片)附件?
【发布时间】:2017-08-16 01:01:04
【问题描述】:

我正在使用 Glip API 发布消息。我可以从 Glip UI 发布图像,但我没有看到发布图像的选项。有人知道怎么做吗?

【问题讨论】:

    标签: ringcentral glip


    【解决方案1】:

    Glip 最近推出了file upload API,可以用来附加图片。您也可以使用我们的API Explorer 进行尝试。

    【讨论】:

      【解决方案2】:

      如果有人在寻找工作示例时遇到此问题,这就是我所做的(使用 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);
          });
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-08-05
        • 2011-02-02
        • 2012-03-13
        • 1970-01-01
        • 1970-01-01
        • 2020-10-21
        • 1970-01-01
        • 2023-03-08
        相关资源
        最近更新 更多