API ?? ???
API ?? ???? ????? Web API? ???? Bot? ??? ? ?? ??? ?? ??? ?????.
?API ?? ???? ?? | ?? |
---|---|
HTTP/HTTPS ?? ?? | Extension Service API? HTTP? HTTPS ???? ?? ?? ?? |
API ?? ?? | ??? ????? ??? ??? ??? ??? API ??? ?? ?? ??? ? ?? - ???? ?? ??? ?? ??? ?? - API ???? ???? ??? ????? ?? ??? ???? ?? ?? |
API Request
??????? ???? ?? API? ?? URL ??? ??? ????. HTTP RPC ???? API ??(Request)??? ????? ??? ?? ???? ??? ? ????.
API ?? ??
????? Web API ?? ??? ????? ??? ?? ? ?? ??? ?? ?????, ?? application/json
?? ??? ?????.
??? | ?? | ???? ?? |
---|---|---|
GET | URL | ?? URL? ??? ?? ???? |
POST | Body | Request Body? application/json ?? ??? ??? |
Request Body? application/x-www-form-urlencoded ? ??? ??? |
???JSON? ???? API
????? API ?? ??? ? ??? ?? ?????, ??? ???? ????? ?? API??application/json
?? ??? ???? ?????.
?? | ??? | API ? |
---|---|---|
Messages | - | messages.send |
- | messages.send_by_email | |
Reactive | ??? ??? | submit_action |
??? Modal | request_modal | |
submit_modal |
????HTTP ?? ??
POST /v1/conversations.open
Content-type: application/x-www-form-urlencoded
Authorization: Bearer {YOUR_APP_KEY}
user_id={OPPONENT_USER_ID}
POST /v1/conversations.open
Content-type: application/json
Authorization: Bearer {YOUR_APP_KEY}
{"user_id": {OPPONENT_USER_ID}}
API ??
?????? Web API? Bot ?? ?? ???? ???? ???(App Key)? HTTP ??(Request)? Authorization
??? ?? ???? ?? Bot?? ?? ???? ?? ? ?? ??? ?????.
App Key ?? ? ?? ??? ?? ??? ??? Bot ?? ???? ????? ????.
????Curl ??
curl -X POST https://api.kakaowork.com/v1/conversations.open \
-H "Authorization: Bearer {YOUR_APP_KEY}" \
-d "user_id={USER_ID}"
API Response
?? ????? API ??(Response)? ?? ???? ?? ??? ?? JSON ??? ?????. ??? Content Type? application/json
?? ?????.
?? Response
??? Response?? | ?? | ?? ?? | ?? |
---|---|---|---|
success | Boolean | ?? |
API ?? ?? ?? |
true : ??, {entity name} ??? ?? ?? |
|||
false : ??, error ??? ?? ?? |
|||
{entity name} | Any | ?? |
API ??(Response) ??? - ???? ?? API ??? ?? ?? ??? - API ?? ??( true )? ?? ?? |
error | Object | ?? |
?? ??? ?? ?? - API ?? ??( false )? ?? ?? |
????API ?? ?? ??
{
"success": true,
"user": {
/* ... user entity ... */
}
}
?? Error
API ??? ??? ??, error
??? ?? ??? ?? ??? ??? ?? ? ????.
?? | ?? | ?? ?? | ?? |
---|---|---|---|
code | String | ?? |
?? ??? ???? ?? |
invalid_parameter : ????? ??????, ?? ?? ???? ?? |
|||
invalid_authentication : ??? ???? ???? ?? |
|||
api_not_found : ??? API? ???? URL ?? HTTP ???? ?? |
|||
unauthorized : ???? ???? ?? |
|||
internal_server_error : ???? ?? ?? ?? ?? |
|||
expired_authentication : ??? ???? ??? |
|||
invalid_content_type : ??? API? ???? Content Type? ?? |
|||
missing_parameter : ??? ???? ?? ???? ??? |
|||
message | String | ?? |
?? ??? ?? ?? |
????API ?? ?? ??
{
"success": false,
"error": {
"code": "missing_parameter",
"message": "user_id parameter is missing."
}
}
?? ?? ??
API ??(Response)? ????? JSON ??? ???, ??? ??? ??? ?? ?| ?? ?? ??? ????.
??? ?? ???? ?? | ?? |
---|---|
{Type}[] | ?? ??? ?? ??? ?? ??(Array) - ?? ??? ?? ?? ? null ? ?? ? ??([] )? ??ex) String[] : ???(String) ??? ?? ??? ?? ??(Array) |
Timestamp | Unix Time(??? ??)?? ??? ??(Number) - ??? ???? ??? ?? |
Pagination
Pagination? ??? ?? ?? API? ??? ?? ??? ?????.
?? ??
API ??? ?? ? ?? ? ???? ??? ??, ? ?? ??? ??? ?? ??? ?????.
- ??? ? ??? ??
cursor
?null
? ??
? ?? ??
?? ?? ??? limit
? ????? ?????. ????? ???? ??? API? ??? ???? ?????.
????? ?? ??
# limit=50?? ??
curl -X GET https://api.kakaowork.com/v1/users.list?limit=50
# limit=10?? ??(???)
curl -X GET https://api.kakaowork.com/v1/users.list
? ?? ?? ??? ?? ??
?? ?? API ?? ??? cursor
? ????? ?????. cursor
? ?? ????? ?? ????, ?? ??? ?????.
????? ?? ?? ??? ?? ??
curl -X GET https://api.kakaowork.com/v1/users.list?cursor={?? ??? ???? ?? cursor}
# ?? ? ??
curl -X GET https://api.kakaowork.com/v1/users.list?cursor=Y3Vyc29yX2lkPTE1JmxpbWl0PTEw
API Rate Limit
API Rate Limit? ??? ?? ?? ??? ? ?? API? ??? ????, ???????? DDoS ?? ??? ???? ??? ??? ?? Rate Limit? ???? ????. 1? ?? API Rate Limit? ???? API ??? ???? ???? ?? ??(Request)? ????, ?? 1?? ??? ? ?? ?? ??? 0?? ?????.
Response
Response Header
API Rate Limit? ?????? ??? ???? ????, ?? ??(Response)?? ??? Response Header ??? ?????.
?Rate Limit ?? Response Header ?????? | ?? |
---|---|
ratelimit-limit | ?? ???? ?? ?? ?? |
ratelimit-remaining | ?? ?(minute) ?? ??? ?? ?? |
ratelimit-reset | ??? ratelimit ?? ??? ???? ??(millisecond) |
retry-after | ?? ?? ???? ?? ?(second) - ratelimit? ??? ???? _code: 429 ? ?? ?? |
?? ??
API ?? ? ?? ??? 200?? ???? ???? ??? ?? ?? ??? ???? ??, _code: 429
? ?????.
?????? ??
curl -X GET -D - https://api.kakaowork.com/v1/users.list
HTTP/2 429
(??)
ratelimit-limit: 200
ratelimit-remaining: 0
ratelimit-reset: 1624427839
retry-after: 9
{
"documentation_url": "https://docs.kakaoi.ai/kakao_work/",
"message": "API rate limit exceeded for [\"Bearer 45d9888a.930fa1da90af49419d166cc9bd2e1234\"]. That's antakawork..."
}