Chatting with HipChat
API’S 101

Don Brown

•

Architect

•

Atlassian

•

@mrdonbrown
Install Bitbucket Integration
1. Google “hipchat bitbucket
integration”

10.In a separate tab, go back to
HipChat and logi...
HipChat Add-Ons =
API’s + Connect +
Marketplace
Character Sheets
SaaS Dev
Str
Dex
Con
Int
Wis
Cha
Level
Exp

Experts Founder

Enterprise Arch

17

10

12

18

12

14

12
...
SaaS Jr. Developer
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s i on 3 - Ent re pre ne u...
Goal: Show signups in
my team’s room
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -H "Content-Type: application/json" 
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/m...
<
<
<
<
<
<
<
<
<
{

HTTP/1.1 401 Unauthorized
Server: nginx
Date: Mon, 16 Sep 2013 23:33:27 GMT
Content-Type: application...
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -H "Content-Type: application/json" 
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/m...
<
<
<
<
<
<
<
<
<

HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 16 Sep 2013 23:42:31 GMT
Content-Type: text/html
Conne...
GET https://api.hipchat.com/v2/room/Engineering
{
"created": "2013-08-08T18:42:20",
"id": 34,
...
"participants": [
{
"id"...
GET https://api.hipchat.com/v2/room/Engineering?
expand=participants
{
"created": "2013-08-08T18:42:20",
"id": 34,
...
"pa...
Just text by itself, for
impact.
SaaS Jr. Developer
Scenario
S e s s i on 1 - H a c ke r
S e s s on 2- Int ra pre ne ur
S e s s iion 2 - Int ra pre ne ur
S...
Goal: Show signups in
any team’s room
Just text by itself, for
impact.
Signup
DB

Signup AddOn

HipChat
{
"name": "Signups",
"description": "Posts signups in rooms",
"key": "com.example.signups",
"links": {
"homepage": "https:...
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -v 
!
-u d4d6949e-791e-43cea0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzd
TOBpxI8aP 
!
-d
"grant_type=client_crede...
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 17 Sep 2013 01:28:03 GMT
< Content-Type: application/json
< Transfer-Encodi...
{
"name": "Signups",
"description": "Posts signups in rooms",
"key": "com.example.signups",
"links": {
"homepage": "https:...
SaaS Jr. Developer
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s on 3 -Ent re pre ne ur
S...
Goal: show sales in
customer rooms
{
"name": "Signups",
"description": "Posts signups in rooms",
"key": "com.example.signups",
...
"capabilities": {
"hipchat...
Just text by itself, for
impact.
Screenshot of
marketplace docs
Screenshot of
marketplace registration
Just text by itself, for
impact.
Just text by itself, for
impact.
Enterprise Architect
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s i on 3 - Ent re pre ne...
Goal: Show sales in my
dev team’s room
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -H "Content-Type: application/json" 
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/m...
<
<
<
<
<
<
<
<
<
{

HTTP/1.1 401 Unauthorized
Server: nginx
Date: Mon, 16 Sep 2013 23:33:27 GMT
Content-Type: application...
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -H "Content-Type: application/json" 
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/m...
<
<
<
<
<
<
<
<
<

HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 16 Sep 2013 23:42:31 GMT
Content-Type: text/html
Conne...
GET https://api.hipchat.com/v2/room/Engineering
{
"created": "2013-08-08T18:42:20",
"id": 34,
...
"participants": [
{
"id"...
GET https://api.hipchat.com/v2/room/Engineering?
expand=participants
{
"created": "2013-08-08T18:42:20",
"id": 34,
...
"pa...
Just text by itself, for
impact.
Enterprise Architect
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s i on 3 - Ent re pre ne...
Goal: Show sales in any
team’s room
Just text by itself, for
impact.
Sales DB

Sales Add-On

HipChat
{
"name": "Sales Info",
"description": "Posts sales to rooms",
"key": "com.example.sales",
"links": {
"homepage": "https:/...
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -v 
!
-u d4d6949e-791e-43cea0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzd
TOBpxI8aP 
!
-d
"grant_type=client_crede...
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 17 Sep 2013 01:28:03 GMT
< Content-Type: application/json
< Transfer-Encodi...
{
"name": "Sales Info",
"description": "Posts sales to rooms",
"key": "com.example.sales",
"links": {
"homepage": "https:/...
Enterprise Architect
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s on 3 -Ent re pre ne ur...
Goal: Create side-project
to show Stripe sales in
customer rooms
{
"name": "Stripe Integration",
"description": "Posts credit card sales in rooms",
"key": "com.example.stripe",
...
"capab...
Just text by itself, for
impact.
Screenshot of
marketplace docs
Screenshot of
marketplace registration
Just text by itself, for
impact.
Just text by itself, for
impact.
Experts Founder
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s i on 3 - Ent re pre ne ur
Goal: Add external chat
room to website
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -H "Content-Type: application/json" 
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/m...
<
<
<
<
<
<
<
<
<
{

HTTP/1.1 401 Unauthorized
Server: nginx
Date: Mon, 16 Sep 2013 23:33:27 GMT
Content-Type: application...
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -H "Content-Type: application/json" 
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/m...
<
<
<
<
<
<
<
<
<

HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 16 Sep 2013 23:42:31 GMT
Content-Type: text/html
Conne...
GET https://api.hipchat.com/v2/room/Engineering
{
"created": "2013-08-08T18:42:20",
"id": 34,
...
"participants": [
{
"id"...
GET https://api.hipchat.com/v2/room/Engineering?
expand=participants
{
"created": "2013-08-08T18:42:20",
"id": 34,
...
"pa...
Just text by itself, for
impact.
Experts Founder
Scenario
S e s s i on 1 - H a c ke r
S e s s on 2- Int ra pre ne ur
S e s s iion 2 - Int ra pre ne ur
S e ...
Goal: Private support
chats on website
Just text by itself, for
impact.
Support
DB

Support AddOn

HipChat
{
"name": "Support Chats",
"description": "Manages support chats",
"key": "com.example.support",
"links": {
"homepage": "h...
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
Just text by itself, for
impact.
curl -v 
!
-u d4d6949e-791e-43cea0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzd
TOBpxI8aP 
!
-d
"grant_type=client_crede...
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 17 Sep 2013 01:28:03 GMT
< Content-Type: application/json
< Transfer-Encodi...
{
"name": "Support Chats",
"description": "Manages support chats",
"key": "com.example.support",
"links": {
"homepage": "h...
Experts Founder
Scenario
S e s s i on 1 - H a c ke r
S e s s i on 2 - Int ra pre ne ur
S e s s on 3 -Ent re pre ne ur
S e ...
Goal: Sell support chats
in the Marketplace
{
"name": "Support Chats",
"description": "Manages support chats",
"key": "com.example.support",
...
"capabilities": {
"hi...
Just text by itself, for
impact.
Screenshot of
marketplace docs
Screenshot of
marketplace registration
Just text by itself, for
impact.
Just text by itself, for
impact.
Install Bitbucket Add-on
1.Visit HipChat and login
2.Click on “Rooms” tab
3.Click on desired room
4.Click on “Add-ons”
5.F...
Just text by itself, for
impact.
The Future. . .
Page title here
• Level One
• Level Two
• Level Two
• Level Two
• Level One
Feedback time!
“

Be the hero! Hack HipChat!

”
Thank you!
Don Brown

•

Architect

•

Atlassian

•

@mrdonbrown
Rate this Talk
Chatting with HipChat: APIs 101
Text code below to 22333
or visit http://bit.ly/1dPD0tv
MEH = 5
NO T BA D =...
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
Upcoming SlideShare
Loading in …5
×

Chatting with HIpChat: APIs 101

1,471 views

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,471
On SlideShare
0
From Embeds
0
Number of Embeds
153
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Chatting with HIpChat: APIs 101

  1. 1. Chatting with HipChat API’S 101 Don Brown • Architect • Atlassian • @mrdonbrown
  2. 2. Install Bitbucket Integration 1. Google “hipchat bitbucket integration” 10.In a separate tab, go back to HipChat and login 2. Click first Google result 11.Click on “Group Admin” tab 3. Click “these instructions” link 12.Click on “API” 4. Click “Hipchat hook management” link as page was renamed 13.Type in “Bitbucket integration, select “Notifications, copy new API key 5. Visit Bitbucket and login 14.Click on the “Rooms” tab 6. Go to desired repository 15.Click on the target room 7. Click admin icon 16.Copy the “API ID” value 8. Select “Hooks” menu item 17.Go back to the Bitbucket tab 9. Select “HipChat” from hooks dropdown list 18.Copy in ID, API key, and API url (consult docs), and click “Save”
  3. 3. HipChat Add-Ons = API’s + Connect + Marketplace
  4. 4. Character Sheets SaaS Dev Str Dex Con Int Wis Cha Level Exp Experts Founder Enterprise Arch 17 10 12 18 12 14 12 14 18 15 16 14 11 16 17 12 18 14 2 6 5 4,200 52,650 34,800
  5. 5. SaaS Jr. Developer Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s i on 3 - Ent re pre ne ur
  6. 6. Goal: Show signups in my team’s room
  7. 7. Just text by itself, for impact.
  8. 8. Just text by itself, for impact.
  9. 9. Just text by itself, for impact.
  10. 10. curl -H "Content-Type: application/json" -d '{"message": "Hello world"}' -v "https://api.hipchat.com/v2/room/My %20Room/message"
  11. 11. < < < < < < < < < { HTTP/1.1 401 Unauthorized Server: nginx Date: Mon, 16 Sep 2013 23:33:27 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * WWW-Authenticate: Bearer realm="HipChat" "error": { "code": 401, "message": "Authenticated requests only. See https://www.hipchat.com/docs/apiv2/auth for more information.", "type": "Unauthorized" }
  12. 12. Just text by itself, for impact.
  13. 13. Just text by itself, for impact.
  14. 14. curl -H "Content-Type: application/json" -d '{"message": "Hello world"}' -v "https://api.hipchat.com/v2/room/My %20Room/message? auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFt BmLFdq"
  15. 15. < < < < < < < < < HTTP/1.1 204 No Content Server: nginx Date: Mon, 16 Sep 2013 23:42:31 GMT Content-Type: text/html Connection: keep-alive X-Ratelimit-Remaining: 499 X-Ratelimit-Limit: 500 Access-Control-Allow-Origin: * X-Ratelimit-Reset: 1379374980.0
  16. 16. GET https://api.hipchat.com/v2/room/Engineering { "created": "2013-08-08T18:42:20", "id": 34, ... "participants": [ { "id": 375, "links": { "self": "https://api.hipchat.com/v2/user/375" }, "name": "Garret Heaton" } ] }
  17. 17. GET https://api.hipchat.com/v2/room/Engineering? expand=participants { "created": "2013-08-08T18:42:20", "id": 34, ... "participants": [ { "created": "2013-08-08T18:42:20", "email": "garret@example.com", "id": 375, "is_deleted": false, "is_group_admin": true, "is_guest": false, "mention_name": "GarretHeaton", "name": "Garret Heaton", ... }]}
  18. 18. Just text by itself, for impact.
  19. 19. SaaS Jr. Developer Scenario S e s s i on 1 - H a c ke r S e s s on 2- Int ra pre ne ur S e s s iion 2 - Int ra pre ne ur S e s s i on 3 - Ent re pre ne ur
  20. 20. Goal: Show signups in any team’s room
  21. 21. Just text by itself, for impact.
  22. 22. Signup DB Signup AddOn HipChat
  23. 23. { "name": "Signups", "description": "Posts signups in rooms", "key": "com.example.signups", "links": { "homepage": "https://example.com/signups", "self": "https://example.com/signups/capabilities" }, "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] } } }
  24. 24. Just text by itself, for impact.
  25. 25. Just text by itself, for impact.
  26. 26. Just text by itself, for impact.
  27. 27. Just text by itself, for impact.
  28. 28. Just text by itself, for impact.
  29. 29. curl -v ! -u d4d6949e-791e-43cea0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzd TOBpxI8aP ! -d "grant_type=client_credentials&scope=send_notific ation" ! https://api.hipchat.com/v2/oauth/token
  30. 30. < HTTP/1.1 200 OK < Server: nginx < Date: Tue, 17 Sep 2013 01:28:03 GMT < Content-Type: application/json < Transfer-Encoding: chunked < Connection: keep-alive < X-Ratelimit-Remaining: 499 < X-Ratelimit-Limit: 500 < Access-Control-Allow-Origin: * < X-Ratelimit-Reset: 1379381340.0 < {"access_token": "E9NGsQjqWgHSK50ZXHGgIAoQ0E13b1FuGiLPNdYj", "expires_in": 82800, "scope": "view_group", "token_type": "bearer"}
  31. 31. { "name": "Signups", "description": "Posts signups in rooms", "key": "com.example.signups", "links": { "homepage": "https://example.com/signups", "self": "https://example.com/signups/capabilities" }, "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] }, "installable": { "callbackUrl": "https://example.com/signups/ installed" } } }
  32. 32. SaaS Jr. Developer Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s on 3 -Ent re pre ne ur S e s s iion 3 - Entre pre ne ur
  33. 33. Goal: show sales in customer rooms
  34. 34. { "name": "Signups", "description": "Posts signups in rooms", "key": "com.example.signups", ... "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] }, "installable": { "callbackUrl": "https://example.com/signups/ installed" }, "configurable": { "url": "https://example.com/signups/config" } } }
  35. 35. Just text by itself, for impact.
  36. 36. Screenshot of marketplace docs
  37. 37. Screenshot of marketplace registration
  38. 38. Just text by itself, for impact.
  39. 39. Just text by itself, for impact.
  40. 40. Enterprise Architect Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s i on 3 - Ent re pre ne ur
  41. 41. Goal: Show sales in my dev team’s room
  42. 42. Just text by itself, for impact.
  43. 43. Just text by itself, for impact.
  44. 44. Just text by itself, for impact.
  45. 45. curl -H "Content-Type: application/json" -d '{"message": "Hello world"}' -v "https://api.hipchat.com/v2/room/My %20Room/message"
  46. 46. < < < < < < < < < { HTTP/1.1 401 Unauthorized Server: nginx Date: Mon, 16 Sep 2013 23:33:27 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * WWW-Authenticate: Bearer realm="HipChat" "error": { "code": 401, "message": "Authenticated requests only. See https://www.hipchat.com/docs/apiv2/auth for more information.", "type": "Unauthorized" }
  47. 47. Just text by itself, for impact.
  48. 48. Just text by itself, for impact.
  49. 49. curl -H "Content-Type: application/json" -d '{"message": "Hello world"}' -v "https://api.hipchat.com/v2/room/My %20Room/message? auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFt BmLFdq"
  50. 50. < < < < < < < < < HTTP/1.1 204 No Content Server: nginx Date: Mon, 16 Sep 2013 23:42:31 GMT Content-Type: text/html Connection: keep-alive X-Ratelimit-Remaining: 499 X-Ratelimit-Limit: 500 Access-Control-Allow-Origin: * X-Ratelimit-Reset: 1379374980.0
  51. 51. GET https://api.hipchat.com/v2/room/Engineering { "created": "2013-08-08T18:42:20", "id": 34, ... "participants": [ { "id": 375, "links": { "self": "https://api.hipchat.com/v2/user/375" }, "name": "Garret Heaton" } ] }
  52. 52. GET https://api.hipchat.com/v2/room/Engineering? expand=participants { "created": "2013-08-08T18:42:20", "id": 34, ... "participants": [ { "created": "2013-08-08T18:42:20", "email": "garret@example.com", "id": 375, "is_deleted": false, "is_group_admin": true, "is_guest": false, "mention_name": "GarretHeaton", "name": "Garret Heaton", ... }]}
  53. 53. Just text by itself, for impact.
  54. 54. Enterprise Architect Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s i on 3 - Ent re pre ne ur
  55. 55. Goal: Show sales in any team’s room
  56. 56. Just text by itself, for impact.
  57. 57. Sales DB Sales Add-On HipChat
  58. 58. { "name": "Sales Info", "description": "Posts sales to rooms", "key": "com.example.sales", "links": { "homepage": "https://example.com/sales", "self": "https://example.com/sales/capabilities" }, "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] } } }
  59. 59. Just text by itself, for impact.
  60. 60. Just text by itself, for impact.
  61. 61. Just text by itself, for impact.
  62. 62. Just text by itself, for impact.
  63. 63. Just text by itself, for impact.
  64. 64. curl -v ! -u d4d6949e-791e-43cea0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzd TOBpxI8aP ! -d "grant_type=client_credentials&scope=send_notific ation" ! https://api.hipchat.com/v2/oauth/token
  65. 65. < HTTP/1.1 200 OK < Server: nginx < Date: Tue, 17 Sep 2013 01:28:03 GMT < Content-Type: application/json < Transfer-Encoding: chunked < Connection: keep-alive < X-Ratelimit-Remaining: 499 < X-Ratelimit-Limit: 500 < Access-Control-Allow-Origin: * < X-Ratelimit-Reset: 1379381340.0 < {"access_token": "E9NGsQjqWgHSK50ZXHGgIAoQ0E13b1FuGiLPNdYj", "expires_in": 82800, "scope": "view_group", "token_type": "bearer"}
  66. 66. { "name": "Sales Info", "description": "Posts sales to rooms", "key": "com.example.sales", "links": { "homepage": "https://example.com/sales", "self": "https://example.com/sales/capabilities" }, "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] }, "installable": { "callbackUrl": "https://example.com/sales/ installed" } } }
  67. 67. Enterprise Architect Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s on 3 -Ent re pre ne ur S e s s iion 3 - Entre pre ne ur
  68. 68. Goal: Create side-project to show Stripe sales in customer rooms
  69. 69. { "name": "Stripe Integration", "description": "Posts credit card sales in rooms", "key": "com.example.stripe", ... "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] }, "installable": { "callbackUrl": "https://example.com/stripe/ installed" }, "configurable": { "url": "https://example.com/stripe/config" } } }
  70. 70. Just text by itself, for impact.
  71. 71. Screenshot of marketplace docs
  72. 72. Screenshot of marketplace registration
  73. 73. Just text by itself, for impact.
  74. 74. Just text by itself, for impact.
  75. 75. Experts Founder Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s i on 3 - Ent re pre ne ur
  76. 76. Goal: Add external chat room to website
  77. 77. Just text by itself, for impact.
  78. 78. Just text by itself, for impact.
  79. 79. Just text by itself, for impact.
  80. 80. curl -H "Content-Type: application/json" -d '{"message": "Hello world"}' -v "https://api.hipchat.com/v2/room/My %20Room/message"
  81. 81. < < < < < < < < < { HTTP/1.1 401 Unauthorized Server: nginx Date: Mon, 16 Sep 2013 23:33:27 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * WWW-Authenticate: Bearer realm="HipChat" "error": { "code": 401, "message": "Authenticated requests only. See https://www.hipchat.com/docs/apiv2/auth for more information.", "type": "Unauthorized" }
  82. 82. Just text by itself, for impact.
  83. 83. Just text by itself, for impact.
  84. 84. curl -H "Content-Type: application/json" -d '{"message": "Hello world"}' -v "https://api.hipchat.com/v2/room/My %20Room/message? auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFt BmLFdq"
  85. 85. < < < < < < < < < HTTP/1.1 204 No Content Server: nginx Date: Mon, 16 Sep 2013 23:42:31 GMT Content-Type: text/html Connection: keep-alive X-Ratelimit-Remaining: 499 X-Ratelimit-Limit: 500 Access-Control-Allow-Origin: * X-Ratelimit-Reset: 1379374980.0
  86. 86. GET https://api.hipchat.com/v2/room/Engineering { "created": "2013-08-08T18:42:20", "id": 34, ... "participants": [ { "id": 375, "links": { "self": "https://api.hipchat.com/v2/user/375" }, "name": "Garret Heaton" } ] }
  87. 87. GET https://api.hipchat.com/v2/room/Engineering? expand=participants { "created": "2013-08-08T18:42:20", "id": 34, ... "participants": [ { "created": "2013-08-08T18:42:20", "email": "garret@example.com", "id": 375, "is_deleted": false, "is_group_admin": true, "is_guest": false, "mention_name": "GarretHeaton", "name": "Garret Heaton", ... }]}
  88. 88. Just text by itself, for impact.
  89. 89. Experts Founder Scenario S e s s i on 1 - H a c ke r S e s s on 2- Int ra pre ne ur S e s s iion 2 - Int ra pre ne ur S e s s i on 3 - Ent re pre ne ur
  90. 90. Goal: Private support chats on website
  91. 91. Just text by itself, for impact.
  92. 92. Support DB Support AddOn HipChat
  93. 93. { "name": "Support Chats", "description": "Manages support chats", "key": "com.example.support", "links": { "homepage": "https://example.com/support", "self": "https://example.com/support/capabilities" }, "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] } } }
  94. 94. Just text by itself, for impact.
  95. 95. Just text by itself, for impact.
  96. 96. Just text by itself, for impact.
  97. 97. Just text by itself, for impact.
  98. 98. Just text by itself, for impact.
  99. 99. curl -v ! -u d4d6949e-791e-43cea0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzd TOBpxI8aP ! -d "grant_type=client_credentials&scope=send_notific ation" ! https://api.hipchat.com/v2/oauth/token
  100. 100. < HTTP/1.1 200 OK < Server: nginx < Date: Tue, 17 Sep 2013 01:28:03 GMT < Content-Type: application/json < Transfer-Encoding: chunked < Connection: keep-alive < X-Ratelimit-Remaining: 499 < X-Ratelimit-Limit: 500 < Access-Control-Allow-Origin: * < X-Ratelimit-Reset: 1379381340.0 < {"access_token": "E9NGsQjqWgHSK50ZXHGgIAoQ0E13b1FuGiLPNdYj", "expires_in": 82800, "scope": "view_group", "token_type": "bearer"}
  101. 101. { "name": "Support Chats", "description": "Manages support chats", "key": "com.example.support", "links": { "homepage": "https://example.com/support", "self": "https://example.com/support/capabilities" }, "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] }, "installable": { "callbackUrl": "https://example.com/support/ installed" } } }
  102. 102. Experts Founder Scenario S e s s i on 1 - H a c ke r S e s s i on 2 - Int ra pre ne ur S e s s on 3 -Ent re pre ne ur S e s s iion 3 - Entre pre ne ur
  103. 103. Goal: Sell support chats in the Marketplace
  104. 104. { "name": "Support Chats", "description": "Manages support chats", "key": "com.example.support", ... "capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] }, "installable": { "callbackUrl": "https://example.com/support/ installed" }, "configurable": { "url": "https://example.com/support/config" } } }
  105. 105. Just text by itself, for impact.
  106. 106. Screenshot of marketplace docs
  107. 107. Screenshot of marketplace registration
  108. 108. Just text by itself, for impact.
  109. 109. Just text by itself, for impact.
  110. 110. Install Bitbucket Add-on 1.Visit HipChat and login 2.Click on “Rooms” tab 3.Click on desired room 4.Click on “Add-ons” 5.Find Bitbucket addon, and click “Install” 6.Type the repository name, and click “Add”
  111. 111. Just text by itself, for impact.
  112. 112. The Future. . .
  113. 113. Page title here • Level One • Level Two • Level Two • Level Two • Level One
  114. 114. Feedback time!
  115. 115. “ Be the hero! Hack HipChat! ”
  116. 116. Thank you! Don Brown • Architect • Atlassian • @mrdonbrown
  117. 117. Rate this Talk Chatting with HipChat: APIs 101 Text code below to 22333 or visit http://bit.ly/1dPD0tv MEH = 5 NO T BA D = 6 P R ET T Y GO O D = 7 A WES O ME = 8 To join this session, send text 136888 to

×