Page tree
Skip to end of metadata
Go to start of metadata


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 -


NameRequiredTypeDefaultDescription

extensionId

MandatoryID
Unique string to specify the extension number.
nameMandatorystring
Display name
techOptionalStringpjsip

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

Accepted values:  "sip" or "pjsip".

channelName

OptionalString
Channel name in case if using DAHDI
callerIDOptionalString
The CallerID name for calls from this user will be set to this name. Recommended to use "name" not the number.
outboundCIDOptionalString
This overrides the caller id when dialling out a trunk. This setting will override the common outbound caller id set in the trunk.
emergencyCIDOptionalString
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.
emailMandatoryString
User Email address to use for services such as voicemail, user management and fax etc.
vmEnableOptionalBooleanTrueVoicemail enable / disable
vmPasswordOptionalString
Voicemail password. If not specify then user can access the voicemails without any password/pin.
umEnableOptionalBooleanTrueUser manager enable/disable. If enabled mandatory to set umPassword

umGroups

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

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

maxContactsOptionalInteger1Set max_contacts value for chan_pjsip extension.


Query Parameter 

Query Parameters
 status
 message


API Example -

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 -


NameRequiredTypeDefaultDescription

extensionId

MandatoryID
Unique string to specify the extension number.
nameMandatorystring
Display name
techOptionalString

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

Accepted values:  "sip" or "pjsip".

channelName

OptionalString
Channel name in case if using DAHDI
callerIDOptionalString
The Caller ID name for calls from this user will be set to this name. Recommended to use "name" not the number.
outboundCIDOptionalString
This overrides the caller id when dialing out a trunk. This setting will override the common outbound caller id set in the trunk.
emergencyCIDOptionalString
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.
emailOptionalString
User Email address to use for services such as voicemail, user management and fax etc.
vmEnableOptionalBooleanTrueVoicemail enable / disable. If enabled mandatory to set umPassword.
vmPasswordOptionalString
Voicemail password. If not specify then user can access the voicemails without any password/pin.
umEnableOptionalBooleanTrueUser manager enable/disable

umGroups

OptionalString
User manager group. if not specified will use all user(1) created at the time of installation
umPasswordOprionalString
Set passwords for user management. Its mandatory to set password if umEnable is set to true.
extPasswordOptionalString
Set a secret/password for extension.
maxContactsOptionalInteger1Set max_contacts value for chan_pjsip extension.


Query Parameter 

Query Parameters
 status
 message
 clientMutationId

API Example - 


API Request
GQLAPI: /admin/api/api/gql

Parameters: 

  mutation {
	updateExtension(
		input: {
			extensionId: 9090090111
			name: "api test"
			tech: "pjsip"
			channelName: "APi Test2"
			outboundCid: "12345678901"
			email: "xyzabc@gmailcom"
			umGroups: "1"
			umEnable: true
			umPassword: "password"
			vmPassword: "password"
			vmEnable: true
			callerID: "234234324"
			emergencyCid: "1221333331"
			clientMutationId: "test1231"
			extPassword: "secret"
            maxContacts: "4"
		}
	  ) {
			status
   			message
    		clientMutationId
	   }
}
API Response
{
  "data": {
    "updateExtension": {
      "status": true,
      "message": "Extension has been updated",
      "clientMutationId": "test1231"
    }
  }
}

Delete Extension

Delete an Extension from Freepbx/PBXACT


API Name  deleteExtension API.

API Parameters -


NameRequiredTypeDefaultDescription

extensionId

MandatoryID
Extension number


Query Parameter 

Query Parameters
 status
 message


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

mutation {
	deleteExtension(
		input: { extensionId: 9090090115 }
	) {
		status
		message
	}
}


API Response
{
  "data": {
    "deleteExtension": {
      "status": true,
      "message": "Extension has been deleted"
    }
  }
}

Create Range of Extensions


Create a Rage of extensions starting from given extension number.

API Name: createRangeofExtension API

API Parameters - 


NameRequiredTypeDefaultDescription

startExtension

