Skip to content

Remover tokens de acesso

DELETE
/users/accessTokens/{id}

Para deletar um token de acesso por ID, utilize o método DELETE na rota /users/accessTokens/{id}. Este método requer os seguintes parâmetros:

  • id: ID do token de acesso

Este método não retorna nenhum dado.

Importante:

  • O token de acesso deve ser enviado no cabeçalho da requisição, no campo Authorization.

Parâmetros

Parâmetros de Caminho

id*

Token id

Tipostring
Obrigatório

Respostas

Request was successful
JSON
{
}

Exemplos

cURL
curl -X DELETE \
'https://api.api4com.com/api/v1/users/accessTokens/{id}' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.api4com.com/api/v1/users/accessTokens/{id}', {method:'DELETE',headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.api4com.com/api/v1/users/accessTokens/{id}';
$method = 'DELETE';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://api.api4com.com/api/v1/users/accessTokens/{id}'

headers = {
    'Content-Type': 'application/json'
}

response = requests.delete(url, headers=headers)
print(response.json())

Released under the MIT License.