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 inviteMembers() {
const emails = ["user1@example.com", "user2@example.com"];
const req = await AccountsApiFp(config).inviteMembers(emails);
const resp = await req(axios);
}
inviteMembers()
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)
emails = ["user1@example.com", "user2@example.com"]
resp = api.invite_members(emails)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
String url = "https://restapi.fax.plus/v3/accounts/self/member-invitations";
String jsonBody = "[\"user1@example.com\", \"user2@example.com\"]";
String result = Request
.Post(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("Content-Type", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.bodyString(jsonBody, ContentType.APPLICATION_JSON)
.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"},
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR_CLIENT_ID"}
}
jsonBody := []byte(`["user1@example.com", "user2@example.com"]`)
data := bytes.NewBuffer(jsonBody)
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/member-invitations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Content-Type' => '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('POST','https://restapi.fax.plus/v3/accounts/self/member-invitations', array(
'headers' => $headers,
'json' => ["user1@example.com", "user2@example.com"],
)
);
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 POST https://restapi.fax.plus/v3/accounts/self/member-invitations \
-H 'Accept: application/json' \
-H 'Content-Type: 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"' \
-d '["user1@example.com", "user2@example.com"]'
{
"message": "Invitations sent successfully"
}{
"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": "forbidden",
"description": "You are not allowed to access this resource."
}{
"error": "user_exists",
"description": "One or more emails are already registered",
"existing_emails": [
"existing@example.com"
]
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}Accounts
Invite corporate members
Invite new users to join your corporate account by sending them email invitations (maximum 10 per request). Only corporate admins with appropriate permissions can use this endpoint. (Permitted scopes: fax:all:edit, fax:member:edit)
POST
/
accounts
/
self
/
member-invitations
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 inviteMembers() {
const emails = ["user1@example.com", "user2@example.com"];
const req = await AccountsApiFp(config).inviteMembers(emails);
const resp = await req(axios);
}
inviteMembers()
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)
emails = ["user1@example.com", "user2@example.com"]
resp = api.invite_members(emails)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
String url = "https://restapi.fax.plus/v3/accounts/self/member-invitations";
String jsonBody = "[\"user1@example.com\", \"user2@example.com\"]";
String result = Request
.Post(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("Content-Type", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.bodyString(jsonBody, ContentType.APPLICATION_JSON)
.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"},
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR_CLIENT_ID"}
}
jsonBody := []byte(`["user1@example.com", "user2@example.com"]`)
data := bytes.NewBuffer(jsonBody)
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/member-invitations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Content-Type' => '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('POST','https://restapi.fax.plus/v3/accounts/self/member-invitations', array(
'headers' => $headers,
'json' => ["user1@example.com", "user2@example.com"],
)
);
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 POST https://restapi.fax.plus/v3/accounts/self/member-invitations \
-H 'Accept: application/json' \
-H 'Content-Type: 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"' \
-d '["user1@example.com", "user2@example.com"]'
{
"message": "Invitations sent successfully"
}{
"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": "forbidden",
"description": "You are not allowed to access this resource."
}{
"error": "user_exists",
"description": "One or more emails are already registered",
"existing_emails": [
"existing@example.com"
]
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}You can invite up to 10 users per request. If you need to invite more users, make multiple requests.
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 inviteMembers() {
const emails = ["user1@example.com", "user2@example.com"];
const req = await AccountsApiFp(config).inviteMembers(emails);
const resp = await req(axios);
}
inviteMembers()
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)
emails = ["user1@example.com", "user2@example.com"]
resp = api.invite_members(emails)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
String url = "https://restapi.fax.plus/v3/accounts/self/member-invitations";
String jsonBody = "[\"user1@example.com\", \"user2@example.com\"]";
String result = Request
.Post(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("Content-Type", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.bodyString(jsonBody, ContentType.APPLICATION_JSON)
.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"},
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR_CLIENT_ID"}
}
jsonBody := []byte(`["user1@example.com", "user2@example.com"]`)
data := bytes.NewBuffer(jsonBody)
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/member-invitations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Content-Type' => '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('POST','https://restapi.fax.plus/v3/accounts/self/member-invitations', array(
'headers' => $headers,
'json' => ["user1@example.com", "user2@example.com"],
)
);
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 POST https://restapi.fax.plus/v3/accounts/self/member-invitations \
-H 'Accept: application/json' \
-H 'Content-Type: 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"' \
-d '["user1@example.com", "user2@example.com"]'
Authorizations
oauth2personal_access_token
OAuth2 Authorization Grant
Body
application/json
List of email addresses to invite
Required array length:
1 - 10 elementsEmail address of the user to invite or resend invitation to
Response
Invitations sent successfully
Example:
"Invitations sent successfully"
⌘I