API

Kakao. Namespace

API

Description:
  • 카카오 API와 관련된 함수들이 포함되어 있습니다.

Methods

(static) cleanup()

Description:
  • API를 호출하기 위해 사용한 리소스를 해제합니다.

(static) request(settings) → {Promise}

Description:
  • 카카오 API를 호출할 수 있습니다.

See:
Example
Kakao.API.request({
  url: '/v2/user/me', // 사용자 정보 가져오기
})
  .then(function(response) {
    console.log(response)
  })
  .catch(function(error) {
    console.error(error)
  })

Kakao.API.request({
  url: '/v1/user/update_profile', // 사용자 정보 저장하기
  data: {
    properties: {
      preferred_brand: 'Kakao',
    },
  },
})
  .then(function(response) {
    console.log(response)
  })
  .catch(function(error) {
    console.error(error)
  })
Parameters:
Name Type Description
settings Object

API 호출과 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Attributes Description
url String

호출할 API의 URL path (호스트가 https://kapi.kakao.com인 API만 지원합니다.)
호스트가 https://dapi.kakao.com인 API (검색, 로컬, 비전, 번역)와 Admin 키를 사용하는 API (인증, 푸시, 페이)는 지원하지 않습니다.

data Object <optional>

API 요청에 사용할 파라미터

files FileList | Array.<File> | Array.<Blob> <optional>

파일 업로드가 필요할 때 사용하는 파라미터

Returns:
Type
Promise