Retrieve account information

Table of contents

  1. Request Headers
  2. Responses
  3. Examples
  4. Try It

https://api.useapi.net/v1/account

Request Headers
Authorization: Bearer {API token}
Responses
  • 200 OK

    {
      "email": "[email protected]",
      "created": "2023-08-316T21:03:28.558Z",
      "name": "Your Name",
      "verified": "2023-08-316T21:05:17.137Z",
      "sub": "230831"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Examples
  • curl https://api.useapi.net/v1/account \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/account"; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = "https://api.useapi.net/v1/account"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It