asonas / chatwork-ruby

MIT License
64 stars 27 forks source link

Support ChatWork OAuth #21

Closed sue445 closed 6 years ago

sue445 commented 6 years ago

New Features

Perform ChatWork API with access token

require "chatwork"

ChatWork.access_token = "XXX"
ChatWork::Message.create(room_id: 1234, body: "Hello, ChatWork!")

Refresh access token with refresh token

require "chatwork"

ChatWork.client_id = "XXX"
ChatWork.client_secret = "XXX"
refresh_token = "XXX"
token = ChatWork::Token.refresh_access_token(refresh_token)
new_access_token = token["access_token"]

# Create message
ChatWork.access_token = new_access_token
ChatWork::Message.create(room_id: 1234, body: "Hello, ChatWork!")

Specification

See following

Note

I think this PR conflicts with #20. I will immediately resolve the conflict after you merge.

sue445 commented 6 years ago

I rebase and pushed.

asonas commented 6 years ago

I rebase and pushed.

Great!! I'm always grateful for your help!