chatting with hipchat: apis 101

Post on 11-Jan-2015

606 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Don Brown • Arch i tec t • At lass ian • @mrdonbrown

Chatting with HipChatAPI ’S 101

1. Google “hipchat bitbucket integration”

2. Click first Google result

3. Click “these instructions” link

4. Click “Hipchat hook management” link as page was renamed

5. Visit Bitbucket and login

6. Go to desired repository

7. Click admin icon

8. Select “Hooks” menu item

9. Select “HipChat” from hooks dropdown list

10.In a separate tab, go back to HipChat and login

11.Click on “Group Admin” tab

12.Click on “API”

13.Type in “Bitbucket integration, select “Notifications, copy new API key

14.Click on the “Rooms” tab

15.Click on the target room

16.Copy the “API ID” value

17.Go back to the Bitbucket tab

18.Copy in ID, API key, and API url (consult docs), and click “Save”

Install Bitbucket Integration

HipChat Add-Ons =

API’s + Connect + Marketplace

Character Sheets

SaaS Dev Experts Founder Enterprise ArchStrDexConInt

WisChaLevelExp

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

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Session 1 - Hacker

SaaS Jr. Developer Scenario

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/message"

< 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" }

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/message?auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFtBmLFdq"

< 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

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" } ]}

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", ... }]}

Just text by itself, for impact.

Session 1 - Hacker

Session 3 - Entrepreneur

Session 2 - Intrapreneur

SaaS Jr. Developer Scenario

Session 2- Intrapreneur

Goal: Show signups in any team’s room

Just text by itself, for impact.

HipChat

Signup DB

Signup Add-On

{ "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" ] } }}

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-43ce-a0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzdTOBpxI8aP \ ! -d "grant_type=client_credentials&scope=send_notification" \! https://api.hipchat.com/v2/oauth/token

< 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"}

{ "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" } }}

Session 1 - Hacker

Session 3 - Entrepreneur

Session 2 - Intrapreneur

SaaS Jr. Developer Scenario

Session 3 -Entrepreneur

Goal: show sales in customer rooms

{ "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" } }}

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.

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Session 1 - Hacker

Enterprise Architect Scenario

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/message"

< 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" }

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/message?auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFtBmLFdq"

< 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

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" } ]}

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", ... }]}

Just text by itself, for impact.

Session 1 - Hacker

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Enterprise Architect Scenario

Session 2 - Intrapreneur

Goal: Show sales in any team’s room

Just text by itself, for impact.

HipChat

Sales DB Sales Add-On

{ "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" ] } }}

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-43ce-a0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzdTOBpxI8aP \ ! -d "grant_type=client_credentials&scope=send_notification" \! https://api.hipchat.com/v2/oauth/token

< 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"}

{ "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" } }}

Session 1 - Hacker

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Enterprise Architect Scenario

Session 3 -Entrepreneur

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",

...

"capabilities": { "hipchatApiConsumer": { "scopes": [ "send_notification" ] },

"installable": { "callbackUrl": "https://example.com/stripe/installed" },

"configurable": { "url": "https://example.com/stripe/config" } }}

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.

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Session 1 - Hacker

Experts Founder Scenario

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/message"

< 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" }

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/message?auth_token=VPNE7g0rHbfpNZ68XcOP0mwoBhwLGe9cFtBmLFdq"

< 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

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" } ]}

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", ... }]}

Just text by itself, for impact.

Session 1 - Hacker

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Experts Founder Scenario

Session 2- Intrapreneur

Goal: Private support chats on website

Just text by itself, for impact.

HipChat

Support DB

Support Add-On

{ "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" ] } }}

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-43ce-a0b7-50134495b73e:j998i9niK8zhi89R2sieBVVQSFfIgzdTOBpxI8aP \ ! -d "grant_type=client_credentials&scope=send_notification" \! https://api.hipchat.com/v2/oauth/token

< 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"}

{ "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" } }}

Session 1 - Hacker

Session 3 - Entrepreneur

Session 2 - Intrapreneur

Experts Founder Scenario

Session 3 -Entrepreneur

Goal: Sell support chats in the Marketplace

{ "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" } }}

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.

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”

Install Bitbucket Add-on

Just text by itself, for impact.

The Future. . .

• Level One

• Level Two

• Level Two

• Level Two

• Level One

Page title here

Feedback time!

Be the hero! Hack HipChat!”“

Thank you!

Don Brown • Arch i tec t • At lass ian • @mrdonbrown

Text code below to 22333or visit http://bit.ly/1dPD0tv

Chatting with HipChat: APIs 101

To join this session, send text 136888 to

AWESOME = 8

PRETTY GOOD = 7

NOT BAD = 6

MEH = 5

Rate this Talk

top related