Retrieve InsightFaceSwap configuration for channel

Table of contents

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

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

The channel value should correspond to an account configured previously via a POST request.

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Responses
  • 200 OK

    {
      "server": "Discord server id",
      "channel": "Discord channel id",
      "discord": "Discord token",
      "credits": {
      "timestamp": "2024-02-01T02:05:24.991000+00:00",
        "total": 50,
        "used": 18
        }
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 404 Not Found

Model
{ // TypeScript, all fields are optional
  discord: string,
  server: string, 
  channel: string,
  credits: {
    timestamp: string,
    total:  number,
    used: number
  }
}
Examples
  • curl https://api.useapi.net/v1/faceswap/account/<channel> \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const channel = "Previously configured channel id"; 
    const apiUrl = `https://api.useapi.net/v1/faceswap/account/${channel}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    channel = "Previously configured channel id"
    apiUrl = f"https://api.useapi.net/v1/faceswap/account/{channel}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It