Overview

This document outlines the API interface used for interacting with SolSwitch systems through outside applications. The functions available and the guidelines for using them are described below. The API functions use JSON for communication and follow the following guidelines:

The application provider will provide a delivery agent that can send JSON over HTTP as contenttype application/json.

For security reasons, the API requires either a system generated API key to be used or a specific IP address to be given permission to connect. For additional security, both measures can be enabled.

The JSON document must be posted to the API URL as the contents of the HTTP POST, i.e. the HTTP POST will deliver the document as content-type application/json and not as an embedded file inside an encoded form. This means that the delivery agent will need to access the HTTP POST content directly instead of using encoded form methods or tools for encoding name-value pairs.

Formatting

All API URLs will be formatted as follows, where 'solswitch' is the IP or domain of the desired system, and 'function' is the name of the function being called (as provided below): solswitch/api/function/

Call Functions

Add Header

Insert a custom header into an upcoming outbound call.

Add Header URL: solswitch/api/addheader/

The Request must contain the following attributes:

  • Key: The sender of the message. Numeric value of the long code or short code that will be sending.
  • srcnumber: The source number to apply the new custom header to. Optional if dstnumber is set. If call originating from an extension, srcnumber should be the extension number.
  • dstnumber: The destination number to apply the new custom header to. Optional if srcnumber is set.
  • header-name: The name of the custom header to be applied.
  • value: The value of the custom header.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/addheader HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "srcnumber": "123",
                    "header-name": "ExampleHeader",
                    "value": "ExampleValue"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": " Missing required field destination number or source number "
                  }
                
                

Hold Call

The Hold Call function is used to put an active call on hold.

Hold Call URL: solswitch/api/holdcall/

The Request must contain the following attributes:

  • Channel: Channel of an active call to be put on hold, as returned by 'List Active Calls'.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/holdcall HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 96
                  {
                    "Channel": "SIP/Example2-000003ee",
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                  "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Unknown Customer ID"
                  }
                
                

New Call

The New Call function is used to generate a call from a user's extension to a specified destination.

New Call URL: solswitch/api/newcall/

The Request must contain the following attributes:

  • Extension: The extension number of the user on the system. Extensions are numeric values, 3 to 5 digits in length.
  • Destination: The destination the call should be connected to. Destination is a numeric value.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Request may contain the following attributes:

CustomDVData:

An array containing kay value pairs for substitution when using a DigitValidation as the Extension attribute.

When processing replacements we use ${} to determine variable names. For example to replace a variable URL within the request you would use ${URL} to denote where to place that data and pass an array containing the key URL with some value.

CustomDVDigits:

An array containing special instruction for handling digits being pressed when using a DigitValidation as the Extension attribute. The digit is the index of the array with the value containing the instructions. All attribute values are passed through substitution for the CustomDVData array. Setting the URL attribute to "https://${URL}/api/" would replace ${URL} with whatever you set in the above array.

Attributes:

  • URL: URL to use in place of the set URL for the Digit Validation.
  • Method: POST or GET.
  • Auth: Type of authentication to use. For example "Header" authorization would expect AuthInfo to contain "type" and "credentials".
  • AuthInfo: Dependant on the Auth type above.
  • Response: A special response to send if the request to the URL was successful.
  • CustomData: An array containing data to be sent to the URL instead of the regular call data.
  • Headers: An array of headers to add to the request NoURL - Boolean value determining whether or not to try to call out to the URL of the DigitValidation.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • CallID: ID of the connected call (On OK return status).
  • Channel: Source channel of the connected call (On OK return status).
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/newcall HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 109
                  {
                    "Extension": "123",
                    "Destination": "17055551234",
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "CallID": "758923",
                    "Channel":
                    "SIP/Example2-000004fb"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Error with Key"
                  }
                
                

Outbound Fax

The Outbound Fax function is used to send a fax to a specified number.

Outbound Fax URL: solswitch/api/fax/

The Request may contain the following attributes:

  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • To: The fax number to send to. No '-'s allowed
  • From: The fax number to send from. No '-'s allowed. Must be set up as a FaxToEmail DID.
  • File: Location of the .pdf file to send. This file must be accessible from the SolSwitch.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • Status: The only thing we return with this is whether or not the fax was queued properly

Request:

                
                  POST /api/fax HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "To": "7055553482",
                    "From": "7055551234",
                    "File": "http://path.to.file/faxMe.pdf"
                  }
                
                

Response (SUCCESS)

                
                  {
                  "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": " You must upload a file to fax"
                  }
                
                

Transfer Call

The Transfer Call function is used to transfer a current active call to a new destination.

Transfer Call URL: solswitch/api/transfercall/

The Request must contain the following attributes:

  • Channel: Channel of the call to be transferred to a new destination, as returned by 'List Active Calls'.
  • Destination: The destination the call should be transferred to. Destination is a numeric value.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/transfercall HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Channel": "SIP/Example2-000003ee",
                    "Destination": "17055551234",
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "IP address not allowed"
                  }
                
                

Transmit DTMF

The Transmit DTMF function is used to send a DTMF tone to a specified channel.

Transmit DTMF URL: solswitch/api/dtmf/

The Request must contain the following attributes:

  • Tone: The DTMF tone to be transmitted, accepted values are: 0-9 * #.
  • Channel: Channel of an active call where the tones should be sent. This would be the channel of the desired recipient, as returned by the 'List Active Calls' function.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/dtmf HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 107
                  {
                    "Tone": "#1",
                    "Channel": "SIP/Example-000003ee",
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Unknown Channel"
                  }
                
                

Call Reporting

Agent Stats

The Agent Stats function returns all relevant information for Agent busy status

Agent Stats URL: solswitch/api/agentstats/

The Request may contain the following attributes:

  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • Extension: Optional. If provided will only return information related to given extension.
  • Date: Optional. If provided will only return information related to given date. If no date is provided, return will default to the current date. Format: YYYY-MM-DD
  • DateStart: Conditionally Optional. If provided, DateEnd is required. This will limit the returned data to be within DateStart and DateEnd. Format: YYYY-MM-DD
  • DateEnd: Conditionally Optional. If provided, DateStart is required. This will limit the returned data to be within DateStart and DateEnd. Format: YYYY-MM-DD

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document
  • Extension IDs: Details on the individual extensions (On OK return status). Attributes:
    • ActionIDs: Array of all actions performed by the extension.
  • ActionIDs: API key for connection to the system. Required field if an API key has been enabled. Attributes:
    • Action: The new status of the extension
    • DateTime The datetime this action was done
    • DateTimeUnix The unixtime the action was done
    • ReasonCode The reason code used to enable busy/paused status if one was required

Request:

                
                  POST /api/agentstats HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "Date": "2018-05-30"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "220": {
                      "978398": {
                        "Action": "In",
                        "DateTime": "2018-05-30 00:00:00",
                        "DateTimeUnix": 1527652800,
                        "ReasonCode": ""
                      },
                      "978400": {
                        "Action": "Paused",
                        "DateTime": "2018-05-30 11:28:35",
                        "DateTimeUnix": 1527694115,
                        "ReasonCode": "10"
                      },
                      "978401": {
                        "Action": "Out",
                        "DateTime": "2018-05-30 23:59:59",
                        "DateTimeUnix": 1527739199,
                        "ReasonCode": ""
                      }
                    }
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No matching end time"
                  }
                
                

Call Recording

The Call Recording function is used to retrieve the URL(s) for the audio file(s) of a recorded call. A single call could have multiple recordings if the call went to multiple places on the system (ex, if the call was transferred to a second extension).

Call Recording URL: solswitch/api/recording/

The Request must contain the following attributes:

  • CallID: Unique ID of the call to retrieve recordings for.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Status: Array of call recordings and relevant information. Attributes:
    • StartTime: Time that this portion of the call connected
    • EndTime: Time that this portion of the call ended
    • Duration: Duration of this portion of the call
    • SourceName: Name of the caller
    • SourceNumber: Extension or number of caller
    • SourceChannel: Channel of the source of the call
    • DestinationNumber: Extension or number the call was connected to
    • DestinationChannel: Channel of the destination of the call
    • DialedNumber: Actual number dialed for this portion of the call
    • URL: URL to download the MP3 file of the recording
    • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document

Request:

                
                  POST /api/recording HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 78
                  SolSwitch API Rev 3.1
                  {
                    "CallID": "62135",
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                    "Recording": [
                      {
                        "StartTime": "2018-01-20 14:00:00",
                        "EndTime": "2018-01-20 14:01:23",
                        "Duration": "00:01:23",
                        "SourceName": "Example Caller",
                        "SourceNumber": "7055551234",
                        "SourceChannel": "SIP/Example3-000006e1",
                        "DestinationNumber": "456",
                        "DestinationChannel": "SIP/Example2-000003ee",
                        "DialedNumber": "7052221234",
                        "URL": "solswitch/downloadfile.php?id=621351&sc=a7ebe5fa6b5c110d9be13d23fefaa256"
                      },
                      {
                        "StartTime": "2018-01-20 14:01:23",
                        "EndTime": "2018-01-20 14:14:35",
                        "Duration": "00:13:12",
                        "SourceName": "Example Caller",
                        "SourceNumber": "7055551234",
                        "SourceChannel": "SIP/Example3-000006e1",
                        "DestinationNumber": "654",
                        "DestinationChannel": "SIP/Example-000003f2",
                        "DialedNumber": "654",
                        "URL": "solswitch/downloadfile.php?id=721892&sc=c56afe7890d5c64b784cadeffe45acb45"
                      },
                    ]
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Unknown CallID"
                  }
                
                

Caller ID Request

The Caller ID Request function returns all relevant information about an ongoing call.

Caller ID Request URL: solswitch/api/calleridrequest/

The Request may contain the following attributes:

  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1
  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • Extension: Extension number of the person you'd like to get the Caller ID information from.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • DailedNumber: This is the DID the calling party dialed to begin the call.
  • IVROption: If the person calling came in through an IVR this will be the option selected. Otherwise it will be -1
  • CallerNumber: The is the caller ID number of the calling party.
  • CallerName: This is the caller ID name of the calling party. If no caller ID name was supplied this will be the same as the CallerNumber.

Request:

                
                  POST /api/calleridrequest HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "Extension": "220"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "DialedNumber": "7055551234",
                    "IVROption": "3",
                    SolSwitch API Rev 3.1
                    "CallerNumber": "7055554321",
                    "CallerName": "Test Caller"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Invalid extension number given"
                  }
                
                

CDR Export

The CDR Export function returns all relevant information about calls between 2 dates.

CDR Export URL: solswitch/api/cdrexport/

The Request may contain the following attributes:

  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • DateStart: This will limit the returned data to be within Date Start and Date End. Format: YYYY-MM-DD
  • DateEnd: This will limit the returned data to be within Date Start and Date End. Format: YYYY-MM-DD

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • CallID: This has an array of returned data sorted by CallID.
  • LegID: The ID of the call Leg.
  • StartTime: This is the time the call connected to the SolSwitch.
  • ConnectTime: This is the time the call was connected to a second party.
  • EndTime: This is the time the call was ended by either party.
  • SourceName: Caller ID name of the calling party.
  • SourceNumber: Caller ID number of the calling party.
  • DestinationName: Caller ID name of the called party
  • DestinationNumber: Caller ID number of the called party
  • Disposition: This is what happened during that leg of the call. It will show if a call was answered, transferred, etc...
  • DialedNumber: This is the number that was dialed to reach the called party
  • SourceType: See RouteTypes for ID values
  • DestinationType: See RouteTypes for ID values
  • CallCode: Call Reason Code if agent was required to enter a reason for the call.

Request:

                
                  POST /api/cdrexport HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "DateStart": "2018-05-15 00:00:00",
                    "DateEnd": "2018-05-15 23:59:59"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "669932": [{
                      "LegID": "669932",
                      "StartTime": "2018-05-15 11:07:45",
                      "ConnectTime": "",
                      "EndTime": "2018-05-15 11:07:47",
                      "SourceName": "Test Phone #1",
                      "SourceNumber": "220",
                      "DestinationName": "Test Phone #2",
                      "DestinationNumber": "290",
                      "Disposition": "NOANSWER",
                      "DialedNumber": "290",
                      "SourceType": "7",
                      "DestinationType": "7",
                      "CallCode": ""
                    },
                    {
                      "LegID": "669933",
                      "StartTime": "2018-05-15 11:31:42",
                      "ConnectTime": "2018-05-15 11:31:44",
                      "EndTime": "2018-05-15 11:31:51",
                      "SourceName": "Test Phone #1",
                      "SourceNumber": "7055551234",
                      "DestinationName": "Test Phone #2",
                      "DestinationNumber": "290",
                      "Disposition": "ANSWERED",
                      "DialedNumber": "7055553584",
                      "SourceType": "15",
                      "DestinationType": "7",
                      "CallCode": ""
                    }]
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No matching end time"
                  }
                
                

** note if a call has multiple legs it will show as an array of legs. Otherwise it will be a single object

List Active Calls

The List Active Calls function returns all relevant information of current active calls.

List Active Calls URL: solswitch/api/listactivecalls/

The Request may contain the following attributes:

  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • Calls: Details on the individual calls (On OK return status). Attributes:
    • CallID: The unique ID of the call.
    • SourceNumber: The phone number or extension of the source of the call.
    • SourceChannel: The call channel connected to the source of the call.
    • DestinationNumber: The phone number or extension of the destination of the call.
    • DestinationChannel: The call channel connected to the destination of the call.
    • Duration: Length of the call in format HH:MM:SS.

Request:

                
                  POST /api/listactivecalls HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    SolSwitch API Rev 3.1
                    "Calls": [
                      {
                        "CallID": "667890",
                        "SourceNumber": "7055551234",
                        "SourceChannel": "SIP/Example-000003f2",
                        "DestinationNumber": "123",
                        "DestinationChannel": "SIP/Example2-000003ee",
                        "Duration": "00:01:23"
                      },
                      {
                        "CallID": "667891",
                        "SourceNumber": "345",
                        "SourceChannel": "SIP/Example3-000006e1",
                        "DestinationNumber": "7055551234",
                        "DestinationChannel": "SIP/Example4-000004fe",
                        "Duration": "00:00:46"
                      },
                    ]
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "IP does not have access"
                  }
                
                

Live Queue Stats

Insert a custom header into an upcoming outbound-call

Add Header URL: solswitch/api/livequeuestat/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • queueID: ID of the Queue the function should run on, should be numeric value. Optional field, if not provided the system will default to All Queues.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Ext: Extension of the Queue.
  • Queue: Name of the Queue.
  • Calls: Current Calls of that queue.
  • Callback: Number of callers waiting to be called back.
  • Avail.Agnts: Available Agents for that queue.
  • Abandoned: Number of calls Abandoned.
  • WaitTime: Current smallest wait time.
  • EstimatedWaitTime: Average Wait time for that queue.
  • Voicemail: Current amount of voicemail
  • ServiceLevel: Service Level of the queue at that moment
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/livequeuestat HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Key": "FzeKKeEKSwXG2FW8jd",
                    "customer": "1",
                    "queueID": "7"
                  }
                
                

Response (SUCCESS)

                
                  [
                    {
                      "Ext": "222",
                      "Queue": "JVQueue",
                      "Calls": "0",
                      "Callback": "0",
                      "Avail.Agnts": "2",
                      "Answered": "0",
                      "Abandoned": "0",
                      "WaitTime": "00:00:00",
                      "EstimatedWaitTime": "00:00:07",
                      "Voicemail": "0",
                      "ServiceLevel": "0.0000"
                    },{
                      will repeat for every available/requested Queue
                    },{
                      "Status": "OK"
                    }
                  ]
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": " No access to customer number 1"
                  }
                
                

System Management

911 Info

List the current 911 information for each DID on the SolSwitch.

911 Info URL solswitch/api/911info/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Data: Array for 911 information.
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/911info HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                  "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "Data" : {
                    "custnum" : "12345",
                    "did" : "1234567894",
                    "streetnumber" : "850",
                    "streetname" : "Fake St",
                    "unit" : "2",
                    "city" : "Sudbury",
                    "province" : "ON",
                    "country" : "Canada",
                    "postalcode" : "P3B1Y4"
                  },
                  { Continues for every entry }

                
                

Response (FAIL)

                
                  {
                  "Status": "FAIL",
                  "Reason": "IP address not allowed"
                  }
                
                

Add DID

Add a new DID to the SolSwitch.

Transfer Call URL: solswitch/api/adddid/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • DID: The new DID to add.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/adddid HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "DID": "7051234567"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Invalid DID provided"
                  }
                
                

Create Customer

The Create Customer function will create a customer account on the SolSwitch using the supplied information and return the new customer ID.

Create Customer URL: solswitch/api/createcustomer/

The Request may contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • RouteGroupID: The ID of the default route group to be assigned.
  • TollPlanID: The ID of the toll plan to apply to this customer.
  • MaxSIPAccounts: The maximum number of SIP accounts to allow the customer to use.
  • MaxTrunks: The maximum number of trunks this customer can use at once.
  • CustomerNumber: The internal customer's number. To be used for toll billing if you need a specific customer number.
  • FirstName: First name of the customer.
  • LastName: Last name of the customer.
  • Company: Optional. The company the customer represents.
  • AddressStreetNumber: Optional. Address street number.
  • AddressStreetName: Optional. Address street name.
  • AddressUnit: Optional. Address unit number.
  • PostalCode: Optional. Postal code (L#L#L#)
  • City: Optional. City the company is located in.
  • Province: Optional. Province code (ON).
  • Country: Optional. Country of residence.
  • PhoneNumber: Optional. Phone number without any '-'s.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • CustomerID: This is a 0 or 1 boolean representation of the state.

Request:

                
                  POST /api/createcustomer HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "RouteGroupID": "7",
                    "TollPlanID": "2",
                    "MaxSIPAccounts": "2",
                    "MaxTrunks": "4",
                    "CustomerNumber": "123456789",
                    "FirstName": "Test",
                    "LastName": "Name"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "CustomerID": "127"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": " Missing required field FirstName"
                  }
                
                

Check Time Rule

Used to find the current status (Open or Closed) of a time rule on the system.

Check Time Rule URL: solswitch/api/checktimerule/

The Request may contain the following attributes:

  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The time rule's ID.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • TimeRuleStatus: This is a 0 or 1 boolean representation of the state.
  • TimeRuleText: This is the text form of the above (0 - Open, 1 - Closed).

Request:

                
                  POST /api/checktimerule HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "ID": "132"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "TimeRuleStatus": "0",
                    "TimeRuleText": "Open"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": " Time rule not found"
                  }
                
                

DID Report

Pull a list of DIDs on the system with their current customer and route information.

DID Report URL: solswitch/api/didreport/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • DID: DID number.
  • IRID: Internal Routing ID.
  • CustID: ID of the customer sending post request.
  • PrimaryRoute: Used for Load balancing. 0 is default in most cases, or 1 if priority routing is set up for that customer and server.

Request:

                
                  POST /api/didreport HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Key":"FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "0": {
                      "DID": "7058053584",
                      "IRID": "182",
                      "CustID": "1",
                      "PrimaryRoute": 1
                    },
                    { Continues for every entry },
                    "Status": "OK"
                  }

                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Error with Key"
                  }
                
                

Find Me Follow Me Details

Pass in a Find Me Follow Me ID to retrieve Name, Numbers, OverflowRouteID, OverflowRouteType, Recording, AutoAnswer, StepTime, and Extension linked to the ID.

Add Header URL: solswitch/api/findmefollowme/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: FindMeFollowMe ID to retrieve data for.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/findmefollowme/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "5"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "ID": "5",
                    "Name": "dave-test",
                    "Numbers": [
                      "1112223333",
                      "2223334444",
                      "3334445555"
                    ],
                    "OverflowRouteID": "148",
                    "OverflowRouteType":"12",
                    "Recording": "0",
                    "AutoAnswer": "0",
                    "StepTime": "25",
                    "Extension": "9991"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

Firewall Management Suite

/api/firewall/view

This endpoint will list the available firewall rules on the system. There will also be an optional ID value that will display information about just the requested firewall rule.

