Webhooks
Register new webhook
Get Started
SDKs
API Reference
- Accounts
- Numbers
- Faxes
- Files
- Outbox
- Webhooks
- Shop
Webhooks
Register new webhook
Register a new webhook which will be called on a specific event. See the WebhookCallback model. (Permitted scopes: fax:all:edit, fax:webhook:edit)
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
OAuth2 Authorization Grant
Body
application/json
Request to create new webhook
Webhook model
Response
200
application/json
Webhook ID
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"
}