Reputation: 21
I'm trying to send data to RingCentral Glip using their webhook process from php on Linux.
What I'm actually doing is processing incoming mail messages and reformatting them into a Glip message format and then submitting them via the Glip webhook.
But I've run into what appears to be a character set compatibility problem.
I'm not entirely sure of what character set Glip supports, but I've tried formatting it in UTF-8 and when I submit it the message never gets posted.
If I just use plain ASCII characters the message posts without any problem.
Does anyone know what format Glip requires?
Is there any existing code libraries that people would use with PHP to transform text into that format?
Upvotes: 1
Views: 275
Reputation: 16354
UTF-8 works for me without any special conversion as shown below. Is it possible that the email conversion to UTF-8 isn't working as expected? Can you post an example of the UTF-8 that isn't working for you, along with what you are expecting?
The following demo message works fine for me with JSON and screenshot provided. I've added ♠♥♣♦
to every text field for verification.
You can find the example Go code here:
Code: 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
}
]
}
More information is available on the message formatting here:
http://ringcentral-api-docs.readthedocs.io/en/latest/glip_message_attachments/
Upvotes: 0
Reputation: 21
The answer in my case was that I don't know what character format is required by GLIP but I do know now that it wasn't causing my problem. It turns out that I had two bugs that resulted in my message body being erased and if you send a message to glip with an empty body it submits an empty message rather than just showing the activity and title information that is set (as you would expect if the body was blank) it just treats it as entirely blank.
Upvotes: 1