Refresh auth token
curl --request POST \
--url https://v2.flabs.in/client/auth/token/refresh \
--header 'Content-Type: application/json' \
--data '
{
"clientID": "your-client-id",
"refreshToken": "your-refresh-token"
}
'import requests
url = "https://v2.flabs.in/client/auth/token/refresh"
payload = {
"clientID": "your-client-id",
"refreshToken": "your-refresh-token"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({clientID: 'your-client-id', refreshToken: 'your-refresh-token'})
};
fetch('https://v2.flabs.in/client/auth/token/refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.flabs.in/client/auth/token/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientID' => 'your-client-id',
'refreshToken' => 'your-refresh-token'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v2.flabs.in/client/auth/token/refresh"
payload := strings.NewReader("{\n \"clientID\": \"your-client-id\",\n \"refreshToken\": \"your-refresh-token\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v2.flabs.in/client/auth/token/refresh")
.header("Content-Type", "application/json")
.body("{\n \"clientID\": \"your-client-id\",\n \"refreshToken\": \"your-refresh-token\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.flabs.in/client/auth/token/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientID\": \"your-client-id\",\n \"refreshToken\": \"your-refresh-token\"\n}"
response = http.request(request)
puts response.read_body{
"authToken": "auth-token",
"refreshToken": "refresh-token",
"expiresIn": 600
}{
"success": false,
"status": 401,
"message": "Unauthorized",
"error": {
"details": "Invalid client credentials"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Authorization
Refresh Auth Token
Get new Authorization token using the refresh token and client credentials.
POST
/
client
/
auth
/
token
/
refresh
Refresh auth token
curl --request POST \
--url https://v2.flabs.in/client/auth/token/refresh \
--header 'Content-Type: application/json' \
--data '
{
"clientID": "your-client-id",
"refreshToken": "your-refresh-token"
}
'import requests
url = "https://v2.flabs.in/client/auth/token/refresh"
payload = {
"clientID": "your-client-id",
"refreshToken": "your-refresh-token"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({clientID: 'your-client-id', refreshToken: 'your-refresh-token'})
};
fetch('https://v2.flabs.in/client/auth/token/refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.flabs.in/client/auth/token/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientID' => 'your-client-id',
'refreshToken' => 'your-refresh-token'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v2.flabs.in/client/auth/token/refresh"
payload := strings.NewReader("{\n \"clientID\": \"your-client-id\",\n \"refreshToken\": \"your-refresh-token\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v2.flabs.in/client/auth/token/refresh")
.header("Content-Type", "application/json")
.body("{\n \"clientID\": \"your-client-id\",\n \"refreshToken\": \"your-refresh-token\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.flabs.in/client/auth/token/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientID\": \"your-client-id\",\n \"refreshToken\": \"your-refresh-token\"\n}"
response = http.request(request)
puts response.read_body{
"authToken": "auth-token",
"refreshToken": "refresh-token",
"expiresIn": 600
}{
"success": false,
"status": 401,
"message": "Unauthorized",
"error": {
"details": "Invalid client credentials"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Was this page helpful?
⌘I