Hi,
I am the author of a xmpp chatbot that uses HipChat. I am trying to send a custom stanza using xmpp to create an application card (https://developer.atlassian.com/hipchat/guide/sending-messages) instead of using the rest api. I cannot find any documentation on how to do this. I see that HipChat supports xhtml-im (per https://answers.atlassian.com/questions/38838139) but I do not know what the server expects to create an application card.
I am able to create the application card through the rest api with the following json payload:
{ "color": "purple", "message_format": "text", "message": "my message", "notify": false, "card": { "style": "application", "format": "compact", "url": "https://www.atlassian.com", "id": "c253adc6-11fa-4941-ae26-7180d67e814a", "title": "My Title", "description": "My description", "date": 1453867674631, "thumbnail": { "url": "https://www.atlassian.com/docroot/wac/resources/wac/img/social-icons/atlassian_logo.jpg", "url@2x": "https://www.atlassian.com/docroot/wac/resources/wac/img/social-icons/atlassian_logo.jpg", "width": 400, "height": 200 }, "attributes": [ { "label": "swapv3", "value": { "label": "test", "url": "https://answers.atlassian.com" } }, { "label": "console", "value": { "label": "link2", "url": "https://answers.atlassian.com" } } ] } }
I can see my xmpp client receiving the following stanza after sending the above:
<message from="a_jabber_channel_id" type="groupchat" to="other_jabber_channel_id"> <body>my message</body> <x xmlns="http://hipchat.com/protocol/muc#room"> <type>system</type> <notify>0</notify> <color>purple</color> <message_format>text</message_format> <card> <raw>{&quot;style&quot;: &quot;application&quot;, &quot;description&quot;: &quot;My description&quot;, &quot;format&quot;: &quot;compact&quot;, &quot;url&quot;: &quot;https://www.atlassian.com&quot;, &quot;title&quot;: &quot;My Title&quot;, &quot;id&quot;: &quot;c253adc6-11fa-4941-ae26-7180d67e814a&quot;, &quot;date&quot;: 1453867674631, &quot;attributes&quot;: [{&quot;value&quot;: {&quot;url&quot;: &quot;https://answers.atlassian.com&quot;, &quot;label&quot;: &quot;test&quot;}, &quot;label&quot;: &quot;swapv3&quot;}, {&quot;value&quot;: {&quot;url&quot;: &quot;https://answers.atlassian.com&quot;, &quot;label&quot;: &quot;link2&quot;}, &quot;label&quot;: &quot;console&quot;}], &quot;validation&quot;: {&quot;safehtmls&quot;: [&quot;activity.html&quot;], &quot;safeurls&quot;: [&quot;url&quot;, &quot;images.image&quot;, &quot;images.image-small&quot;, &quot;images.image-big&quot;, &quot;icon.url&quot;, &quot;icon.url@2x&quot;, &quot;icon&quot;, &quot;thumbnail.url@2x&quot;, &quot;thumbnail.url&quot;]}, &quot;thumbnail&quot;: {&quot;url&quot;: &quot;https://www.atlassian.com/docroot/wac/resources/wac/img/social-icons/atlassian_logo.jpg&quot;, &quot;width&quot;: 400, &quot;url@2x&quot;: &quot;https://www.atlassian.com/docroot/wac/resources/wac/img/social-icons/atlassian_logo.jpg&quot;, &quot;height&quot;: 200}}</raw> </card> <notification_sender type="user" id="jabber_id" /> </x> </message>
The question is.. how can I construct a valid xmpp stanza to mimic the rest api?
Thanks.
Unfortunately, generating card-style messages is only possible through the API interface. The XMPP interface is limited to text/html formats. In order to generate a card message, clients can either call the API directly, or perform some kind of interaction with an addon, which then sends the card message on behalf of the client.
Thanks for the reply Chris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.