---
title: Refresh Access Token
slug: eco-for-tiktok/refresh-access-token
docTags: 
createdAt: 2025-02-06T09:25:37.130Z
---

:::ApiMethodV2
```json
{
  "name": "Refresh",
  "method": "GET",
  "url": "https://api-sandbox.klavi.ai/data/eco/v1/refresh",
  "description": "Refresh the access token",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "k_NCOigziNc0lESS8bK3O",
        "language": "curl",
        "code": "curl --location 'https://api-sandbox.klavi.ai/data/eco/v1/refresh' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'",
        "customLabel": ""
      },
      {
        "id": "NipvacF-LUopvUTrQ_hk2",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'GET',\n   'url': 'https://api-sandbox.klavi.ai/data/eco/v1/refresh',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   }\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "tZJRjdnTiZ1XBEKspOIFA",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api-sandbox.klavi.ai/data/eco/v1/refresh\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "BKe29Mj6Gt6fz5pyOZBTV",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://api-sandbox.klavi.ai/data/eco/v1/refresh\"\n\npayload = {}\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "hCCZqosbVp3aRjfRXwXUq",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-sandbox.klavi.ai/data/eco/v1/refresh\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "k_NCOigziNc0lESS8bK3O"
  },
  "results": {
    "languages": [
      {
        "id": "VYGpyVzsojkVL3nK6pUXj",
        "language": "200",
        "customLabel": "",
        "code": "{\n      \"accessToken\": \"JhbGciOiJFUzI1NiIs.QtYjAyOC1hN2ZhMWFjZGRjZjkiLCJ0.nlTqpAZHeq4P2xFD\",\n      \"expireIn\": 1800\n}"
      }
    ],
    "selectedLanguageId": "VYGpyVzsojkVL3nK6pUXj"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "Bearer access token, it returned by the /auth",
        "": "required"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "response": [
    {
      "name": "accessToken",
      "kind": "optional",
      "type": "string",
      "description": "Access token"
    },
    {
      "name": "expireIn",
      "kind": "optional",
      "type": "string",
      "description": "Token validity duration, default 1800 seconds",
      "children": []
    }
  ],
  "autoGeneratedAnchorSlug": "refresh",
  "legacyHash": "XigK8tflod2louTGVCwPm"
}
```
:::

