Upload
others
View
24
Download
0
Embed Size (px)
Citation preview
LINE Notify API Document
20161024 upload
20160929
API API OAuth2 LINE
1. LINE2. OAuth2 authorization endpoint 3. LINE4. OAuth2 token endpoint 5. 6. ( ) API7. ( ) API8. ( ) API
OAuth2 URL OAuth2
API( ) API( ) API
API
OAuth2 (https://tools.ietf.org/html/rfc6749) authorization_code
API notifybot.line.me
GET https://notifybot.line.me/oauth/authorize
OAuth2 authorization endpoint URI
/
Method GET
������������� "code"
client_id string OAuth ID
redirect_uri uri URI
code URI https
scope "notify"
state string CSRF ID redirect_uri state
CSRF
LINE Notify state
response_mode string "form_post" form post redirect_uri POST : https://openid.net/specs/oauthv2formpostresponsemode1_0.html
code
http://arstechnica.com/security/2016/07/newattackthatcrippleshttpscryptoworksonmacswindowsandlinux/
redirect_uri POST
code string access token
state string state
redirect_uri
����� string OAuth2https://tools.ietf.org/html/rfc6749#section4.1.2
state string state
error_description string OAuth2https://tools.ietf.org/html/rfc6749#section4.1.2
POST https://notifybot.line.me/oauth/token
OAuth2 token endpoint
/
Method POST
ContentType ���������������������������������
grant_type "authorization_code"
code string code
redirect_uri uri authorization endpoint API redirect_uri
client_id string OAuth ID
client_secret string OAuth
Status 200:
400:
:
ContentType application/json
JSON object
name type value description
access_token stringAPI
LINE API OAuth
API notifyapi.line.me
Authorization: Bearer <access_token> RFC6750 401 WWWAuthenticate
POST https://notifyapi.line.me/api/notify
API 401 LINE Notify ( )
application/xwwwformurlencoded (HTML ) POST
LINE
/
Method POST
ContentType ���������������������������������
��
�������������������
Authorization Bearer <access_token>
message String 1000
imageThumbnail HTTP/HTTPS URL 240×240px / JPEG
imageFullsize HTTP/HTTPS URL 1024×1024px / JPEG
imageFile File LINEpng, jpeg
imageThumbnail/imageFullsize imageFile
1 uploadAPI Rate Limit
API
ref. https://developers.line.me/businessconnect/apireference#sending_message
Status 200:
400:
401:
500:
:
ContentType application/json
JSON object
name type value description
status number HTTP
200:
400:
401:
message string
GET https://notifyapi.line.me/api/status
API API
/api/notify /api/revoke API
API 401 LINE Notify ( )
$ curl ‐X POST ‐H 'Authorization: Bearer <access_token>' ‐F 'message=foobar' \https://notify‐api.line.me/api/notify{"status":200,"message":"ok"} $ curl ‐v ‐X POST ‐H 'Authorization: Bearer invalidtoken' ‐F 'message=foobar' \https://notify‐api.line.me/api/notify{"status":400,"message":"Invalid access token"}
LINE Notify API
/
Method GET
Authorization Bearer <access_token>
JSON
Status 200:
401:
:
ContentType application/json
JSON object
name type value description
status number HTTP
200:
401:
message string
targetType string "USER"
"GROUP"
target string null
null
POST https://notifyapi.line.me/api/revoke
API API API
1. /api/revoke 2. 1 200 3. 1 401 4. ( )
LINE Notify API
/
$ curl ‐H 'Authorization: Bearer <access_token>' \https://notify‐api.line.me/api/status{"status":200,"message":"ok","target":"foobar"} $ curl ‐H 'Authorization: Bearer invalidtoken' \https://notify‐api.line.me/api/status{"status":400,"message":"Invalid access token"}
Method POST
ContentType ���������������������������������
Authorization Bearer <access_token>
JSON
Status 200:
401:
:
ContentType application/json
JSON object
name type value description
status number HTTP
200:
401:
message string
API Rate Limit1 API call
1000
access token
API Rate Limit status API response header
Header name Description
XRateLimitLimit 1 API call
XRateLimitRemaining
API call
XRateLimitImageLimit
1 Image upload
XRateLimitImageRemaining
Image upload
XRateLimitReset ( UTC epochseconds )
ex:1472195604
$ curl ‐X POST ‐H 'Authorization: Bearer <access_token>' \https://notify‐api.line.me/api/revoke{"status":200,"message":"ok"} $ curl ‐X POST ‐H 'Authorization: Bearer invalidtoken' \https://notify‐api.line.me/api/revoke{"status":400,"message":"Invalid access token"}