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()
{
"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": "[email protected]",
"last_password_modification_date": "2017-05-06 05:22:21",
"lastname": "Smith",
"member_of": {},
"notifications": {
"black_list": {
"uids": []
},
"settings": {
"email": {
"addresses": [
"[email protected]"
],
"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"
}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()
{
"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": "[email protected]",
"last_password_modification_date": "2017-05-06 05:22:21",
"lastname": "Smith",
"member_of": {},
"notifications": {
"black_list": {
"uids": []
},
"settings": {
"email": {
"addresses": [
"[email protected]"
],
"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"
}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()
OAuth2 Authorization Grant
User ID to get information about. For your own account use 'self'
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
Account email address
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
File name of your company logo
Your company name in case you are a corporate admin
File type
tiff, pdf Role of the account in the company
Save fax CDRs in inbox status
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
Account notification settings
Show child attributes
Email notification settings
Show child attributes
Set to true if you want to receive notifications when your balance is low
Set to true if you want to receive notifications about our new features
Set to true if you want to receive notifications about receiving faxes
Set to true if you want to receive notifications when your fax is being send
Set to true if you want to receive new voicemail notifications
List of email addresses to send notifications to
Email attachments settings
Show child attributes
Set to true if you want to receive new faxes as notification attachments
Set to true if you want to receive your sent fax as an attachment to the notification
Push notification settings
Show child attributes
Set to true if you want to receive notifications when your balance is low
Set to true if you want to receive notifications about our new features
Set to true if you want to receive notifications about receiving faxes
Set to true if you want to receive notifications when your fax is being send
Set to true if you want to receive new voicemail notifications
SMS notification settings
Show child attributes
Set to true if you want to receive notifications when your balance is low
Set to true if you want to receive notifications about our new features
Set to true if you want to receive notifications about receiving faxes
Set to true if you want to receive notifications when your fax is being send
Set to true if you want to receive new voicemail notifications
List of phone numbers to send SMS notifications to
Notifications language
en Slack notification settings
Show child attributes
with_attachment, no_attachment, off with_attachment, no_attachment, off Channel to send notifications
Your account phone number
Profile image path
Account settings
Show child attributes
Account caller id name
Show child attributes
Enable text enhancement for faxes by default
Default fax resolution
fine, superfine Enable automatic retry for partially sent faxes
Deprecated. Use settings.send_fax.should_enhance instead