How to post a card using Hipchat api


I've wrote a quick python code to POST cards following the documentation page example ( but I am unable to see the card in the client (Mac OS X) although a HTTP 204 code is returned from the server.

May be somebody could provide me a working example?


My code:


#!/usr/bin/env python

import json
import requests

headers = { 'Content-Type' : 'application/json' }
card = {
  "style": "link",
  "url": "",
  "id": "fee4d9a3-685d-4cbd-abaa-c8850d9b1960",
  "title": "My test",
  "description": {
    "format": "html",
    "value": "<b>Add-on link:</b> <a href='#' data-target='hip-connect-tester:hctester.dialog.simple' data-target-options='{\"options\":{\"title\":\"Custom Title\"}, \"parameters\":{\"from\":\"link\"}}'>Open Dialog with parameters</a>"
  "icon": {
    "url": ""
  "date": 1443057955792

data_json = { 'message' : '<b>test1<b>', 'card': card, 'message_format' : 'html' }

params = { 'auth_token' : '[REMOVED]' }

r ='https://[REMOVED][REMOVED]/notification', data=json.dumps(data_json), headers=headers, params=params)
print r



3 answers

1 accepted

2 votes

Are you using the new Mac beta client? Cards aren't supported with the current stable mac release. Another way to see the cards are through the web app:

Yes, you are right. I see the cards in the web interface not in the mac client.



Will be able to use curl command to generate a card

I am facing the same issue. I am able to post the card. But when i click the link on the card the parameters are not passed in the link. I also tried by using urlTemplateValues.

I want to pass parameter to the URL Link. Can you guys please help me.

Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Published Oct 07, 2017 in Hipchat

Bringing Structure to your HipChat Instance

...have mention name FirstnameLastname. Fe.: @MaartenCautreels This certainly helps to know who is being mentioned in a conversation. Imagine your colleague sends the following message...

467 views 1 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot