PBX GUI - Blacklist Module GraphQL APIs
This wiki is to capture the Blacklist module provided GraphQL APIs.
Please find below list of APIs supported by blacklist module.
blacklist module APIs are useful to create, delete and fetch the values of existing configured blacklist.
Add Blacklist Number
Adding a blacklist number to Freepbx/PBXact system.
API Name: addBlacklist
API parameters:
Name | Required | Type | Description |
---|---|---|---|
number | Mandatory | ID | Number which is to be added to blacklist |
description | Optional | String | description for the blacklist number |
clientMutationId | Optional | ID | Client id for request and response |
Query Parameters
clientMutationId |
API Request
1. Api to add Blacklist number
GQLAPI: /admin/api/api/gql
parameters:
mutation {
addBlacklist(input: {
number: "1324546"
description:"blocklist number"
clientMutationId : "12432"
}) {
clientMutationId
}
} |
API Response
2.Api to add Blacklist number
GQLAPI: /admin/api/api/gql
{
"data": {
"addBlacklist": {
"clientMutationId": "12432"
}
}
} |
Remove Blacklist Number
Removing a blacklist number from Freepbx/PBXact system.
API Name: removeBlacklist
API parameters:
Name | Required | Type | Description |
---|---|---|---|
number | Mandatory | ID | Number which is to be removed from the blacklist |
clientMutationId | Optional | ID | Client id for request and response |
Query Parameters
clientMutationId |
API Request
API to remove blacklist number
GQLAPI: /admin/api/api/gql
mutation {
removeBlacklist(input: {
number: "1324546"
clientMutationId : "12432"
}) {
clientMutationId
}
} |
API Response
API to remove blacklist number
GQLAPI: /admin/api/api/gql
{
"data": {
"removeBlacklist": {
"clientMutationId": "12432"
}
}
} |
Fetch All Blacklist Numbers
Fetch all black list numbers from Freepbx/PBXact system
API Name: allBlacklists
API Parameters:
Name | Required | Type | Description |
---|---|---|---|
id | Optional | ID | Unique string to identify the blacklist number. |
description | Optional | String | Description for the blacklisted number |
number | Optional | ID | Blacklisted Number |
Query Parameters
blacklists {
id
description
number
} |
API Request
API to fetch all blacklist numbers
GQLAPI: /admin/api/api/gql
{
allBlacklists{
blacklists {
id
description
number
}
}
} |
API Response
API to fetch all blacklist numbers
GQLAPI: /admin/api/api/gql
{
"data": {
"allBlacklists": {
"blacklists": [
{
"id": "YmxhY2tsaXN0OjMyNDMyNDMyNDIzNA==",
"description": "dsfsfds",
"number": "324324324234"
},
{
"id": "YmxhY2tsaXN0OjM0NTQ2NDM=",
"description": "cxvfbgdhgfh",
"number": "3454643"
}
]
}
}
} |
Fetch Particular Blacklist Number
Fetch particular blacklist number from Freepbx/PBXact system.
API Name: blacklist
API Parameters:
Name | Required | Type | Description |
---|---|---|---|
id | Optional | ID | Blacklisted Number. |
description | Optional | String | Description for the blacklisted number |
number | mandatory | ID | Blacklisted Number |
Query Parameters
id
description
number |
API Request
API to particular blacklist number
GQLAPI: /admin/api/api/gql
{
blacklist(id:"324324324234") {
description
number
}
} |
API Response
API to particular blacklist number
GQLAPI: /admin/api/api/gql
{
"data": {
"blacklist": {
"description": "dsfsfds",
"number": "324324324234"
}
}
} |
Fetch Blacklist Settings
To fetch blacklist settings into Freepbx/PBXact system.
API Name: blacklistSettings
API Parameters:
Name | Required | Type | Description |
---|---|---|---|
blockUnknown | mandatory | Boolean | Boolean value used to identify setting is enabled or not |
destination | optional | string | Destination to which blacklist setting is enabled |
Query Parameters
blockUnknown
destination |
API Request
API to fetch blacklist settings
GQLAPI: /admin/api/api/gql
{
blacklistSettings{
blockUnknown
destination
}
} |
API Response
{
"data": {
"blacklistSettings": {
"blockUnknown": true,
"destination": "Extensions: 101 101"
}
}
} |
Update Blacklist Settings
Add or update blacklist settings
API Name: setBlacklistSettings
API Parameters:
Name | Required | Type | Description |
---|---|---|---|
blockUnknown | mandatory | Boolean | Boolean value to enable or disable blacklist settings. |
destination | mandatory | string | Destination to which blacklist setting to be enabled |
clientMutationId | optional | ID | Client id for request and response |
Query Parameters
blockUnknown
destination
clientMutationId |
API Request
API to set blacklist settings
GQLAPI: /admin/api/api/gql
mutation {
setBlacklistSettings(input: {
blockUnknown: false
destination:"from-did-direct,100,1",
clientMutationId: "12432"
}) {
clientMutationId
blockUnknown
destination
}
} |
API Response
{
"data": {
"setBlacklistSettings": {
"clientMutationId": "12432",
"blockUnknown": false,
"destination": "from-did-direct,100,1"
}
}
} |