MandatoryID
First Extension number to create/configure.
nameOptionalString

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

channelName

OptionalString
Channel name in case if using DAHDI
techOptionalStringPJSIPSIP Technology device driver. If we want to convert extension from one driver type to other for example chan_sip to pjsip conversion.
numberOfExtensionsMandatoryID
Number of extensions to create/configure.
outboundCidOptionalString
This overrides the caller id when dialling out a trunk. This setting will override the common outbound caller id set in the trunk.
emergencyCidOptionalString
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.
emailOptionalString
User Email address to use for services such as voicemail, user management and fax etc.
vmEnableOptionalBooleanTrueVoicemail enable / disable
vmPasswordOptionalString
Voicemail password. If not specify then user can access the voicemails without any password/pin.
umEnableOptionalBooleanTrueUser manager enable/disable

umGroups

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


Query Parameter 

Query Parameters
 status
 message


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

mutation {
	createRangeofExtension(
		input: {
			startExtension: 110
			numberOfExtensions: 2
			tech: "pjsip"
			channelName: "pjsip"
			name: "APi Test2"
			outboundCid: "12345678901"
			email: "xyzabc@gmailcom"
			umEnable: true
			umGroups: "1"
			vmEnable: true
			vmPassword: "123451"
			emergencyCid: "1221333331"
			clientMutationId: "test1231"
		}
	) {
    message
		status
	}
}

API Response
{
  "data": {
    "createRangeofExtension": {
      "message": "Extension's has been created Successfully",
      "status": "true"
    }
  }
}

Fetch a particular extension detail

API Name :  fetchExtension 


API Parameters: 

NameRequiredTypeDefaultDescription

id

MandatoryID
Extension Id to query

API Parameters to query

Query Parameters
	status
    message
    id
    extensionId
    user {
      name
      outboundCid
      voicemail
      ringtimer
      noanswer
      noanswerDestination
      noanswerCid
      busyCid
      sipname
	  password
	  extPassword
    }
    coreDevice {
      deviceId
      dial
      devicetype
      description
      emergencyCid
	  tech
      callerId
      sipdriver
      user {
        name
        outboundCid
        voicemail
        ringtimer
        sipname
    }
  }


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

{
  fetchExtension(extensionId: "9090090110") {
    status
    message
    id
    extensionId
    user {
      name
      outboundCid
      voicemail
      ringtimer
      noanswer
      noanswerDestination
      noanswerCid
      busyCid
      sipname
	  password
	  extPassword
    }
    coreDevice {
      deviceId
      dial
      devicetype
      description
      emergencyCid
	 
     }
    }
  }     
API Response
{
  "data": {
    "fetchExtension": {
      "status": true,
      "message": "Extension found successfully",
      "id": "ZXh0ZW5zaW9uOjkwOTAwOTAxMTA=",
      "extensionId": "9090090110",
      "user": {
        "name": "APi Test2",
        "outboundCid": "12345678901",
        "voicemail": "default",
        "ringtimer": 0,
        "noanswer": "",
        "noanswerDestination": "",
        "noanswerCid": "",
        "busyCid": "",
        "sipname": "",
		"password" : "password",
	    "extPassword": "ecc6de2001ceb217a04d5d9ac90f3e1123444c"
      },
      "coreDevice": {
        "deviceId": "9090090110",
        "dial": "PJSIP/9090090110",
        "devicetype": "fixed",
        "description": "APi Test2",
        "emergencyCid": "",
      }
    }
  }
}     

Fetch all Extensions Details 

API Name :  fetchAllExtensions 


API Parameters: none


API Parameters to query

Query Parameters
status
message
totalCount
extension {
   id
   extensionId
   user {
     name
     password
     outboundCid
     ringtimer
     noanswer
     sipname
	 password
     extPassword
    }
 	coreDevice {
   		deviceId
   		dial
   		devicetype
   		description
   		emergencyCid
		tech
      	callerId
      	sipdriver
   }
}
API Request
GQLAPI: /admin/api/api/gql

Parameters: 

