簡體   English   中英

RingCentral Glip webhook 不支持通過電子郵件接收的異常字符

[英]RingCentral Glip webhook not supporting unusual characters received via email

我正在嘗試使用 Linux 上的 php 中的 webhook 進程將數據發送到 RingCentral Glip。

我實際上在做的是處理傳入的郵件消息並將它們重新格式化為 Glip 消息格式,然后通過 Glip webhook 提交它們。
但是我遇到了一個字符集兼容性問題。

我不完全確定 Glip 支持哪些字符集,但我嘗試將其格式化為 UTF-8,當我提交時,消息從未發布。

如果我只使用純 ASCII 字符,則消息發布沒有任何問題。

有誰知道 Glip 需要什么格式?
是否有任何現有的代碼庫可供人們使用 PHP 將文本轉換為該格式?

就我而言,答案是我不知道 GLIP 需要什么字符格式,但我現在知道它並沒有導致我的問題。 事實證明,我有兩個錯誤導致我的消息正文被刪除,如果您將消息發送到帶有空正文的 glip,它會提交一條空消息,而不僅僅是顯示設置的活動和標題信息(如您所料)如果正文是空白的)它只是將其視為完全空白。

UTF-8 對我有用,無需任何特殊轉換,如下所示。 電子郵件轉換為 UTF-8 是否可能無法按預期工作? 您能否發布一個不適合您的 UTF-8 示例以及您所期望的內容?

以下演示消息適用於我提供的 JSON 和屏幕截圖。 我已將♠♥♣♦添加到每個文本字段以進行驗證。

您可以在此處找到示例 Go 代碼:

代碼: github.com/grokify/go-glip/...

{
  "icon": "https://i.imgur.com/9yILi61.png",
  "title": "**Title of the post ♠♥♣♦**",
  "body": "Body of the post ♠♥♣♦",
  "attachments": [
    {
      "color": "#00ff2a",
      "pretext": "Attachment pretext appears before the attachment block ♠♥♣♦",
      "author_name": "Author Name ♠♥♣♦",
      "author_link": "https://example.com/author_link",
      "author_icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/000080_Navy_Blue_Square.svg/1200px-000080_Navy_Blue_Square.svg.png",
      "title": "Attachment Title ♠♥♣♦",
      "title_link": "https://example.com/title_link",
      "fields": [
        {
          "title": "Field 1 ♠♥♣♦",
          "value": "A short field ♠♥♣♦",
          "short": true
        },
        {
          "title": "Field 2",
          "value": "This is [a linked short field](https://example.com)",
          "short": true
        },
        {
          "title": "Field 3 ♠♥♣♦",
          "value": "A long, full-width field with *formatting* and [a link](https://example.com) \n\n ♠♥♣♦"
        }
      ],
      "text": "Attachment text ♠♥♣♦",
      "image_url": "https://media3.giphy.com/media/l4FssTixISsPStXRC/giphy.gif",
      "thumbnail_url": "https://funkybuddhabrewery.com/sites/default/files/WorldBeerCupGold.png",
      "footer": "Attachment footer and timestamp ♠♥♣♦",
      "footer_icon": "http://www.iconsdb.com/icons/preview/red/square-ios-app-xxl.png",
      "ts": 1517169226
    }
  ]
}

Glip Webhook 示例

此處提供有關消息格式的更多信息:

http://ringcentral-api-docs.readthedocs.io/en/latest/glip_message_attachments/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM