Logout

Logout #

The Logout endpoint invalidates all tokens of the authenticated user making the request.

Request #

curl --location --request POST 'https://api.microbooks.io/auth/v1/logout' \
--header "Authorization: Bearer <bearer_token>" 
import requests

url = "https://api.microbooks.io/auth/v1/logout"
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/logout',
    '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/logout', 
    [headers' => ['Authorization' => 'Bearer <bearer_token>']], 
    $body
);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var client = new RestClient("https://api.microbooks.io/auth/v1/logout");
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 #

{ "message": "Successfully logged out" }