The Request may contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the specific firewall rule to view (Overrides the ViewType option below to Full).
  • ViewType: Can be set to Full or Partial to control how much data will be returned:
    • Full: Each listing will be provided with as much information as possible.
    • Partial: Each listing will be provided with and ID and Name.
    • Default: Partial.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Results: An array with each row containing the following:
  • ID: ID of the firewall rule. To be used with other endpoints.
  • Name: Name of the firewall rule.
  • Position: The order priority of the firewall rule. Lower numbered items will be checked before higher numbered ones.
  • RuleType: This will be Allow or Deny.
  • AddressType: This will be Address, Subnet or Country.
  • Address: If AddressType is Address or Subnet this will contain the IP address or IP subnet of the rule.
  • Country: If the AddressType is Country this will contain the country code of the selected country (Canada = CA, United Kingdom = UK, etc).
  • Web: This will be set to 1 if the rule's filtering is applied to web traffic.
  • SysAdmin: This will be set to 1 if the rule's filtering is applied to web traffic on SysAdmin accounts.
  • Provisioning: This will be set to 1 if the rule's filtering is applied to provisioning traffic.
  • SIP: This will be set to 1 if the rule's filtering is applied to SIP traffic.

Request:

                
                  POST /api/firewall/view/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "5"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "Results": [
                      {
                      "ID": "5",
                      "Name": "Test name"
                      }
                    ]
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/firewall/add/

This endpoint will add a new rule to the firewall in the given position, or at the end if no position is given.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • Name: Name of the firewall rule.
  • RuleType: This will be Allow or Deny.
  • AddressType: This will be Address, Subnet or Country.

The Request may contain the following attributes:

  • Position: The order priority of the firewall rule. This will shift all positions down so entering 3 for example will increment the current rules of priority 3 or more by 1. If omitted this will default to the highest possible position
  • Address: If AddressType is Address or Subnet this must contain the IP address or IP subnet of the rule [xxx.xxx.xxx.xxx for address and xxx.xxx.xxx.xxx/yy for subnet]
  • Country: If the AddressType is Country this must contain the country code of the selected country [Canada = CA, United Kingdom = UK, etc].
  • Web: Boolean value [0 - Disabled on web traffic, 1 - Enabled on web traffic]. Default 1
  • SysAdmin: Boolean value [0 - Disabled on SysAdmin web traffic, 1 - Enabled on SysAdmin web traffic. Default 1
  • Provisioning: Boolean value [0 - Disabled on provisioning traffic, 1 - Enabled on provisioning traffic]. Default 1
  • SIP: Boolean value [0 - Disabled on SIP traffic, 1 - Enabled on SIP traffic]. Default 1

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • ID: The ID of the new firewall rule

Request:

                
                  POST /api/firewall/add/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "Name": "Test Rule",
                    "RuleType": "Allow",
                    "AddressType": "Address"
                    "Address": "127.0.0.1"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "ID": "4"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/firewall/edit/

This endpoint will allow editing of existing firewall rules.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the rule to be edited.

The Request may contain the following attributes:

  • Name: The new name of the firewall rule.
  • RuleType: This will be Allow or Deny.
  • AddressType: This will be Address, Subnet or Country.
  • Position: The order priority of the firewall rule. This will shift all positions down so entering 3 for example will increment the current rules of priority 3 or more by 1. If omitted this will default to the highest possible position.
  • Address: If AddressType is Address or Subnet this must contain the IP address or IP subnet of the rule [xxx.xxx.xxx.xxx for address and xxx.xxx.xxx.xxx/yy for subnet].
  • Country: If the AddressType is Country this must contain the country code of the selected country [Canada = CA, United Kingdom = UK, etc].
  • Web: Boolean value [0 - Disabled on web traffic, 1 - Enabled on web traffic]. Default 1
  • SysAdmin: Boolean value [0 - Disabled on SysAdmin web traffic, 1 - Enabled on SysAdmin web traffic]. Default 1
  • Provisioning: Boolean value [0 - Disabled on provisioning traffic, 1 - Enabled on provisioning traffic]. Default 1
  • SIP: Boolean value [0 - Disabled on SIP traffic, 1 - Enabled on SIP traffic]. Default 1

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'

Request:

                
                  POST /api/firewall/edit/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "4",
                    "Name": "Test Rule Renamed"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/firewall/delete/

This endpoint will allow deletion of existing firewall rules.

The Request must contain the following attributes:

  • ID: The ID of the rule to be deleted.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'

Request:

                
                  POST /api/firewall/delete/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "4"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

Get Customer Information

The Get Customer Information function will return all information related to a customer.

Get Customer Information URL: solswitch/api/getcustomerinformation/

The Request may contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled
  • CustomerNumber: The CustomerNumber on the account. Not the CustID, but the customer number entered when creating the account. Usually links with an external CRM.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.
  • ID: The CustID on the SolSwitch. Use this to preform more API calls.
  • firstname: First name of the customer.
  • lastname: Last name of the customer.
  • company: The company the customer represents.
  • streetnumber: Address street number.
  • streetname: Address street name.
  • unit: Address unit number.
  • postalcode: Postal code (L#L#L#).
  • city: City the company is located in.
  • province: Province code (ON).
  • country: Country of residence.
  • telephone: Phone number without any '-'s.

Request:

                
                  POST /api/getcustomerinformation HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 74
                  {
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "CustomerNumber": "123456789"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "ID": "127",
                    "firstname": "Test",
                    "lastname": "Name",
                    "company": "Sunwire",
                    "streetnumber": "850",
                    "streetname": "Barrydowne Road",
                    "unit": "303",
                    "postalcode": "P3A3T7",
                    "city": "Sudbury",
                    "province": "ON",
                    "country": "Canada",
                    "telephone": "7055551234"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": " No results returned"
                  }
                
                

Monitoring Notifications

When monitoring is enabled on an extension, through Toggle Monitor, event notifications will be POSTed to the notification URL (Configured in SolSwitch settings).

Notifications will be sent on incoming and outgoing calls to monitored extensions, for the following events:

  • Call Incoming
  • Call Connected
  • Call Disconnected

The notifications will contain the following attributes:

  • Event: The event that triggered the notification (Incoming, Connected, Disconnected).
  • CallID: The unique ID of the call.
  • Customer: ID of the customer for the notifying extension.
  • SourceNumber: The phone number or extension of the source of the call.
  • SourceChannel: The call channel connected to the source of the call.
  • DestinationNumber: The extension of the destination of the call.
  • DestinationChannel: The call channel connected to the destination of the call.
  • DialedNumber: The actual number dialed by the source of the call.

Request:

                
                  POST /example HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 200
                  {
                    "Event": "Incoming",
                    "CallID": "843597",
                    "Customer": "4",
                    "SourceNumber": "7055551234"
                    "SourceChannel": "SIP/Example-000003ee",
                    "DestinationNumber": "123",
                    "DestinationChannel": "SIP/Example-0004f2be",
                    "DialedNumber": "7055216777"
                  }
                
                

Remove DID

Delete a DID from the SolSwitch.

Transfer Call URL: solswitch/api/removedid/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • DID: The DID to remove.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/removedid HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "DID": "7051234567"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Invalid DID provided"
                  }
                
                

Scheduled Routing Details

Pass a Route ID to return Route Type, InternalRouteID, Extension, Name, and Default Route at present moment in time if between DateTo and DateFrom, TimeTo and TimeFrom in ScheduledRoutingOptions table.

Add Header URL: solswitch/api/scheduledrouting/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the scheduled route you want data for if there's a scheduled route for the current time. If there isn't - the default route is returned.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: If the ID is non numerical or there's no records found for the ID.

Request:

                
                  POST /api/scheduledrouting/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "2"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "Name": "Test 2",
                    "Extension": "101",
                    "RouteExt": "9696",
                    "RouteType": "7",
                    "IRID": "68",
                    "RouteName": "dave-ext"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No data found."
                  }
                
                

