Skip to main content
GET
/
auth
/
token
const axios = require('axios');
const AuthenticationApiFp = require('@alohi/faxplus-api').AuthenticationApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;

const config = new Configuration({
    accessToken: accessToken,
    basePath: 'https://restapi.fax.plus/v3'
});

async function getTokenInfo() {
    const req = await AuthenticationApiFp(config).getTokenInfo();
    const resp = await req(axios);
    console.log(resp.data);
}

getTokenInfo()
from faxplus import ApiClient, AuthenticationApi
from faxplus.configuration import Configuration

conf = Configuration()
conf.access_token = access_token
api_client = ApiClient(configuration=conf)
api = AuthenticationApi(api_client)
resp = api.get_token_info()
print(resp)
/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

String url = "https://restapi.fax.plus/v3/auth/token";

String result = Request
    .Get(url)
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer {access-token}")
    .execute()
    .returnContent().asString();

System.out.println(result.toString());
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"}
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/auth/token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}'
);

$client = new GuzzleHttp\Client();

try {
    $response = $client->request('GET','https://restapi.fax.plus/v3/auth/token', array(
        'headers' => $headers,
        )
    );
    print_r($response->getBody()->getContents());
 }
 catch (GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
# You can also use wget
curl -X GET https://restapi.fax.plus/v3/auth/token \
  -H 'Accept: application/json'  \
  -H 'Authorization: Bearer {access-token}'
{
  "scopes": [
    "<string>"
  ],
  "id": "<string>",
  "name": "<string>",
  "preview": "<string>",
  "created_date": 123,
  "expiration_date": 123,
  "last_used": 123
}
{
"error": "unauthorized",
"description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}
{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}
const axios = require('axios');
const AuthenticationApiFp = require('@alohi/faxplus-api').AuthenticationApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;

const config = new Configuration({
    accessToken: accessToken,
    basePath: 'https://restapi.fax.plus/v3'
});

async function getTokenInfo() {
    const req = await AuthenticationApiFp(config).getTokenInfo();
    const resp = await req(axios);
    console.log(resp.data);
}

getTokenInfo()
from faxplus import ApiClient, AuthenticationApi
from faxplus.configuration import Configuration

conf = Configuration()
conf.access_token = access_token
api_client = ApiClient(configuration=conf)
api = AuthenticationApi(api_client)
resp = api.get_token_info()
print(resp)
/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

String url = "https://restapi.fax.plus/v3/auth/token";

String result = Request
    .Get(url)
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer {access-token}")
    .execute()
    .returnContent().asString();

System.out.println(result.toString());
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"}
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/auth/token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}'
);

$client = new GuzzleHttp\Client();

try {
    $response = $client->request('GET','https://restapi.fax.plus/v3/auth/token', array(
        'headers' => $headers,
        )
    );
    print_r($response->getBody()->getContents());
 }
 catch (GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
# You can also use wget
curl -X GET https://restapi.fax.plus/v3/auth/token \
  -H 'Accept: application/json'  \
  -H 'Authorization: Bearer {access-token}'

Authorizations

Authorization
string
header
required

OAuth2 Authorization Grant

Response

Token information

token_type
enum<string>
required

Type of the token

Available options:
pat,
oauth
scopes
string[]
required

List of scopes granted to this token

id
string | null

Token ID (PAT only)

name
string | null

Token name (PAT only)

preview
string | null

Token preview string (PAT only)

created_date
integer<int64> | null

Creation timestamp in milliseconds (PAT only)

expiration_date
integer<int64> | null

Expiration timestamp in milliseconds (PAT only)

last_used
integer<int64> | null

Last used timestamp in milliseconds (PAT only)