Refresh access token
1 min
code examples curl request post \\ \ url https //api archbee com/v2/auth/token/refresh \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "granttype" "refresh token" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "granttype" "refresh token" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api archbee com/v2/auth/token/refresh", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api archbee com/v2/auth/token/refresh") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "granttype" "refresh token" }) response = https request(request) puts response read body import requests import json url = "https //api archbee com/v2/auth/token/refresh" payload = json dumps({ "granttype" "refresh token" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // new tokens issued { "accesstoken" "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9 ", "refreshtoken" "dghpcybpcybhihjlznjlc2ggdg9rzw4 ", "tokentype" "bearer", "expiresin" 3600 }// unauthorized — missing or invalid authentication credentials { "code" "validation error", "message" "the request body contains invalid fields", "details" \[ { "field" "email", "message" "must be a valid email address", "code" "invalid format" } ], "requestid" "" }