SIP Account Management Suite

/api/sipaccounts/view/

This endpoint will list the available SIP accounts on the system. There will also be an optional ID value that will display information about just the requested SIP account.

The Request may contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the specific SIP account to view (Overrides the ViewType option below to Full).
  • ViewType: Can be set to Full or Partial to control how much data will be returned:
    • Full Each listing will be provided with as much information as possible.
    • Partial Each listing will be provided with and ID, Username and Description.
    • Default Partial.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Results: An array with each row containing the following:
  • ID ID of the SIP account. To be used with other endpoints.
  • CustID The Customer ID for the SIP account.
  • Description The given description of the SIP account.
  • Username SIP account username for static and dynamic SIP accounts.
  • Host SIP account host for static SIP accounts.
  • NAT Boolean [1 - Yes, 0 - No].
  • Type [static, dynamic, register].
  • DTMFMode [rfc2833, inband].
  • Port SIP port, typically 5060.
  • DeleteBlock Boolean [1 - Yes, 0 - No].
  • NotifyEmail Email address.
  • FaxCodec Boolean [1 - Yes, 0 - No].
  • VoiceCodec Boolean [1 - Yes, 0 - No].
  • VoiceCodec1 Boolean [1 - Yes, 0 - No].
  • VoiceCodec2 Boolean [1 - Yes, 0 - No].
  • VoiceCodec3 Boolean [1 - Yes, 0 - No].
  • VoiceCodec4 Boolean [1 - Yes, 0 - No].
  • Debug Boolean [1 - Yes, 0 - No].
  • RegisterUsername Username for Register type.
  • RegisterName Name / BTN for register type.
  • RegisterDomain Domain for register type.
  • TransportType TCP, UDP, SRTP.
  • G722Codec Boolean [1 - Yes, 0 - No].
  • G729Codec Boolean [1 - Yes, 0 - No].
  • DynamicFeatures Boolean [1 - Yes, 0 - No].
  • SIPPostAPI Boolean [1 - Yes, 0 - No].
  • ACLAllow String containing the ACL allow list.
  • ACLDeny String containing the ACL Deny list.
  • AllowInternational Boolean [1 - Yes, 0 - No].
  • SIPNotifyAPI Boolean [1 - Yes, 0 - No].
  • StayInAudioPath Boolean [1 - Yes, 0 - No].
  • Active Boolean [1 - Yes, 0 - No].

Request:

                
                  POST /api/sipaccounts/view/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "5"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "Results": [
                      {
                        "ID": "5",
                        "Name": "Test name",
                        "Description": "Test Desc"
                      }
                    ]
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/sipaccounts/add/

This endpoint will add a new SIP account.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • CustID: The Customer ID for the SIP account.
  • Description: The given description of the SIP account.
  • Username: SIP account username for static and dynamic SIP accounts.
  • Type: [static, dynamic, register].

If Type is set to static the following attributes are required:

  • Password: Password for static and dynamic SIP accounts.
  • Host: SIP account host for static SIP accounts.

If Type is set to dynamic the following attributes are required:

  • Password: Password for static and dynamic SIP accounts.

If Type is set to register the following attributes are required:

  • RegisterUsername: Username for Register type.
  • RegisterPassword: Password for Register type.
  • RegisterName: Name / BTN for register type.
  • RegisterDomain: Domain for register type.

The Request may contain the following attributes:

  • NAT: Boolean [1 - Yes, 0 - No]. Default 1
  • DTMFMode: [rfc2833, inband]. Default rfc2833
  • Port: SIP port, typically 5060. Default 5060
  • DeleteBlock: Boolean [1 - Yes, 0 - No]. Default 0
  • NotifyEmail: Email address.
  • FaxCodec: Boolean [1 - Yes, 0 - No]. Default 0
  • VoiceCodec: Boolean [1 - Yes, 0 - No]. Default 0
  • VoiceCodec1: Boolean [1 - Yes, 0 - No]. Default 0
  • VoiceCodec2: Boolean [1 - Yes, 0 - No]. Default 0
  • VoiceCodec3: Boolean [1 - Yes, 0 - No]. Default 0
  • VoiceCodec4: Boolean [1 - Yes, 0 - No]. Default 0
  • Debug: Boolean [1 - Yes, 0 - No]. Default 0
  • TransportType: TCP, UDP, SRTP. Default UDP
  • G722Codec: Boolean [1 - Yes, 0 - No]. Default 0
  • G729Codec: Boolean [1 - Yes, 0 - No]. Default 0
  • DynamicFeatures: Boolean [1 - Yes, 0 - No]. Default 1
  • SIPPostAPI: Boolean [1 - Yes, 0 - No]. Default 0
  • ACLAllow: String containing the ACL allow list.
  • ACLDeny: String containing the ACL Deny list.
  • AllowInternational: Boolean [1 - Yes, 0 - No]. Default 0
  • SIPNotifyAPI: Boolean [1 - Yes, 0 - No]. Default 0
  • StayInAudioPath: Boolean [1 - Yes, 0 - No]. Default 1
  • Active: Boolean [1 - Yes, 0 - No]. Default 1

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • ID: The ID of the newly created SIP Account.

Request:

                
                  POST /api/sipaccounts/add/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "Description": "Test SIP",
                    "CustID": "1",
                    "Username": "TestSIPAcc",
                    "Type": "dymamic"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "ID": "4"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/sipaccounts/edit/

This endpoint will edit an existing SIP account.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the SIP account to be edited.

