Core Module GraphQL APIs

This wiki is to capture the Core module provided GraphQL APIs.

 

Please find below list of APIs supported by Core module.

Core module APIs are useful to create , modify , delete extensions and fetch the values of existing configured extensions. 

 

 

 

 

Create Extension

Creating an extension into Freepbx/PBXact system.

 

API Name  addExtension API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

extensionId

Mandatory

ID

 

Unique string to specify the extension number.

name

Mandatory

string

 

Display name

tech

Optional

String

pjsip

SIP Technology device driver. If not specify then will use PJSIP to create the extension.

Accepted values:  "sip" or "pjsip".

channelName

Optional

String

 

Channel name in case if using DAHDI

callerID

Optional

String

 

The CallerID name for calls from this user will be set to this name. Recommended to use "name" not the number.

outboundCID

Optional

String

 

This overrides the caller id when dialling out a trunk. This setting will override the common outbound caller id set in the trunk.

emergencyCID

Optional

String

 

This caller id will always be set when dialing out an outbound route flagged as emergency. The emergency CID overrides all other caller id settings.

email

Mandatory

String

 

User Email address to use for services such as voicemail, user management and fax etc.

vmEnable

Optional

Boolean

True

Voicemail enable / disable

vmPassword

Optional

String

 

Voicemail password. If not specify then user can access the voicemails without any password/pin.

umEnable

Optional

Boolean

True

User manager enable/disable. If enabled mandatory to set umPassword

umGroups

Optional

String

1

User manager group. if not specified will use all user(1) created at the time of installation. In case of multiple add comma separated values.

umPassword

Oprional

String

 

Set passwords for user management. Its mandatory to set password if umEnable is set to true.

maxContacts

Optional

Integer

1

Set max_contacts value for chan_pjsip extension.

 

 

Query Parameters 

status message

 

 

API Request 

1. Api to add Extension   GQLAPI:  /admin/api/api/gql   parameters:   mutation {     addExtension(         input: {             extensionId: 9090090115             name: "api test"             tech: "pjsip"             channelName: "APi Test2"             outboundCid: "12345678901"             email: "xyzabc@gmailcom"             umGroups: "1"             umEnable: true             umPassword: "password"             vmPassword: "asda"             vmEnable: true             callerID: "234234324"             emergencyCid: "1221333331"             clientMutationId: "test1231"             maxContacts: "3"         }     ) {         status         message     } }

 

API Response 

{   "data": {     "addExtension": {       "status": true,       "message": "Extension has been created Successfully"     }   } }

Update Extension

 

Update extension in FreePBX/PBXACT to do any modification of an existing extension parameters.

If optional parameters are not passed, It will use the configured extension value. 

 

API Name  updateExtension API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

extensionId

Mandatory

ID

 

Unique string to specify the extension number.

name

Mandatory

string

 

Display name

tech

Optional

String

 

SIP Technology device driver. If not specify then will use PJSIP to create the extension.

Accepted values:  "sip" or "pjsip".

channelName

Optional

String

 

Channel name in case if using DAHDI

callerID

Optional

String

 

The Caller ID name for calls from this user will be set to this name. Recommended to use "name" not the number.

outboundCID

Optional

String

 

This overrides the caller id when dialing out a trunk. This setting will override the common outbound caller id set in the trunk.

emergencyCID

Optional

String

 

This caller id will always be set when dialing out an outbound route flagged as emergency. The emergency CID overrides all other caller id settings.

email

Optional

String

 

User Email address to use for services such as voicemail, user management and fax etc.

vmEnable

Optional

Boolean

True

Voicemail enable / disable. If enabled mandatory to set umPassword.

vmPassword

Optional

String

 

Voicemail password. If not specify then user can access the voicemails without any password/pin.

umEnable

Optional

Boolean

True

User manager enable/disable

umGroups

Optional

String

 

User manager group. if not specified will use all user(1) created at the time of installation

umPassword

Oprional

String

 

Set passwords for user management. Its mandatory to set password if umEnable is set to true.

extPassword

Optional

String

 

Set a secret/password for extension.

maxContacts

Optional

Integer

1

Set max_contacts value for chan_pjsip extension.

 

 

Query Parameters 

 

 

API Request 

API Response 

Delete Extension

Delete an Extension from Freepbx/PBXACT

 

API Name  deleteExtension API.

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

extensionId

Mandatory

ID

 

Extension number

 

 

Query Parameters 

 

 

API Request 

 

API Response 

Create Range of Extensions

 

Create a Rage of extensions starting from given extension number.

API Name: createRangeofExtension API

API Parameters - 

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

startExtension

Mandatory

ID

 

First Extension number to create/configure.

name

Optional

String

 

The caller id name which we want to append along with the extension number.

channelName

Optional

String

 

Channel name in case if using DAHDI

tech

Optional

String

PJSIP

SIP Technology device driver. If we want to convert extension from one driver type to other for example chan_sip to pjsip conversion.

numberOfExtensions

Mandatory

ID

 

Number of extensions to create/configure.

outboundCid

Optional

String

 

This overrides the caller id when dialling out a trunk. This setting will override the common outbound caller id set in the trunk.

emergencyCid

Optional

String

 

This caller id will always be set when dialing out an outbound route flagged as emergency. The emergency CID overrides all other caller id settings.

email

Optional

String

 

User Email address to use for services such as voicemail, user management and fax etc.

vmEnable

Optional

Boolean

True

Voicemail enable / disable

vmPassword

Optional

String

 

Voicemail password. If not specify then user can access the voicemails without any password/pin.

umEnable

Optional

Boolean

True

User manager enable/disable

umGroups

Optional

String

 

User manager group. if not specified will use all user(1) created at the time of installation

 

 

Query Parameters 

 

 

API Request 

API Response 

Fetch a particular extension detail

API Name :  fetchExtension 

 

API Parameters: 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

id

Mandatory

ID

 

Extension Id to query

API Parameters to query

Query Parameters 

 

 

API Request 

API Response 

Fetch all Extensions Details 

API Name :  fetchAllExtensions 

 

API Parameters: none

 

API Parameters to query

Query Parameters 

API Request 

 

API Response 

 

Fetch all valid extensions 

API Name :  fetchAllValidExtensions 

 

API Parameters: none

 

API Parameters to query

Query Parameters 

API Request 

 

API Response 

Add Inbound Route

Creating inbound route into Freepbx/PBXact system.

 

API Name  addInboundRoute API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

extension

Optional

string

 

Define the expected DID Number if your trunk passes DID on incoming calls. if did not pass this field then show default value as `Any` in the user interface

cidnum

Optional

string

 

Define the CallerID Number to be matched on incoming calls, if did not pass this field then show default value as `Any` in the user interface

description

Optional

String

 

Provide a meaningful description of what this incoming route is

privacyman

Optional

Boolean

 

If no CallerID has been received, Privacy Manager will ask the caller to enter their phone number. If an user/extension has Call Screening enabled, 

the incoming caller will be prompted to say their name when the call reaches the user/extension.

alertinfo

Optional

String

 

ALERT_INFO can be used for distinctive ring with SIP devices.

ringing

Optional

Boolean

 

Some devices or providers require RINGING to be sent before ANSWER. You'll notice this happening if you can send calls directly to a phone, 

but if you send it to an IVR, it won't connect the call.

mohclass

Optional

String

 

Set the MoH class that will be used for calls that come in on this route. For example, choose a type appropriate for routes coming in from a 

country which may have announcements in their language.

grppre

Optional

String

 

CID name prefix

delay_answer

Optional

Integer

 

An optional delay to wait before processing this route. Setting this value will delay the channel from answering the call. 

This may be handy if external fax equipment or security systems are installed in parallel and you would like them to be able to seize the line.

pricid

Optional

Boolean

 

This effects CID ONLY routes where no DID is specified. If checked, calls with this CID will be routed to this route, even if there is a route to the DID that was called. 
Normal behavior is for the DID route to take the calls. If there is a specific DID/CID route for this CID, that route will still take the call when that DID is called

pmmaxretries

Optional

String

 

Number of attempts the caller has to enter a valid CallerID. Default value is 3

pmminlength

Optional

String

 

Minimum amount of digits CallerID needs to contain in order to be considered valid. Default value is 10

reversal

Optional

Boolean

 

On PRI channels the carrier will send a signal if the caller indicates a billing reversal. 
When checked this route will reject calls that indicate a billing reversal if supported

rvolume

Optional

String

 

Override the ringer volume. Note: This is only valid for Sangoma phones at this time. Default value is 0

fanswer

Optional

Boolean

 

Set to Yes to force the call to be answered at this time

destination

Mandatory

String

 

Destination for route. for example value like this, extension (100) :`from-did-direct,100,1`

 

 

Query Parameters 

 

 

API Request 

 

API Response 

Update Inbound Route

Updating inbound route into Freepbx/PBXact system.

 

API Name  updateInboundRoute API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

oldExtension

Optional

string

 

Old Extension. Used to change the current extension

oldCidnum

Optional

string

 

Old CID Num. Used to change the current cid number 

extension

Mandatory

string

 

Define the expected DID Number if your trunk passes DID on incoming calls.

cidnum

Mandatory

string

 

Define the CallerID Number to be matched on incoming calls. Can only be numbers, A-D, * and #. DID may also start with a +. Patterns must begin with an _ DID may also start with a +.

description

Optional

String

 

Provide a meaningful description of what this incoming route is

privacyman

Optional

Boolean

 

If no CallerID has been received, Privacy Manager will ask the caller to enter their phone number. If an user/extension has Call Screening enabled, 

the incoming caller will be prompted to say their name when the call reaches the user/extension.

alertinfo

Optional

String

 

ALERT_INFO can be used for distinctive ring with SIP devices.

ringing

Optional

Boolean

 

Some devices or providers require RINGING to be sent before ANSWER. You'll notice this happening if you can send calls directly to a phone, 

but if you send it to an IVR, it won't connect the call.

mohclass

Optional

String

 

Set the MoH class that will be used for calls that come in on this route. For example, choose a type appropriate for routes coming in from a 

country which may have announcements in their language.

grppre

Optional

String

 

CID name prefix

delay_answer

Optional

Integer

 

An optional delay to wait before processing this route. Setting this value will delay the channel from answering the call. 

This may be handy if external fax equipment or security systems are installed in parallel and you would like them to be able to seize the line.

pricid

Optional

Boolean

 

This effects CID ONLY routes where no DID is specified. If checked, calls with this CID will be routed to this route, even if there is a route to the DID that was called. 
Normal behavior is for the DID route to take the calls. If there is a specific DID/CID route for this CID, that route will still take the call when that DID is called

pmmaxretries

Optional

String

 

Number of attempts the caller has to enter a valid CallerID. Default value is 3

pmminlength

Optional

String

 

Minimum amount of digits CallerID needs to contain in order to be considered valid. Default value is 10

reversal

Optional

Boolean

 

On PRI channels the carrier will send a signal if the caller indicates a billing reversal. 
When checked this route will reject calls that indicate a billing reversal if supported

rvolume

Optional

String

 

Override the ringer volume. Note: This is only valid for Sangoma phones at this time. Default value is 0

fanswer

Optional

Boolean

 

Set to Yes to force the call to be answered at this time

destination

Mandatory

String

 

Destination for route

 

 

Query Parameters 

 

 

API Request 

 

API Response 

Remove Inbound Route

