hipchat_elixir
HipChat client library for Elixir.
Generated from HipChat Swagger API specifications in ymtszw/hipchat_swagger.
Depends on hackney for HTTP client.
Policy
- No state. Access tokens and other credentials should be retrieved/stored by caller applications.
- Relying HipChat cloud/server for parameter validations.
- Cover APIs used in server side only.
Usage
- Add
:hipchat_elixiras a dependency - Create client struct (e.g.
Hipchat.V2.Client.new/3).- Pass
access_tokenif the targeted API requires authentication. access_tokencan be one of four types (according to the doc):- Add-on token (need OAuth2 flow beforehand)
- User token (need OAuth2 flow beforehand)
- Personal access token
- Room notification token
- Pass
- Pass the resultant client and other parameters to the targeted API function.
retrieve_access_token # Implementation is up to your app
|> Hipchat.V2.Client.new
|> Hipchat.V2.Api.send_room_notification(room_id, %{"message" => "Hello hipchat!"})
# {:ok, %Hipchat.Httpc.Response{body: "", headers: ..., status: 204}}
Todo
- Generate other APIs.
- Helper for handling OAuth client ID and secrets to retrieve short-lived Add-on token or User token.
License
MIT