The Request may contain the following attributes:

  • CustID: The Customer ID for the SIP account.
  • Description: The given description of the SIP account.
  • Username: SIP account username for static and dynamic SIP accounts.
  • Password: Password for static and dynamic SIP accounts.
  • Host: SIP account host for static SIP accounts.
  • NAT: Boolean [1 - Yes, 0 - No].
  • Type: [static, dynamic, register].
  • DTMFMode: [rfc2833, inband].
  • Port: SIP port, typically 5060.
  • DeleteBlock: Boolean [1 - Yes, 0 - No].
  • NotifyEmail: Email address.
  • FaxCodec: Boolean [1 - Yes, 0 - No].
  • VoiceCodec: Boolean [1 - Yes, 0 - No].
  • VoiceCodec1: Boolean [1 - Yes, 0 - No].
  • VoiceCodec2: Boolean [1 - Yes, 0 - No].
  • VoiceCodec3: Boolean [1 - Yes, 0 - No].
  • VoiceCodec4: Boolean [1 - Yes, 0 - No].
  • Debug: Boolean [1 - Yes, 0 - No].
  • RegisterUsername: Username for Register type.
  • RegisterPassword: Password for Register type.
  • RegisterName: Name / BTN for register type.
  • RegisterDomain: Domain for register type.
  • TransportType: TCP, UDP, SRTP.
  • G722Codec: Boolean [1 - Yes, 0 - No].
  • G729Codec: Boolean [1 - Yes, 0 - No].
  • DynamicFeatures: Boolean [1 - Yes, 0 - No].
  • SIPPostAPI: Boolean [1 - Yes, 0 - No].
  • ACLAllow: String containing the ACL allow list.
  • ACLDeny: String containing the ACL Deny list.
  • AllowInternational: Boolean [1 - Yes, 0 - No].
  • SIPNotifyAPI: Boolean [1 - Yes, 0 - No].
  • StayInAudioPath: Boolean [1 - Yes, 0 - No].
  • Active: Boolean [1 - Yes, 0 - No].

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'

Request:

                
                  POST /api/sipaccounts/edit/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "4",
                    "Description": "Test Trunk Renamed"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/sipaccounts/delete/

This endpoint will allow deletion of existing SIP accounts.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the trunk to be deleted.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'

Request:

                
                  POST /api/sipaccounts/delete/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "4"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

Toggle Monitoring

The toggle monitoring function allows event monitoring to be turned on or off for extensions. Monitoring can also be enabled/disabled for extensions directly through the SolSwitch web interface.

When enabled, notifications will be sent to the notification URL (Configured in SolSwitch settings) when the extension receives an incoming or outgoing call. The SolSwitch portal allows for greater customization of what events are sent to the notification URL.

Toggle Monitoring URL: solswitch/api/monitor/

The Request must contain the following attributes:

  • Extension: The extension number to adjust monitoring for. Extensions are numeric values, 3 to 5 digits in length.
  • Enabled: Whether monitoring should be enabled or disabled. Accepted values are 1 and 0, where 1 = Enabled and 0 = Disabled.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • Key: API key for connection to the system. Required field if an API key has been enabled.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/monitor HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 107
                  {
                    "Extension": "123",
                    "Enabled": "1",
                    "Customer": "4",
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Unknown Extension Number"
                  }
                
                

Toll Billing Info

This is used to sync two SolSwitch's toll billing rates and related toll settings. This is generally used when deploying multiple independent sets of SolSwitch systems which will be using the same billing settings.

Only a SolSwitch can use this API call as it involves accessing the database tables and comparing entries. For more information see the Advanced Tools > Toll Management > Toll Sync on the SolSwitch web portal..

Toll Rates

List the current toll rate locations for a certain toll plan.

Toll Rates URL: solswitch/api/tollrates/

The Request may contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • tollPlanID: The ID of the toll rate list to search on.

The Request must contain the following attributes:

  • tollPrefix: Including this will only return rates that the given prefix matches.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Array: Data from the toll rates.
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Request:

                
                  POST /api/tollrates
                  HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 124
                  {
                    "Key": "FzeKKeEKSIUXa7ZRMx3FciZwXG2FW8jd",
                    "tollPlanID": "11"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "Unknown Extension Number"
                  }
                
                

Toll Reporting

Load a report of tolls for the specified time period - either as a per-customer summary, or as a per-call breakdown for a single customer.

If API permissions are set to allow access to a single customer, the report will always pull the single customer breakdown for that customer.

Toll Reporting URL: solswitch/api/tollreport/

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • Customer: ID of the customer the function should run on, should be a numeric value. Optional field, if not provided the system will default to CustID 1.
  • DateStart: This will limit the returned data to be within Date Start and Date End.
    • Format: YYYY-MM-DD OR Format: YYYY-MM-DD HH:MM:SS
  • DateEnd: This will limit the returned data to be within Date Start and Date End.
    • Format: YYYY-MM-DD OR Format: YYYY-MM-DD HH:MM:SS

The Request may contain the following attributes:

  • CustNum: Customer Number (as configured in customer settings). When left empty, report will run as a per-customer summary if access is granted to all customers. When provided, report will be per-call breakdown for the specified customer

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Array: Data from the toll report.
  • Reason: Reason for fail status (Only if status is FAIL). A list of error messages and explanations can be found at the end of this document.

Example 1:

Request:

                
                  POST /api/tollreport
                  HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 162
                  {
                    "Key": "1234",
                    "DateStart": "2024-07-01",
                    "DateEnd": "2024-08-01"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "0": {
                      "CustNum": "5678",
                      "Company": "Main",
                      "Area": "Canada - AB",
                      "RateCost": "0.0300",
                      "CallCost": "0.32"
                    },
                    "1": {
                      "CustNum": "5678",
                      "Company": "Main",
                      "Area": "Canada - BC",
                      "RateCost": "0.0300",
                      "CallCost": "0.08"
                    }
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "IP address not allowed"
                  }
                
                

Example 2

Request:

                
                  POST /api/tollreport
                  HTTP/1.1
                  Content-Type: application/json
                  Content-Length: 179
                  {
                    "Key": "1234",
                    "DateStart": "2024-07-01",
                    "DateEnd": "2024-08-01",
                    "CustNum": "5678"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "0": {
                      "Company": "Main",
                      "Area": "Toll Free",
                      "RateCost": "0.0500",
                      "CallCost": "0.06",
                      "CallID": "3753672",
                      "StartTime": "2024-07-16 10:43:35",
                      "Length": "68",
                      "SrcNumber": "4167769547",
                      "DstNumber": "18004614219"
                    },
                    "1": {
                      "Company": "Main",
                      "Area": "Toll Free",
                      "RateCost": "0.0500",
                      "CallCost": "0.03",
                      "CallID": "3754222",
                      "StartTime": "2024-07-16 10:45:07",
                      "Length": "30",
                      "SrcNumber": "4167769547",
                      "DstNumber": "18004614219"
                    }
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "IP address not allowed"
                  }
                
                

Trunk Management Suite

/api/trunks/view/

