Skip to main content
Call this API from an internal app to obtain an access credential (access token). When calling DingTalk Server APIs, you must use the access token for authentication to ensure that the request comes from a legitimate source and has the required permissions.

API call description

This API is designed for internal enterprise system integration scenarios and is used to obtain the access credential required to call DingTalk open capabilities. A typical usage flow is as follows:
  • Call this API to obtain an access token when the app starts or before the first API call.
  • Cache the obtained access token in local storage (such as Redis or in-memory cache) to avoid repeated requests.
  • Carry this access token in all subsequent API calls that require authentication.
  • Set the cache expiration time slightly shorter than 7,200 seconds (for example, 7,000 seconds) to implement an automatic refresh mechanism and prevent credential expiration caused by time deviations.
  • Avoid calling this API frequently within a short period. Otherwise, the rate limit policy may be triggered, affecting service stability.

Request

Request body

Request example

Java
Python
PHP
Go
Node.js
C#
python2
Swift

Response

Response body

Response body example

Error codes

If an error is returned when calling this API, find the solution based on the error message in the Global error codes document.