More Related Content Similar to Chatting with HIpChat: APIs 101 (20) More from colleenfry (20) Chatting with HIpChat: APIs 10110. Install Bitbucket Integration
1. Google āhipchat bitbucket
integrationā
10.In a separate tab, go back to
HipChat and login
2. Click ļ¬rst 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
āNotiļ¬cations, 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ā
18. curl -H "Content-Type: application/json"
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/message"
19. <
<
<
<
<
<
<
<
<
{
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"
}
23. curl -H "Content-Type: application/json"
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/message?
auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFt
BmLFdq"
24. <
<
<
<
<
<
<
<
<
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
29. 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",
...
}]}
32. 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
36. {
"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" ]
}
}
}
43. 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
44. < 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"}
46. {
"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"
}
}
}
48. 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
51. {
"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"
}
}
}
62. curl -H "Content-Type: application/json"
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/message"
63. <
<
<
<
<
<
<
<
<
{
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"
}
67. curl -H "Content-Type: application/json"
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/message?
auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFt
BmLFdq"
68. <
<
<
<
<
<
<
<
<
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
73. 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",
...
}]}
80. {
"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" ]
}
}
}
87. 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
88. < 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"}
90. {
"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"
}
}
}
95. {
"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"
}
}
}
106. curl -H "Content-Type: application/json"
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/message"
107. <
<
<
<
<
<
<
<
<
{
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"
}
111. curl -H "Content-Type: application/json"
-d '{"message": "Hello world"}'
-v
"https://api.hipchat.com/v2/room/My
%20Room/message?
auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFt
BmLFdq"
112. <
<
<
<
<
<
<
<
<
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
117. 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",
...
}]}
121. 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
125. {
"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" ]
}
}
}
132. 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
133. < 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"}
135. {
"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"
}
}
}
137. 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
140. {
"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"
}
}
}
146. 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ā
155. 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