Refresh #
The Refresh endpoint returns a new access token valid for 24 hours for the authenticated user making the request.
Request #
curl --location --request POST 'https://api.microbooks.io/auth/v1/refresh' \
--header "Authorization: Bearer <bearer_token>"
import requests
url = "https://api.microbooks.io/auth/v1/refresh"
body = {}
headers = {"Authorization": "Bearer <bearer_token>"}
response = requests.request("POST", url, headers=headers, json=body)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.microbooks.io/auth/v1/refresh',
'headers': {'Authorization': 'Bearer <bearer_token>'},
'body': '{}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
$client = new Client();
$body = '';
$request = new Request('POST', 'https://api.microbooks.io/auth/v1/refresh',
[headers' => ['Authorization' => 'Bearer <bearer_token>']],
$body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/auth/v1/refresh");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = "{}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
request.AddHeader("Authorization", "Bearer " + <bearer_token>);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response #
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWwubWljcm9ib29rcy5pby9hdXRoL3YxL3JlZnJlc2giLCJpYXQiOjE2NTc5MTI2MjgsImV4cCI6MTY1NzkxNjM2MywibmJmIjoxNjU3OTEyNzYzLCJqdGkiOiJKY3ByN1pvS0RjcHJnbng5Iiwic3ViIjoiMSIsInBydiI6ImM4ZWUxZmM4OWU3NzVlYzRjNzM4NjY3ZTViZTE3YTU5MGI2ZDQwZmMifQ.hRm2es0FYGiEbbqP0Mx7LDGxuzEdeGc2GdHgqvV-iMU",
"token_type": "bearer",
"expires_in": 86400
}