v2.public.refresh_access_token
POST /api/v2/auth/access_token/get
Dùng API này để làm mới access_token sau khi hết hạn. Refresh_token chỉ có thể dùng một lần, API này cũng sẽ trả về refresh_token mới. Hãy dùng refresh_token mới cho lần gọi RefreshAccessToken tiếp theo.
Đường dẫn Endpoint
URL: https://partner.shopeemobile.com/api/v2/auth/access_token/get
Tham số chung
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| partner_id | int | 1 | ID đối tác được cấp sau khi đăng ký thành công. Bắt buộc cho tất cả các yêu cầu. |
| timestamp | timestamp | 1610000000 | Dùng để xác định thời điểm của yêu cầu. Bắt buộc cho tất cả các yêu cầu. Hết hạn sau 5 phút. |
| sign | string | e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 | Signature generated by partner_id, api path, timestamp and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2 |
Tham số Request
| Tên | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|
| refresh_token | string | True | 4c7259534969484e71734d695a6e6d55 | Use refresh_token to get a new access_token. Each refresh_token is valid for 30 days, and can only be used once by either a shop_id or merchant_id or supplier_id or user_id. |
| partner_id | int64 | True | 2001887 | The partner_id obtained from the App. This partner_id is inserted into the body. |
| shop_id | int64 | False | 322300222 | The shop_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. |
| merchant_id | int64 | False | The merchant_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. | |
| supplier_id | int64 | False | The supplier_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. | |
| user_id | int64 | False | The user_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. |
Tham số Response
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| error | string | Cho biết loại lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi. | |
| message | string | Cho biết chi tiết lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi. | |
| request_id | string | Mã định danh cho yêu cầu API, dùng để theo dõi lỗi. | |
| partner_id | int64 | Returned when the API call is successful. The partner_id you used for this refresh. | |
| shop_id | int64 | Returned when the API call is successful. The shop_id for this refresh. | |
| merchant_id | int64 | Returned when the API call is successful. The merchant_id for this refresh. | |
| supplier_id | int64 | Returned when the API call is successful. The supplier_id for this refresh. | |
| user_id | int64 | Returned when the API call is successful. The user_id for this refresh. | |
| access_token | string | Returned when the API call is successful. Each new access_token is a dynamic token that can be used multiple times. It expires after 4 hours. | |
| refresh_token | string | New refresh_tokenReturned when the API call is successful. Use a refresh_token to get a new access_token. Each refresh_token is valid for 30 days, and can only be used once by either a shop_id or merchant_id or supplier_id or user_id. | |
| expire_in | timestamp | Returned when the API call is successful. The validity period of the access_token, in seconds. |