> For the complete documentation index, see [llms.txt](https://docs.etelecom.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.etelecom.vn/tich-hop-api/zalo-cloud/zalo-cloud-api/lay-refresh-token.md).

# Lấy refresh token

API này dùng để lấy refresh token, bạn cần tiến hành ủy quyền lại OA cho ứng dụng (app). Sau đó gọi API "Kết nối OA".

{% hint style="info" %}
**Lưu ý:**

* Đối với các API sử dụng cho Shop thì API\_KEY: [`<api_key>`](https://docs.etelecom.vn/tich-hop-api/shop/tai-khoan#api-key).Thông tin base\_url của [Shop](https://docs.etelecom.vn/tich-hop-api/shop/tai-khoan)
* Đối với các API sử dụng cho Partner thì API\_KEY: [`<shop_key>`](https://docs.etelecom.vn/tich-hop-api/partner/su-dung#ket-noi-lan-thu-hai-tro-di).Thông tin base\_url của [Partner](https://docs.etelecom.vn/tich-hop-api/partner/tai-khoan)
  {% endhint %}

## POST $BASE\_URL.Zalo/RefreshToken

> RefreshToken

```json
{"openapi":"3.1.1","info":{"title":"API Document","version":"v1"},"tags":[{"name":"Zalo"}],"paths":{"$BASE_URL.Zalo/RefreshToken":{"post":{"tags":["Zalo"],"summary":"RefreshToken","operationId":"shop.Zalo-RefreshToken","responses":{"200":{"description":"A successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/mkAuthorizeOAResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mkRefreshTokenRequest"}}},"required":true}}}},"components":{"schemas":{"mkAuthorizeOAResponse":{"type":"object","properties":{"url":{"type":"string"}}},"mkRefreshTokenRequest":{"type":"object","properties":{"oa_id":{"type":"string","format":"int64"}}}}}}
```

**Request:**

```json
curl --location '$BASE_URL.Zalo/RefreshToken' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
    "oa_id": "int64",
    "redirect_uri": "string"
}'
```

**Response**

```json
{
  "url": "string"
}
```

**Cấu trúc body của request**

<table><thead><tr><th width="202.33333333333331">Tham số</th><th width="137">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>oa_id</td><td>int64</td><td>ID của OA</td></tr><tr><td>redirect_uri</td><td>string</td><td>Đường dẫn callback được thiết lập ở "Official Account Callback Url" trên ứng dụng <a href="https://developers.zalo.me/apps">https://developers.zalo.me/apps</a></td></tr></tbody></table>

**Cấu trúc thuộc tính dữ liệu trả về**

<table><thead><tr><th width="201.33333333333331">Tham số</th><th width="134">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>url</td><td>string</td><td>Liên kết uỷ quyền OA cho app (ứng dụng)</td></tr></tbody></table>