This endpoint will list the available trunks on the system. There will also be an optional ID value that will display information about just the requested trunk.

The Request may contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the specific trunk to view (Overrides the ViewType option below to Full)
  • ViewType: Can be set to Full or Partial to control how much data will be returned:
    • Full - Each listing will be provided with as much information as possible.
    • Partial - Each listing will be provided with and ID, Name and Description.
    • Default - Partial.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • Results: An array with each row containing the following:
  • ID ID of the firewall rule. To be used with other endpoints.
  • Name Name of the firewall rule.
  • Description The order priority of the firewall rule. Lower numbered items will be checked before higher numbered ones.
  • TrunkType 1 - SIP Account, 2 - Line Card.
  • SIPAccountsID ID of the SIP Account tied to this trunk.
  • ChannelGroup 0 - 9 Line Card Channel Group.
  • ChannelOrder Outbound call order for Line Card trunk:
    • g: Sequential Ascending
    • G: Sequential Descending
    • r: Round Robin Ascending
    • R: Round Robin Descending
  • UseDIDTable Boolean [1 - Yes, 0 - No].
  • UseRouteGroup Boolean [1 - Yes, 0 - No].
  • RouteGroupID The ID of the route group to be assigned.
  • AddPrefix Prefix to be added to calls.
  • StripDigit Number of digits to strip from DIDs.
  • CallLimit 0 - Unlimited, # - Max calls on trunk.
  • DefaultDID
  • UseLocalRouting Boolean [1 - Yes, 0 - No].
  • AccessibleSID Boolean [1 - Yes, 0 - No].
  • Record Boolean [1 - Yes, 0 - No].
  • ApplyToll Boolean [1 - Yes, 0 - No].
  • UseE164 Boolean [1 - Yes, 0 - No].
  • CanConf Boolean [1 - Yes, 0 - No].
  • UnlimitedOutbound Boolean [1 - Yes, 0 - No].
  • AutoLearnRoutes Boolean [1 - Yes, 0 - No].
  • AutoLearnAPIKey Blank string or API key.
  • AutoLearnWeight Boolean [1 - Yes, 0 - No].
  • AutoLearnValidated Boolean [1 - Yes, 0 - No].

Request:

                
                  POST /api/trunks/view/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "5"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "Results": [
                      {
                      "ID": "5",
                      "Name": "Test name",
                      "Description": "Test Desc"
                      }
                    ]
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/trunks/add/

This endpoint will add a new trunk.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • Name: Name of the firewall rule.
  • Description: The order priority of the firewall rule. Lower numbered items will be checked before higher numbered ones.
  • TrunkType: 1 - SIP Account, 2 - Line Card.
  • SIPAccountsID: ID of the SIP Account tied to this trunk.

The Request may contain the following attributes:

  • ChannelGroup: 0 - 9 Line Card Channel Group.
  • ChannelOrder: Outbound call order for Line Card trunk:
    • g: Sequential Ascending
    • G: Sequential Descending
    • r: Round Robin Ascending
    • R: Round Robin Descending
    • A blank string can be provided if not using the LineCard trunk type.
  • UseDIDTable: Boolean [1 - Yes, 0 - No]. Default 0
  • UseRouteGroup: Boolean [1 - Yes, 0 - No]. Default 0
  • RouteGroupID: The ID of the route group to be assigned.
  • AddPrefix: Blank string or prefix to be added to calls.
  • StripDigit: Number of digits to strip from DIDs.
  • CallLimit: 0 - Unlimited, # - Max calls on trunk. Default 0
  • UseLocalRouting: Boolean [1 - Yes, 0 - No]. Default 0
  • AccessibleSID: Boolean [1 - Yes, 0 - No]. Default 0
  • Record: Boolean [1 - Yes, 0 - No]. Default 0
  • ApplyToll: Boolean [1 - Yes, 0 - No]. Default 0
  • UseE164: Boolean [1 - Yes, 0 - No]. Default 0
  • CanConf: Boolean [1 - Yes, 0 - No]. Default 0
  • UnlimitedOutbound: Boolean [1 - Yes, 0 - No]. Default 0
  • AutoLearnRoutes: Boolean [1 - Yes, 0 - No]. Default 0
  • AutoLearnAPIKey: Blank string or API key. Default 0
  • AutoLearnWeight: Integer value for the weight of this trunk for auto learning. Default 23
  • AutoLearnValidated: Boolean [1 - Yes, 0 - No]. Default 0

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'
  • ID: The ID of the newly created trunk.

Request:

                
                  POST /api/trunks/add/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "Name": "Main Trunk",
                    "Description": "Main outbound trunk",
                    "SIPAccountsID": "4",
                    "TrunkType": "1"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK",
                    "ID": "7"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/trunks/edit/

This endpoint will edit an existing trunk.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the trunk to be edited.

The Request may contain the following attributes:

  • Name: Name of the firewall rule.
  • Description: The order priority of the firewall rule. Lower numbered items will be checked before higher numbered ones.
  • TrunkType: 1 - SIP Account, 2 - Line Card.
  • SIPAccountsID: ID of the SIP Account tied to this trunk.
  • ChannelGroup: 0 - 9 Line Card Channel Group.
  • ChannelOrder: Outbound call order for Line Card trunk:
    • g: Sequential Ascending
    • G: Sequential Descending
    • r: Round Robin Ascending
    • R: Round Robin Descending
    • A blank string can be provided if not using the LineCard trunk type.
  • UseDIDTable: Boolean [1 - Yes, 0 - No].
  • UseRouteGroup: Boolean [1 - Yes, 0 - No].
  • RouteGroupID: The ID of the route group to be assigned.
  • AddPrefix: Blank string or prefix to be added to calls.
  • StripDigit: Number of digits to strip from DIDs.
  • CallLimit: 0 - Unlimited, # - Max calls on trunk.
  • UseLocalRouting: Boolean [1 - Yes, 0 - No].
  • AccessibleSID: Boolean [1 - Yes, 0 - No].
  • Record: Boolean [1 - Yes, 0 - No].
  • ApplyToll: Boolean [1 - Yes, 0 - No].
  • UseE164: Boolean [1 - Yes, 0 - No].
  • CanConf: Boolean [1 - Yes, 0 - No].
  • UnlimitedOutbound: Boolean [1 - Yes, 0 - No].
  • AutoLearnRoutes: Boolean [1 - Yes, 0 - No].
  • AutoLearnAPIKey: Blank string or API key.
  • AutoLearnWeight: Integer value for the weight of this trunk for auto learning.
  • AutoLearnValidated: Boolean [1 - Yes, 0 - No].

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'

Request:

                
                  POST /api/trunks/edit/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "4",
                    "Name": "Test Trunk Renamed"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

/api/trunks/delete/

This endpoint will allow deletion of existing trunks.

