hipchat_send: Send a message to the hipchat API v2.

Description Usage Arguments Value References Examples

View source: R/send.R

Description

Send a message to the hipchat API v2.

Usage

1
2
hipchat_send(type, var, ..., api_token = hipchat_api_token(),
  method = "GET")

Arguments

type

character. One of the native Hipchat API domains: c('addon', 'capabilities', 'emoticon', 'oauth', 'room' 'user').

var

character. Whatever goes after the type in the hipchat API url, typically room ID, or user email, depending on the API path you are calling.

...

HTTP arguments to send to the Hipchat API. Unnamed arguments will be passed in to the URL; named arguments will be assumed to be API parameters. See the examples section.

api_token

character. By default, hipchat_api_token().

method

character. HTTP method. Either "GET", "POST", "PUT", or "DELETE". By default, the API url will be inspected and matched with the appropriate method. Otherwise, "GET" will be used.

Value

the JSON output response from the Hipchat API.

References

https://www.hipchat.com/docs/apiv2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
  hipchat_send('room', 'My room', 'notification',
    color = 'green', message = 'Everything looks <b>green</b>',
    notify = FALSE, message_format = 'html')
  # posts to https://api.hipchat.com/v2/room/My room/notification

  hipchat_send('room', 'My room', 'share', 'link',
     message = 'This looks like a cool package',
     link = 'http://github.com/robertzk/hipchat')
  # posts to https://api.hipchat.com/v2/room/My room/share/link
  # and shares a link with the room.

  hipchat_send('user', 'your@friend.org', 'message')
     message = "Hey buddy what's going on?", notify = TRUE,
     message_format = 'text')
  # posts to https://api.hipchat.com/v2/user/your@friend.org/message

  hipchat_send('room', 'My room', 'invite', 'your@friend.org',
     reason = "Come join this room mang")
  # posts to https://api.hipchat.com/v2/room/My room/invite/your@friend.org

## End(Not run)

robertzk/hipchat documentation built on May 27, 2019, 10:34 a.m.