POST
/
hooks
const axios = require('axios');
const WebhooksApiFp = require('@alohi/faxplus-api').WebhooksApiFp;
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 createWebhook() {
    const reqParams = {
        "webhook": {
            "target": "http://myapp.com/fax_received",
            "event": "fax_received"
        }
    }
    const req = await WebhooksApiFp(config).createWebhook(reqParams);
    const resp = await req(axios);
}

createWebhook()
{
  "id": "6048b47181dbe1a7d67fcc98"
}
const axios = require('axios');
const WebhooksApiFp = require('@alohi/faxplus-api').WebhooksApiFp;
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 createWebhook() {
    const reqParams = {
        "webhook": {
            "target": "http://myapp.com/fax_received",
            "event": "fax_received"
        }
    }
    const req = await WebhooksApiFp(config).createWebhook(reqParams);
    const resp = await req(axios);
}

createWebhook()

Authorizations

Authorization
string
header
required

OAuth2 Authorization Grant

Body

application/json
Request to create new webhook

Webhook model

target
string
required

Webhook target URL

event
enum<string>
required

Webhook event type

Available options:
fax_received,
fax_sent,
fax_page_received
id
string

Webhook ID

Response

200
application/json

Webhook ID

id
string
required

Webhook ID