const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;
const config = new Configuration({
accessToken: accessToken,
basePath: 'https://restapi.fax.plus/v3',
// Header required only when using the OAuth2 token scheme
baseOptions: {
headers: {
"x-fax-clientid": clientId,
}
}
});
async function getUser() {
const reqParams = {
"userId": '473e1eb6'
}
const req = await AccountsApiFp(config).getUser(reqParams);
const resp = await req(axios);
}
getUser()
from faxplus import ApiClient, AccountsApi
from faxplus.configuration import Configuration
conf = Configuration()
conf.access_token = access_token
# header_name and header_value required only when using the OAuth2 token scheme
api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
api = AccountsApi(api_client)
resp = api.get_user(
user_id='473e1eb6')
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'473e1eb6'");
StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}");
String result = Request
.Get(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
.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{
// The x-fax-clientid header is required only when using the OAuth2 token scheme
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR_CLIENT_ID"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/accounts/{user_id}", 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}',
// The x-fax-clientid header is required only when using the OAuth2 token scheme
'x-fax-clientid' => '{client ID}',
);
$client = new GuzzleHttp\Client();
try {
$response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}', 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/accounts/{user_id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
# The x-fax-clientid header is required only when using the OAuth2 token scheme
-H 'x-fax-clientid: "YOUR_CLIENT_ID"'
{
"account_data": {
"company_name": "Company name",
"default_file_type": "pdf",
"save_history": true
},
"account_type": "corporate_admin",
"creation_date": "2017-05-06 05:22:21",
"email": "sample@fax.plus",
"last_password_modification_date": "2017-05-06 05:22:21",
"lastname": "Smith",
"member_of": {},
"notifications": {
"black_list": {
"uids": []
},
"settings": {
"email": {
"addresses": [
"sample@fax.plus"
],
"low_credit": true,
"new_feature": true,
"receive_fax": true,
"send_fax": true,
"voicemail": true
},
"language": "fa",
"push_notifications": {
"low_credit": true,
"new_feature": true,
"receive_fax": true,
"send_fax": true,
"voicemail": true
},
"sms": {
"low_credit": true,
"new_feature": true,
"numbers": [
"+16699990000"
],
"receive_fax": true,
"send_fax": true,
"voicemail": true
}
}
},
"phone": "+16699990000",
"profile_image": "",
"settings": {
"caller_id_name": "Fax.Plus",
"send_fax": {
"options": {},
"retry": {
"count": 0,
"delay": 0
},
"should_enhance": true,
"default_resolution": "fine",
"partially_sent_retry": false
}
},
"status": "active",
"uid": "7724157c0974440293e45877c57f0703"
}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"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"
}Get account information
Get information about an account. For members user_id can only be self. For admin it can be either self, or a user_id of any corporate member. (Permitted scopes: fax:all:read, fax:member:read, fax:user:read)
const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;
const config = new Configuration({
accessToken: accessToken,
basePath: 'https://restapi.fax.plus/v3',
// Header required only when using the OAuth2 token scheme
baseOptions: {
headers: {
"x-fax-clientid": clientId,
}
}
});
async function getUser() {
const reqParams = {
"userId": '473e1eb6'
}
const req = await AccountsApiFp(config).getUser(reqParams);
const resp = await req(axios);
}
getUser()
from faxplus import ApiClient, AccountsApi
from faxplus.configuration import Configuration
conf = Configuration()
conf.access_token = access_token
# header_name and header_value required only when using the OAuth2 token scheme
api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
api = AccountsApi(api_client)
resp = api.get_user(
user_id='473e1eb6')
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'473e1eb6'");
StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}");
String result = Request
.Get(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
.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{
// The x-fax-clientid header is required only when using the OAuth2 token scheme
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR_CLIENT_ID"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/accounts/{user_id}", 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}',
// The x-fax-clientid header is required only when using the OAuth2 token scheme
'x-fax-clientid' => '{client ID}',
);
$client = new GuzzleHttp\Client();
try {
$response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}', 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/accounts/{user_id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
# The x-fax-clientid header is required only when using the OAuth2 token scheme
-H 'x-fax-clientid: "YOUR_CLIENT_ID"'
{
"account_data": {
"company_name": "Company name",
"default_file_type": "pdf",
"save_history": true
},
"account_type": "corporate_admin",
"creation_date": "2017-05-06 05:22:21",
"email": "sample@fax.plus",
"last_password_modification_date": "2017-05-06 05:22:21",
"lastname": "Smith",
"member_of": {},
"notifications": {
"black_list": {
"uids": []
},
"settings": {
"email": {
"addresses": [
"sample@fax.plus"
],
"low_credit": true,
"new_feature": true,
"receive_fax": true,
"send_fax": true,
"voicemail": true
},
"language": "fa",
"push_notifications": {
"low_credit": true,
"new_feature": true,
"receive_fax": true,
"send_fax": true,
"voicemail": true
},
"sms": {
"low_credit": true,
"new_feature": true,
"numbers": [
"+16699990000"
],
"receive_fax": true,
"send_fax": true,
"voicemail": true
}
}
},
"phone": "+16699990000",
"profile_image": "",
"settings": {
"caller_id_name": "Fax.Plus",
"send_fax": {
"options": {},
"retry": {
"count": 0,
"delay": 0
},
"should_enhance": true,
"default_resolution": "fine",
"partially_sent_retry": false
}
},
"status": "active",
"uid": "7724157c0974440293e45877c57f0703"
}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"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 AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;
const config = new Configuration({
accessToken: accessToken,
basePath: 'https://restapi.fax.plus/v3',
// Header required only when using the OAuth2 token scheme
baseOptions: {
headers: {
"x-fax-clientid": clientId,
}
}
});
async function getUser() {
const reqParams = {
"userId": '473e1eb6'
}
const req = await AccountsApiFp(config).getUser(reqParams);
const resp = await req(axios);
}
getUser()
from faxplus import ApiClient, AccountsApi
from faxplus.configuration import Configuration
conf = Configuration()
conf.access_token = access_token
# header_name and header_value required only when using the OAuth2 token scheme
api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
api = AccountsApi(api_client)
resp = api.get_user(
user_id='473e1eb6')
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'473e1eb6'");
StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}");
String result = Request
.Get(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
.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{
// The x-fax-clientid header is required only when using the OAuth2 token scheme
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR_CLIENT_ID"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/accounts/{user_id}", 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}',
// The x-fax-clientid header is required only when using the OAuth2 token scheme
'x-fax-clientid' => '{client ID}',
);
$client = new GuzzleHttp\Client();
try {
$response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}', 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/accounts/{user_id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
# The x-fax-clientid header is required only when using the OAuth2 token scheme
-H 'x-fax-clientid: "YOUR_CLIENT_ID"'
Authorizations
OAuth2 Authorization Grant
Path Parameters
User ID to get information about. For your own account use 'self'
Response
Object containing account information
User account model
Account type which could be corporate_admin, individual, etc
corporate_admin, individual, corporate_member Creation date in UTC. Format: YYYY-MM-DD HH:mm:ss
^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}Account email address
^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$Your account status which could be active, inactive etc
active, unverified_phone, suspended, disabled, inactive, deleted, corporate_deleted, waiting_for_signup User ID of current user
Show child attributes
Show child attributes
The date on which you have changed your password
Your last name
List of user ids that you are member of.
Your first name
Account notification settings
Show child attributes
Show child attributes
Your account phone number
^$|^[+]?[0-9]{8,}$Profile image path
Account settings
Show child attributes
Show child attributes