{
    fetchAllExtensions {
      	status
      	message
        totalCount
        extension {
            id
            extensionId
            user {
              name
              password
              outboundCid
              ringtimer
              noanswer
              sipname
			  password
              extPassword
            }
   			  coreDevice {
   			  deviceId
   			  dial
   			  devicetype
   			  description
   			  emergencyCid
   			}
        }
    }
}

API Example: 

API Response
{
  "data": {
    "fetchAllExtensions": {
      "status": true,
      "message": "Extension's found successfully",
      "totalCount": 4,
      "extension": [
        {
          "id": "ZXh0ZW5zaW9uOg==",
          "extensionId": "100",
          "user": {
            "name": "100",
            "password": "",
            "outboundCid": "",
            "ringtimer": 0,
            "noanswer": "",
            "sipname": "",
			"password" : "password",
	        "extPassword": "ecc6de2001ceb217a04d5d9ac90f3e1123444c"
          },
          "coreDevice": {
            "deviceId": "100",
            "dial": "PJSIP/100",
            "devicetype": "fixed",
            "description": "100",
            "emergencyCid": ""
          }
        },
        {
          "id": "ZXh0ZW5zaW9uOg==",
          "extensionId": "101",
          "user": {
            "name": "101",
            "password": "",
            "outboundCid": "",
            "ringtimer": 0,
            "noanswer": "",
            "sipname": "",
			"password": "password",
	        "extPassword": "ecc6de2001ceb217a04d5d9ac90f3e1123444c"
          },
          "coreDevice": {
            "deviceId": "101",
            "dial": "PJSIP/101",
            "devicetype": "fixed",
            "description": "101",
            "emergencyCid": ""
          }
        }]
  }
}


Fetch all valid extensions 

API Name :  fetchAllValidExtensions 


API Parameters: none


API Parameters to query

Query Parameters
status
message
count
extension {
   id
   extensionId
   user {
     name
     password
     outboundCid
     ringtimer
     noanswer
     sipname
	 password
     extPassword
    }
 	coreDevice {
   		deviceId
   		dial
   		devicetype
   		description
   		emergencyCid
		tech
      	callerId
      	sipdriver
   }
}
API Request
GQLAPI: /admin/api/api/gql

Parameters: 

{
    fetchAllValidExtensions {
      	status
      	message
        count
        extension {
            id
            extensionId
            user {
              name
              password
              outboundCid
              ringtimer
              noanswer
              sipname
			  password
              extPassword
            }
   			  coreDevice {
   			  deviceId
   			  dial
   			  devicetype
   			  description
   			  emergencyCid
   			}
        }
    }
}

API Example: 

API Response
{
  "data": {
    "fetchAllValidExtensions": {
      "status": true,
      "message": "Valid core extensions",
      "count": 2,
      "extension": [
        {
          "id": "ZXh0ZW5zaW9uOg==",
          "extensionId": "100",
          "user": {
            "name": "100",
            "password": "",
            "outboundCid": "",
            "ringtimer": 0,
            "noanswer": "",
            "sipname": "",
			"password" : "password",
	        "extPassword": "ecc6de2001ceb217a04d5d9ac90f3e1123444c"
          },
          "coreDevice": {
            "deviceId": "100",
            "dial": "PJSIP/100",
            "devicetype": "fixed",
            "description": "100",
            "emergencyCid": ""
          }
        },
        {
          "id": "ZXh0ZW5zaW9uOg==",
          "extensionId": "101",
          "user": {
            "name": "101",
            "password": "",
            "outboundCid": "",
            "ringtimer": 0,
            "noanswer": "",
            "sipname": "",
			"password": "password",
	        "extPassword": "ecc6de2001ceb217a04d5d9ac90f3e1123444c"
          },
          "coreDevice": {
            "deviceId": "101",
            "dial": "PJSIP/101",
            "devicetype": "fixed",
            "description": "101",
            "emergencyCid": ""
          }
        }]
  }
}

Add Inbound Route

Creating inbound route into Freepbx/PBXact system.


API Name  addInboundRoute API.


API Parameters -


NameRequiredTypeDefaultDescription

extension

Optionalstring

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

Optionalstring

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

OptionalString

Provide a meaningful description of what this incoming route is

privacyman

OptionalBoolean

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

OptionalString

ALERT_INFO can be used for distinctive ring with SIP devices.

ringing

OptionalBoolean

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

OptionalString

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

OptionalString

CID name prefix

delay_answer

OptionalInteger

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

OptionalBoolean

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

pmmaxretriesOptionalString
Number of attempts the caller has to enter a valid CallerID. Default value is 3
pmminlengthOptionalString
Minimum amount of digits CallerID needs to contain in order to be considered valid. Default value is 10
reversalOptionalBoolean

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

rvolumeOptionalString
Override the ringer volume. Note: This is only valid for Sangoma phones at this time. Default value is 0
fanswerOptionalBoolean
Set to Yes to force the call to be answered at this time
destinationMandatoryString
Destination for route. for example value like this, extension (100) :`from-did-direct,100,1`


Query Parameter 

Query Parameters
 inboundRoute {
			    id
			  }
 status
 message


API Example -

API Request
1. Api to add inbound route

GQLAPI:  /admin/api/api/gql

parameters:

mutation {
    addInboundRoute(input: { 
    	  extension:"71667"
      	  cidnum:"1232abc"
          description:"Lorem Ipsum"
          privacyman:false
          alertinfo:"Lorem Ipsum"
          ringing:true
          mohclass:"Lorem Ipsum"
          grppre:"ABC"
          delay_answer:12
          pricid:false
          pmmaxretries:"123"
          pmminlength:"12"
          reversal:true
          rvolume:"12"
          fanswer:true
          destination:"1233"
    }) {
        inboundRoute {
          id
        }
		status
		message
    }
}


API Response
{
  "data": {
    "addInboundRoute": {
      "inboundRoute": {
        "id": "71667/1232abc"
      }
	  "status": true,
      "message": "Inbound Route created successfully"
    }
  }
}

Update Inbound Route

Updating inbound route into Freepbx/PBXact system.


API Name  updateInboundRoute API.


API Parameters -


NameRequiredTypeDefaultDescription
oldExtensionOptionalstring
Old Extension. Used to change the current extension
oldCidnumOptionalstring
Old CID Num. Used to change the current cid number 

extension

Mandatorystring

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

cidnum

Mandatorystring

Define the CallerID Number to be matched on incoming calls

description

OptionalString

Provide a meaningful description of what this incoming route is

privacyman

OptionalBoolean

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

OptionalString

ALERT_INFO can be used for distinctive ring with SIP devices.

ringing

OptionalBoolean

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

OptionalString

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

OptionalString

CID name prefix

delay_answer

OptionalInteger

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

OptionalBoolean

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

pmmaxretriesOptionalString
Number of attempts the caller has to enter a valid CallerID. Default value is 3
pmminlengthOptionalString
Minimum amount of digits CallerID needs to contain in order to be considered valid. Default value is 10
reversalOptionalBoolean

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

rvolumeOptionalString
Override the ringer volume. Note: This is only valid for Sangoma phones at this time. Default value is 0
fanswerOptionalBoolean
Set to Yes to force the call to be answered at this time
destinationMandatoryString
Destination for route


Query Parameter 

Query Parameters
 inboundRoute {
			    id
			  }
 status
 message


API Example -

API Request
1. Api to update inbound route

GQLAPI:  /admin/api/api/gql

parameters:
mutation {
    updateInboundRoute(input: { 
          oldExtension:"71667"
          oldCidnum:"1232lorem"
    	  extension:"9999"
      	  cidnum:"9999Lorem"
          description:"Lorem Ipsum"
          privacyman:false
          alertinfo:"Lorem Ipsum"
          ringing:true
          mohclass:"Lorem Ipsum"
          grppre:"ABC"
          delay_answer:12
          pricid:false
          pmmaxretries:"123"
          pmminlength:"12"
          reversal:true
          rvolume:"12"
          fanswer:true
          destination:"1233"
    }) {
        inboundRoute {
          id
        }
		status
        message
    }
}



API Response
{
  "data": {
    "updateInboundRoute": {
      "inboundRoute": {
        "id": "71667/1232lorem"
      }
	  "status": true,
      "message": "Inbound Route updated successfully"
    }
  }
}

Remove Inbound Route

Remove inbound route from Freepbx/PBXact system.


API Name  removeInboundRoute API.


API Parameters -


NameRequiredTypeDefaultDescription

id

Mandatorystring

Inbound Route Id


Query Parameter 

Query Parameters
status
message
deletedId


API Example -

API Request
1. Api to remove inbound route

GQLAPI:  /admin/api/api/gql

parameters:

mutation {
    removeInboundRoute(input: { 
    	id:"71667/1232lorem"
    }) {
        status
        message
        deletedId
    }
}



API Response
{
  "data": {
    "removeInboundRoute": {
      "status": true,
      "message": "Inbound Route deleted successfully",
      "deletedId": "71667/1232lorem"
    }
  }
}


Fetch All Inbound Routes

API Name :  allInboundRoutes


API Parameters to query

Query Parameters
	inboundRoutes {
  	        id
  	        extension
			cidnum
			description
			privacyman
			alertinfo
			ringing
			mohclass
			grppre
			delay_answer
			pricid
			pmmaxretries
			pmminlength
			reversal
			rvolume
			fanswer
			destinationConnection
 		 }


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

{
  allInboundRoutes{
  	inboundRoutes {
  	        id
  	        extension
			cidnum
			description
			privacyman
			alertinfo
			ringing
			mohclass
			grppre
			delay_answer
			pricid
			pmmaxretries
			pmminlength
			reversal
			rvolume
			fanswer
			destinationConnection
 		 }
	}
}    
API Response
{
  "data": {
    "allInboundRoutes": {
      "inboundRoutes": [
        {
          "id": "71667/1232dsds",
          "extension": "71667",
          "cidnum": "1232dsds",
          "description": "Lorem Ipsum",
          "privacyman": false,
          "alertinfo": "Lorem Ipsum",
          "ringing": true,
          "mohclass": "Lorem Ipsum",
          "grppre": "ABC",
          "delay_answer": 12,
          "pricid": false,
          "pmmaxretries": 12,
          "pmminlength": 12,
          "reversal": false,
          "rvolume": 12,
          "fanswer": false,
		  "destinationConnection": "Extensions: 4001 Extension 4001"
        }
      ]
    }
  }
}    


Fetch Inbound Route

API Name :  inboundRoute


API Parameters to query

Query Parameters
 id
 extension
 cidnum
 description
 privacyman
 alertinfo
 ringing
 mohclass
 grppre
 delay_answer
 pricid
 pmmaxretries
 pmminlength
 reversal
 rvolume
 fanswer
 destinationConnection


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 


query {
    inboundRoute( id: "71667/1232dsds") {
          id
          extension
          cidnum
          description
          privacyman
          alertinfo
          ringing
          mohclass
          grppre
          delay_answer
          pricid
          pmmaxretries
          pmminlength
          reversal
          rvolume
          fanswer
          destinationConnection
    }
}  
API Response
{
  "data": {
    "inboundRoute": {
      "id": "71667/1232dsds",
      "extension": "71667",
      "cidnum": "1232dsds",
      "description": "Lorem Ipsum",
      "privacyman": false,
      "alertinfo": "Lorem Ipsum",
      "ringing": true,
      "mohclass": "Lorem Ipsum",
      "grppre": "ABC",
      "delay_answer": 12,
      "pricid": false,
      "pmmaxretries": 12,
      "pmminlength": 12,
      "reversal": false,
      "rvolume": 12,
      "fanswer": false,
	  "destinationConnection": "Extensions: 4001 Extension 4001"
    }
  }
}

Create Core Device

Creating an core device into Freepbx/PBXact system.


API Name  addCoreDevice API.


API Parameters -


NameRequiredTypeDefaultDescription

id

MandatoryID

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

techMandatoryStringpjsip

Technology driver type

dial

MandatoryString

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

devicetypeMandatoryString

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.

descriptionOptionalString

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

userOptionalString

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

emergency_cidOptionalString

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


Query Parameter 

Query Parameters
 status
 message


API Example -

API Request
1. Api to add Core Device

GQLAPI:  /admin/api/api/gql

parameters:

mutation {
	addCoreDevice(input: {
		id:111223345
		tech:"pjsip"
		description:"Lorem Ipsum"
		dial:"222333"
		devicetype:"Lorem"
		user:"222333"
		emergency_cid:"222333"
	}){
		message
		status
	}
}



API Response
{
  "data": {
    "addCoreDevice": {
      "message": "Core device has been created successfully",
      "status": true
    }
  }
}

Update Core Device

Updating an core device into Freepbx/PBXact system.


API Name  updateCoreDevice API.


API Parameters -


NameRequiredTypeDefaultDescription

id

MandatoryID

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

techMandatoryStringpjsip

Technology driver type

dial

MandatoryString

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

devicetypeMandatoryString

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.

descriptionOptionalString

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

userOptionalString

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

emergency_cidOptionalString

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


Query Parameter 

Query Parameters
 status
 message


API Example -

API Request
1. Api to update Core Device

GQLAPI:  /admin/api/api/gql

parameters:

mutation {
	updateCoreDevice(input: {
		id:111223345
		tech:"pjsip"
		description:"Lorem Ipsum Updated"
		dial:"222333"
		devicetype:"Lorem"
		user:"222333"
		emergency_cid:"222333"
	}){
		message
		status
	}
}



API Response
{
  "data": {
    "updateCoreDevice": {
      "message": "Core device has been updated successfully",
      "status": true
    }
  }
}

Fetch a particular core device details

API Name :  fetchCoreDevice


API Parameters: 

NameRequiredTypeDefaultDescription

device_id

MandatoryID
Device Id to query

API Parameters to query

Query Parameters
deviceId
tech
dial
devicetype
user {
  id
}
description
emergencyCid


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

{
  fetchCoreDevice(device_id: "111223345") {
      deviceId
      tech
      dial
      devicetype
      user {
        id
      }
      description
      emergencyCid
  } 
}   
API Response
{
  "data": {
    "fetchCoreDevice": {
      "deviceId": "111223345",
      "tech": "pjsip",
      "dial": "PJSIP/111223345",
      "devicetype": "fixed",
      "user": {
        "id": "Y29yZXVzZXI6"
      },
      "description": "Lorem Ipsum updated",
      "emergencyCid": ""
    }
  }
} 

Fetch all Core Device Details 

API Name :  fetchAllCoreDevices


API Parameters: none


API Parameters to query

Query Parameters
coreDevice{
	deviceId
	tech
	callerId
	sipdriver
	dial
	devicetype
	user {
	  id
	}
	description
	emergencyCid
}
totalCount
status
message
API Request
GQLAPI: /admin/api/api/gql

Parameters: 

{
    fetchAllCoreDevices {
        coreDevice{
          deviceId
          tech
          dial
          devicetype
          user {
            id
          }
          description
          emergencyCid
        }
        totalCount
        status
        message
    }
}

API Example: 

API Response
{
    "data": {
        "fetchAllCoreDevices": {
            "coreDevice": [
                {
                    "deviceId": "10007",
                    "tech": "pjsip",
                    "dial": "PJSIP/10007",
                    "devicetype": "fixed",
                    "user": {
                        "id": "Y29yZXVzZXI6MTAwMDc="
                    },
                    "description": "Test",
                    "emergencyCid": ""
                },
                {
                    "deviceId": "1002",
                    "tech": "pjsip",
                    "dial": "PJSIP/1002",
                    "devicetype": "fixed",
                    "user": {
                        "id": "Y29yZXVzZXI6"
                    },
                    "description": "Testing-ABC",
                    "emergencyCid": ""
                }
            ],
            "totalCount": 134,
            "status": true,
            "message": "Core Device's found successfully"
        }
    }
}

Delete Core Device

Delete an Core Device from Freepbx/PBXACT


API Name  deleteCoreDevice API.

API Parameters -


NameRequiredTypeDefaultDescription

id

MandatoryID
Device number


Query Parameter 

Query Parameters
 deletedId
 status
 message


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

mutation {
      deleteCoreDevice(input: {
          id:"1114334"
      }){
          deletedId
          message
          status
      }
  }
API Response
{
  "data": {
    "deleteCoreDevice": {
      "deletedId": "1114334",
      "message": "Core device has been deleted successfully",
      "status": true
    }
  }
}

Update Advance Setting's


API Name  updateAdvanceSettings API.

API Parameters -

NameRequiredTypeDefaultDescription

keyword

MandatoryEnum
Keyword of the settings which needs to updated
valueMandatorystring
Value of the settings


Query Parameter 

Query Parameters
 status
 message


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 

mutation {
	updateAdvanceSettings(input: {
		keyword:AS_DISPLAY_FRIENDLY_NAME
		value:"0"
	}){
		message
		status
	}
}
API Response
{
    "data": {
        "updateAdvanceSettings": {
            "message": "Setting's updated successfully",
            "status": true
        }
    }
}

Fetch a particular advance settings details

API Name :  fetchAdvanceSetting


API Parameters: 

NameRequiredTypeDefaultDescription

keyword

MandatoryString
Keyword of the settings which needs to be fetched

API Parameters to query

Query Parameters
keyword
value
name
category
description
status
message


API Example - 

API Request
GQLAPI: /admin/api/api/gql

Parameters: 


query{
  fetchAdvanceSetting(keyword:"HTTPENABLED") {
	keyword
	value
	name
	category
	description
	status
	message
  }
}  
API Response
{
  "data": {
    "fetchAdvanceSetting": {
      "keyword": "HTTPENABLED",
      "value": "0",
      "name": "Enable the mini-HTTP Server",
      "category": "Asterisk Builtin mini-HTTP server",
      "description": "Whether the Asterisk HTTP interface is enabled or not. This is for Asterisk, it is not directly related for FreePBX usage and the value of this setting is irrelevant for accessing core FreePBX settings. Default is no.",
      "status": true,
      "message": "Setting's found successfully"
    }
  }
}    

Fetch all Advance Settings Details 

API Name :  fetchAllAdvanceSettings

API Parameters: none

API Parameters to query

Query Parameters
settings{
   keyword
   value
   name
   category
   description
}
status
message
API Request
GQLAPI: /admin/api/api/gql

Parameters: 

query{
  fetchAllSettings {
      settings{
        keyword
        value
        name
        category
        description
      }
      status
      message
  }
}

API Example: 

API Response
{
  "data": {
    "fetchAllAdvanceSettings": {
      "settings": [
        {
          "keyword": "AS_DISPLAY_FRIENDLY_NAME",
          "value": "0",
          "name": "Display Friendly Name",
          "category": "Advanced Settings Details",
          "description": "Normally the friendly names will be displayed on this page and the internal freepbx_conf configuration names are shown in the tooltip. If you prefer to view the configuration variables, and the friendly name in the tooltip, set this to false.."
        },
        {
          "keyword": "AS_DISPLAY_READONLY_SETTINGS",
          "value": "0",
          "name": "Display Readonly Settings",
          "category": "Advanced Settings Details",
          "description": "This will display settings that are readonly. These settings are often internally used settings that are not of interest to most users. Since they are readonly they can only be viewed."
        },
        {
          "keyword": "AS_OVERRIDE_READONLY",
          "value": "0",
          "name": "Override Readonly Settings",
          "category": "Advanced Settings Details",
          "description": "Setting this to true will allow you to override un-hidden readonly setting to change them. Settings that are readonly may be extremely volatile and have a high chance of breaking your system if you change them. Take extreme caution when electing to make such changes."
        }
      ],
      "status": true,
      "message": "Setting's found successfully"
    }
  }
}
  • No labels