Hi Yves,
The following worked for me:
curl -d '{"message": "Surfs up (awyeah)", "notify": false, "message_format": "text"}' -H 'Content-Type: application/json' "https://api.hipchat.com/v2/user/<user>/message?auth_token=<token>"
i.e - you need to set Content-Type to application/json and send the payload in the bodye.
--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Yves,
The following worked for me:
curl -d '{"message": "Surfs up (awyeah)", "notify": false, "message_format": "text"}' -H 'Content-Type: application/json' "https://api.hipchat.com/v2/user/<user>/message?auth_token=<token>"
i.e - you need to set Content-Type to application/json and send the payload in the bodye.
On 30 January 2015 at 01:52, Yves Berquin <yves.b...@gmail.com> wrote:I've been asking around and it seems this is the place to ask questions about the HipChat API.Please redirect me if this is not the case.I am trying to send a simple private message with the REST API v2 as described here:
https://www.hipchat.com/docs/apiv2/method/private_message_userIf I try sending the message text as the post payload, with a "text/plain" mime type, it's working.What I don't understand is how to send the additional parameters.I tried:
- sending all the parameters as "form" parameters with the "application/x-www-form-urlencoded" mime type
- sending a single json object, with the "application/json" mime type
In both case I receive in the message the whole content, including all the POST delimiters in the first case, and all the json format characters verbatim, in the 2nd case.The Java library doesn't include that API, so I can't steal from that code.The only explanation regarding formatting in that page tells me "The message can also be sent as text/plain". Also? With reference to what?Thanks for any explanations you may add to that API page to clarify it.By the way, I think the default for notify should be true in that explanation (with my simple text method, it does notify).Yves--
Seb RuizAtlassian