Remove inbound route from Freepbx/PBXact system.

 

API Name  removeInboundRoute API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

id

Mandatory

string

 

Inbound Route Id

 

 

Query Parameters 

 

 

API Request 

 

API Response 

 

 

Fetch All Inbound Routes

API Name :  allInboundRoutes

 

API Parameters to query

Query Parameters 

 

 

API Request 

API Response 

 

Fetch Inbound Route

API Name :  inboundRoute

 

API Parameters to query

Query Parameters 

 

 

API Request 

API Response 

Create Core Device

Creating an core device into Freepbx/PBXact system.

 

API Name  addCoreDevice API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

id

Mandatory

ID

 

Give your device a unique integer ID. The device will use this ID to authenticate to the system.

tech

Mandatory

String

pjsip

Technology driver type

dial

Mandatory

String

 

How to dial this device, this should not be changed unless you know what you are doing.

devicetype

Mandatory

String

 

Devices can be fixed or adhoc. Fixed devices are always associated to the same extension/user. Adhoc devices can be logged into and logged out of by users.

description

Optional

String

 

The CallerID name for this device will be set to this description until it is logged into.

user

Optional

String

 

Fixed devices will always mapped to this user. Adhoc devices will be mapped to this user by default.

emergency_cid

Optional

String

 

This CallerID will always be set when dialing out an Outbound Route flagged as Emergency. The Emergency CID overrides all other CallerID settings.

 

 

Query Parameters 

 

 

API Request 

 

API Response 

Update Core Device

Updating an core device into Freepbx/PBXact system.

 

API Name  updateCoreDevice API.

 

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

id

Mandatory

ID

 

Give your device a unique integer ID. The device will use this ID to authenticate to the system.

tech

Mandatory

String

pjsip

Technology driver type

dial

Mandatory

String

 

How to dial this device, this should not be changed unless you know what you are doing.

devicetype

Mandatory

String

 

Devices can be fixed or adhoc. Fixed devices are always associated to the same extension/user. Adhoc devices can be logged into and logged out of by users.

description

Optional

String

 

The CallerID name for this device will be set to this description until it is logged into.

user

Optional

String

 

Fixed devices will always mapped to this user. Adhoc devices will be mapped to this user by default.

emergency_cid

Optional

String

 

This CallerID will always be set when dialing out an Outbound Route flagged as Emergency. The Emergency CID overrides all other CallerID settings.

 

 

Query Parameters 

 

 

API Request 

 

API Response 

Fetch a particular core device details

API Name :  fetchCoreDevice

 

API Parameters: 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

device_id

Mandatory

ID

 

Device Id to query

API Parameters to query

Query Parameters 

 

 

API Request 

API Response 

Fetch all Core Device Details 

API Name :  fetchAllCoreDevices

 

API Parameters: none

 

API Parameters to query

Query Parameters 

API Request 

 

API Response 

Delete Core Device

Delete an Core Device from Freepbx/PBXACT

 

API Name  deleteCoreDevice API.

API Parameters -

 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

id

Mandatory

ID

 

Device number

 

 

Query Parameters 

 

 

API Request 

API Response 

Update Advance Setting's

 

API Name  updateAdvanceSettings API.

API Parameters -

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

keyword

Mandatory

Enum

 

Keyword of the settings which needs to updated

value

Mandatory

string

 

Value of the settings

 

 

Query Parameters 

 

 

API Request 

API Response 

Fetch a particular advance settings details

API Name :  fetchAdvanceSetting

 

API Parameters: 

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

keyword

Mandatory

String

 

Keyword of the settings which needs to be fetched

API Parameters to query

Query Parameters 

 

 

API Request 

API Response 

Fetch all Advance Settings Details 

API Name :  fetchAllAdvanceSettings

API Parameters: none

API Parameters to query

Query Parameters 

API Request 

 

API Response 

Return to Documentation Home I Return to Sangoma Support