The Request must contain the following attributes:

  • Key: API key for connection to the system. Required field if an API key has been enabled.
  • ID: The ID of the trunk to be deleted.

The Response will contain the following attributes:

  • Status: 'OK' or 'FAIL'

Request:

                
                  POST /api/trunks/delete/ HTTP/1.1
                  Content-Type: application/json
                  {
                    "Key":
                    "YGLbZZaJWVMJfOXHCTIEADFGIRLbHZAd",
                    "ID": "4"
                  }
                
                

Response (SUCCESS)

                
                  {
                    "Status": "OK"
                  }
                
                

Response (FAIL)

                
                  {
                    "Status": "FAIL",
                    "Reason": "No Records Found."
                  }
                
                

Error Messages

Below are error messages that can be received from the API, and their reasons.

API

  • Invalid API function: The function being called does not exist.

CallID

  • Invalid CallID: The call ID provided is not valid (must be a positive integer value).
  • Unknown CallID: The provided call ID does not match any calls on record.

Call

  • Call did not start: New call unable to start or unable to retrieve call information.

Channel

  • Invalid Channel: The channel field isn't set.
  • Unknown Channel: The provided channel does not match any active calls.

Customer

  • Invalid Customer ID: The customer ID provided is not valid (must be a positive integer value).
  • Unknown Customer ID: No customer exists with the given ID.
  • No access to customer number #: Your IP/API Key does not have access rights to the given customer ID.

Date

  • No matching end time: Start time provided but no end time.
  • Invalid date format: Provided format does not match the required.

Destination

  • Invalid Destination: The destination number isn't set or isn't numeric.

DID

  • Invalid DID Provided: The DID is not a numeric entry. Must not contain "(", ")" or "-".

Enabled

  • Invalid Enabled Value: Enabled value not set or is an invalid character. Accepted inputs are 1 or 0.

Extension

  • Invalid Extension Number: The extension number isn't set or isn't numeric.
  • Unknown Extension Number: The provided extension number does not exist on the specified customer.

Fax

  • Cannot send fax, no destination number: The To variable was not set, or was not set to a valid number.
  • Cannot send fax, no source number: The From variable was not set, or was not set to a valid number.
  • From phone number provided is not a valid fax to email account.: The From variable does not point to a valid FaxToEmail account.

File

  • You must upload a file to fax: No File variable was passed to the function.
  • Error converting file for faxing. If this problem persists, please contact the system administrator: Error in the converting process of the .pdf. Make sure no non-standard encoding is being used when rendering the .pdf.
  • Only PDFs are accepted, type Detected: FileType: The From variable does not point to a valid FaxToEmail account.

IP

  • IP does not have access: The IP being used to connect does not have permission to connect to the API function.

Key

  • Error with Key: The API key provided is invalid or does not have access to the specified API function.

Recording

  • Call not recorded: The requested call was not recorded. This could be due to recording not being set up for the involved parties, or one of the involved parties having privacy enabled.
  • Recording not generated: The requested call was recorded, but the system is still working on generating the recording. This will generally be completed within a couple minutes of the call ending.

Time Rules

  • Time rule not found: There is no time rule with the supplied ID on the requested customer.

Tone

  • Invalid Tone: Tone not set or contains invalid characters. Accepted characters are: *, #, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Unknown

  • Missing required field: Field: A required parameter was not passed to the API. Check documentation on the function you're trying to use.
  • No results to display: No data was returned from a function that should always return data (Eg /api/getcustomerinformation).

Route Types

Below is a table describing the route types for SourceType and DestinationType values

ID: RouteType

  • 1: Queue
  • 2: FaxToEmail
  • 3: Voicemail
  • 4: VirtualExtension
  • 5: RingGroup
  • 6: IVR
  • 7: Extension
  • 8: Recording
  • 9: MeetMe
  • 10: PageGroup
  • 11: RouteGroup
  • 12: FollowMe
  • 13: ParkingLot
  • 14: VoIP Line
  • 15: Trunk
  • 16: QueueCallback
  • 17: TimeRule
  • 18: Sol-Cast
  • 19: NotifyQueue
  • 20: ScheduledRouting
  • 21: FaxSwitch
  • 22: DV
  • 23: Hold

Example API Calls

Below are some example calls of how to use and access SolSwitch API.

Command Line cURL Example

JSON file contents:

                
                  {
                    "Customer":"1",
                    "Key":"YOUR_KEY_HERE"
                  }
                
                

cURL command to run:

                
                  curl -s -header 'Content-Type: application/json' -request POST -data-binary "@./YOUR_JSON_FILE.json" http://SS_IP_HERE/api/listactivecalls | jq
                
                

Results:

                
                  {
                    "Status":"OK",
                    "Calls":
                    [{
                      "CallID":"25169817",
                      "SourceNumber":"490",
                      ........
                      "Duration":"00:00:12"
                    }]
                  }
                
                

PHP Example

Request:

                
                  $array = array(
                    "Key" => "YOUR_KEY_HERE",
                    "DateStart" => "2021-02-16",
                    "DateEnd" => "2021-02-16");
                  $json = json_encode($array, 128);
                  $url = "http://SS_IP_HERE/api/cdrexport/";
                  
                  $curl = curl_init();
                  curl_setopt($curl, CURLOPT_POST, 1);
                  curl_setopt($curl, CURLOPT_URL, $url);
                  curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
                  curl_setopt($curl, CURLOPT_HTTPHEADER, Array('Content-Type: application/json'));
                  curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
                  
                  $result = curl_exec($curl);
                  curl_close($curl);
                  
                  print $result;
                
                

Response:

                
                  {
                    "LegID":"6166",
                    "StartTime":"2021-08-04 10:43:18",
                    "ConnectTime":"",
                    "EndTime":"2021-08-04-10:43:20",
                    "SourceName":"test-ext2",
                    "SourceNumber":"9697",
                    "DestinationName":"test-mitel-ext",
                    "DestinationNmber":"9696",
                    "Disposition":"NOANSWER",
                    "DialedNumber":"9696",
                    "SourceType":"7",
                    "DestinationType":"7",
                    "CallCode":""
                  }
                
                

Python Example

Request:

                
                  import requests
                  url = "http://SS_IP_HERE/api/scheduledrouting/"
                  headers = {"Content-Type":"application/json","Content-Length": "74"}
                  jsonBody = {
                    "Customer":"1",
                    "Key":"YOUR KEY HERE",
                    "ID":"2"
                  }
                  response = requests.request("POST", url, headers=headers, json=jsonBody)
                  if response.status_code == 200:
                  print(reponse.text)
                  elif response.status_code == 404:
                  print('**Not found.**')
                
                

Response:

                
                  {
                    "Status": "OK",
                    "Name": "Test 2",
                    "Extension": "102",
                    "RouteExt": "9991",
                    "RouteType": "12",
                    "IRID": "5",
                    "RouteName": "test-ext"
                  }