Refresh Access Token
Refresh the access token to ensure that your application and the YMP are connected via the API interface.
Note: Refresh the API token in each 30 minutes, or the old access token will be
invalid and your application and the YMP will be disconnected.
HTTP method and endpoint
POST /oauth/token?grant_type=refresh_token&refresh_token={refresh_token}
Request parameters
| Parameter | Importance | Description |
| refresh_token | Required | The latest refresh_token value. |
Response parameters
| Parameter | Importance | Description |
| access_token | Required | The new access token. |
| token_type | Required | The token type. |
| refresh_token | Required | The new refresh token. |
| expires_in | Required | The expiration time of access token. Unit: second. |
| scope | Optional | The scope controls the set of resources and operations that
an access token permits. During the access-token request, your
application sends one or more values in the
scope parameter. |
| login_name | Required | The user name of YMP web login. |
| jti | Required | A JWT(JSON Web Token) that contains identity information of the access token and refresh token. |
Examples
Request Example
POST /oauth/token HTTP/1.1 Host: ympapi.yeastarcloud.com Content-Type: application/x-www-form-urlencoded grant_type=refresh_token&refresh_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJhZG1pbiIsInNjb3BlIjpbImxvY2FsaG9zdCJdLCJvcmdhbml6YXRpb24iOiJhZG1pblJNSnYiLCJhdGkiOiI0OTU1NzUwMS03OWJjLTRkZjktYTRkYS03ZWRlOGEzOWIwYzMiLCJleHAiOjE1NDY1Njg5MzAsImF1dGhvcml0aWVzIjpbIlJPTEVfQURNSU4iLCJST0xFX1VTRVIiXSwianRpIjoiOTEyZjgxOGQtMTM5MC00ODBjLTk2MzctODZmMzc3YmMzM2E2IiwiY2xpZW50X2lkIjoibG9jYWxob3N0In0.GDH-m91WmFj6BEKEOJVwYj_pC3dBy6AUBNiO6cUqfy4
Response Example
HTTP/1.1 200 OK { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbl9uYW1lIjoiY2VjaWxpYUB5ZWFzdGFyLmNvbSIsInNjb3BlIjpbInRydXN0Il0sImV4cCI6MTU0NjkxNjE5NSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9hZG1pbiJdLCJqdGkiOiIyZjJjNzQ0Ni0yZmNkLTQ2NjEtOTcwYi04NTMwMmZhYTEyZTQiLCJjbGllbnRfaWQiOiI5Nzg5OTNmMDk2YzQ0MTFmYTljYzgwZWUyZTYyZjFmMiJ9.eB1Xeex_DdPGo-zYK3thY7zFQT8DAZPNg-VKpNNvKI4", "token_type": "bearer", "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbl9uYW1lIjoiY2VjaWxpYUB5ZWFzdGFyLmNvbSIsInNjb3BlIjpbInRydXN0Il0sImF0aSI6IjJmMmM3NDQ2LTJmY2QtNDY2MS05NzBiLTg1MzAyZmFhMTJlNCIsImV4cCI6MTU0ODEzODU2OCwiYXV0aG9yaXRpZXMiOlsiUk9MRV9hZG1pbiJdLCJqdGkiOiJkMDA4ZTAwNy02NGM1LTRlM2UtODY2Ny1mMGRkZGY2MDI5YzMiLCJjbGllbnRfaWQiOiI5Nzg5OTNmMDk2YzQ0MTFmYTljYzgwZWUyZTYyZjFmMiJ9.0UfBMNEpJOJXFEQVTdu5hZy54KRNdrR0M0I5ClnbF7k", "expires_in": 1799, "scope": "trust", "login_name": "cecilia@yeastar.com", "jti": "2f2c7446-2fcd-4661-970b-85302faa12e4" }