PBX GUI - SMS Module GraphQL APIs
This wiki is to capture the SMS module provided GraphQL APIs.
Please find below list of APIs supported by SMS module.
SMS module APIs are useful to create , modify , delete extensions and fetch the values of sms web hooks.
Create SMS webhook
Creating a sms webhook into Freepbx/PBXact system.
API Name addSmsWebhook API.
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
webHookBaseurl | Mandatory | String |
| SMS web hook url for which sms data has to be sent |
enablewebHook | Mandatory | Boolean | false | Status of the web hook. |
dataToBeSentOn | Mandatory | Enum |
| which SMS event should fire the webhook. Accepted values: "send" , "receive" or "both"
|
Query Parameters
status
message |
API Request
1. Api to add SMS web hook
GQLAPI: /admin/api/api/gql
parameters:
mutation {
addSmsWebhook(input: {
webHookBaseurl: "https://web.hook.sh/31fb9b81-3a9e-4e93-a2bd-147761ea82bb"
enablewebHook: true
dataToBeSentOn: both
}) {
status
message
}
} |
API Response
{
"data": {
"addSmsWebhook": {
"status": true,
"message": "Webhook added successfully..!!"
}
}
} |
Update SMS web hook
Update SMS webhook updates an existing SMS webhook
API Name updateSmsWebhook API.
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | Mandatory | String |
| Id which is used to identify the webhook url |
webHookBaseurl | Mandatory | String |
| SMS web hook url for which sms data has to be sent |
enablewebHook | Mandatory | Boolean | false | Status of the web hook. |
dataToBeSentOn | Mandatory | Enum |
| which SMS event should fire the webhook. Accepted values: "send" , "receive" or "both"
|
Query Parameters
status
message |
API Request
GQLAPI: /admin/api/api/gql
Parameters:
mutation {
updateSmsWebhook(input: {
id:"35"
webHookBaseurl: "https://web.hook.sh/"
enablewebHook: true
dataToBeSentOn: send
}) {
status
message
}
} |
API Response
{
"data": {
"updateSmsWebhook": {
"status": true,
"message": "Webhook updated successfully..!!"
}
}
} |
Delete SMS webhook
Delete an sms webhook from Freepbx/PBXACT
API Name deleteSmsWebhook API.
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | Mandatory | ID |
| Id which is used to identify the webhook url |
Query Parameters
status
message |
API Request
GQLAPI: /admin/api/api/gql
Parameters:
mutation {
deleteSmsWebhook(input: { id: "39"}) {
status
message
}
} |
API Response
{
"data": {
"deleteSmsWebhook": {
"status": true,
"message": "Sms webhook deleted successfully"
}
}
} |
Fetch All SMS webhook data
API Name : fetchAllSmsWebhook
API Parameters to query
Query Parameters
status
message
webhookDetails {
id
webhookUrl
enablewebHook
dataToBeSentOn
} |
API Request
GQLAPI: /admin/api/api/gql
query{
fetchAllSmsWebhook {
status
message
webhookDetails {
id
webhookUrl
enablewebHook
dataToBeSentOn
}
}
} |
API Response
{
"data": {
"fetchAllSmsWebhook": {
"status": true,
"message": "List of sms webhooks",
"webhookDetails": [
{
"id": "40",
"webhookUrl": "https://web.hook.sh/31fb9b81-3a9e-4e93-a2bd-147761ea82bb",
"enablewebHook": true,
"dataToBeSentOn": "both"
},
{
"id": "41",
"webhookUrl": "https://web.hook.sh/31fb9b81-3a9e-4e93-a2bd-147761ea82bb",
"enablewebHook": true,
"dataToBeSentOn": "send"
},
{
"id": "42",
"webhookUrl": "https://web.hook.sh/31fb9b81-3a9e-4e93-a2bd-147761ea82bb",
"enablewebHook": true,
"dataToBeSentOn": "receive"
}
]
}
}
} |
Fetch SMS webhook
API Name fetchSmsWebhook API.
API Parameters:
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | Mandatory | Id |
| ID used to identify webhook |
API Parameters to query
Query Parameters
id
webhookUrl
enablewebHook
dataToBeSentOn
status
message |
API Request
GQLAPI: /admin/api/api/gql
query{
fetchSmsWebhook(id: "40") {
id
webhookUrl
enablewebHook
dataToBeSentOn
status
message
}
} |
API Response
{
"data": {
"fetchSmsWebhook": {
"id": "40",
"webhookUrl": "https://web.hook.sh/31fb9b81-3a9e-4e93-a2bd-147761ea82bb",
"enablewebHook": true,
"dataToBeSentOn": "both",
"status": true,
"message": "Sms webhooks data found successfully..!!"
}
}
} |