hipchat

Trouble with bash shell script, attempting to POST variable JSON data using cURL

*爱你&永不变心* 提交于 2021-02-14 08:21:08
问题 I'm having trouble with a bash shell script, attempting to POST variable JSON data using cURL. I'm running from a Mac. I can successfully post static data but I can't seem to figure out how to incorporate variables. I introduced <room> and <token> for the sake of these examples. This script works successfully: #!/bin/bash curl -X POST -H "Content-Type: application/json" --data '{ "color":"red", "message":"Build failed", "message_format":"text" }' https://api.hipchat.com/v2/room/<room>

Trouble with bash shell script, attempting to POST variable JSON data using cURL

半城伤御伤魂 提交于 2021-02-14 08:20:52
问题 I'm having trouble with a bash shell script, attempting to POST variable JSON data using cURL. I'm running from a Mac. I can successfully post static data but I can't seem to figure out how to incorporate variables. I introduced <room> and <token> for the sake of these examples. This script works successfully: #!/bin/bash curl -X POST -H "Content-Type: application/json" --data '{ "color":"red", "message":"Build failed", "message_format":"text" }' https://api.hipchat.com/v2/room/<room>

Trouble with bash shell script, attempting to POST variable JSON data using cURL

天大地大妈咪最大 提交于 2021-02-14 08:20:10
问题 I'm having trouble with a bash shell script, attempting to POST variable JSON data using cURL. I'm running from a Mac. I can successfully post static data but I can't seem to figure out how to incorporate variables. I introduced <room> and <token> for the sake of these examples. This script works successfully: #!/bin/bash curl -X POST -H "Content-Type: application/json" --data '{ "color":"red", "message":"Build failed", "message_format":"text" }' https://api.hipchat.com/v2/room/<room>

How to attach files to ruby hipchat messages?

徘徊边缘 提交于 2020-01-05 03:44:19
问题 I want to send text files through hipchat using the ruby hipchat-rb gem. There doesn't seem to be a way to do this described in the readme of this gem. Is it possible to do this? 回答1: the working solution: #!/usr/bin/env ruby require 'hipchat' client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'HIPCHAT_URL') client.user('some_username').send_file('message', File.open('some-file.txt') ) 来源: https://stackoverflow.com/questions/41271497/how-to-attach-files-to-ruby

How to get all message history from Hipchat for a room via the API?

北战南征 提交于 2019-12-21 05:46:12
问题 I was using the Hipchat API (v2) a bit today and ran into an odd issue where I was not able to really pull up all of the history for a room. It seemed as though when I queried a specific date, for example, it would only retrieve a fraction of the history for that date given. I had had plans to simply iterate across all of the dates for a Room to extract the history in a format that I could use, but ended up hitting this and am now unsure if it is really possible to pull out the history fully.

How to post to hipchat from python

我们两清 提交于 2019-12-05 06:40:32
问题 I have some python tools that I would like to have send updates to a hipchat room. I do this elsewhere with shell scripts, so I know it works in our environment, but I can't seem to get the token pushed to the hipchat API. Gotta be something simple. First, this authenticates properly and delivers a message: curl -d "room_id=xxx&from=DummyFrom&message=ThisIsATest&color=green" https://api.hipchat.com/v1/rooms/message?auth_token=yyy But when I try to use the python "requests" module, I am

How to post to hipchat from python

不问归期 提交于 2019-12-03 22:07:06
I have some python tools that I would like to have send updates to a hipchat room. I do this elsewhere with shell scripts, so I know it works in our environment, but I can't seem to get the token pushed to the hipchat API. Gotta be something simple. First, this authenticates properly and delivers a message: curl -d "room_id=xxx&from=DummyFrom&message=ThisIsATest&color=green" https://api.hipchat.com/v1/rooms/message?auth_token=yyy But when I try to use the python "requests" module, I am getting stuck. import requests room_id_real="xxx" auth_token_real="yyy" payload={"room_id":room_id_real,"from

How to get all message history from Hipchat for a room via the API?

烂漫一生 提交于 2019-12-03 17:09:28
I was using the Hipchat API (v2) a bit today and ran into an odd issue where I was not able to really pull up all of the history for a room. It seemed as though when I queried a specific date, for example, it would only retrieve a fraction of the history for that date given. I had had plans to simply iterate across all of the dates for a Room to extract the history in a format that I could use, but ended up hitting this and am now unsure if it is really possible to pull out the history fully. I realize that this is a bit clunky. It is pulling the JSON as a string and then I have to form it