Brekeke SIP Server Wiki

BSS How to call BSS methods via REST API

Note: REST API feature is available on Brekeke SIP SERVER version 3.16.0 or later

 

Configuration at Brekeke Products

 

1. Allow REST API Access

<Brekeke SIP Server>

At the [SIP SERVER]> [Configuration] > [Advanced], by using the following property, define the client’s IP address pattern to allow REST API accesses to Brekeke SIP Server.

sipadmin.api.hosts.allow=<regular expression>

Example: Allow only local access

sipadmin.api.hosts.allow=^127\.0\.0\.1$

<Brekeke PBX>

At the [PBX][Options] > [Settings] > [Valid WebSocket Client IP Pattern] field, enter a regular expression to define the client’s IP address pattern.

For example, ^192\.168\..+$ will include any client whose IP address starts with “192.168.”

 

2. Authorization

Configure API Key for REST API requests. Set the following properties into the [SIP SERVER] > [Configuration] > [Advanced].

apikey.<n>=<api key>
apikey.<n>.scope=<Scope of api>

Example 1:

apikey.1=asldjfjlsd
apikey.1.scope=userdir

Example 2: multiple api scopes

apikey.1=asldjfjlsd
apikey.1.scope=userdir,alias,blocklist,registered

 

In this example, the api key “asldjfjlsd” will be used as token for authorization.


Send REST requests
URL

<Brekeke SIP Server>

http(s)://<host>:<port>/sip/api/<api scoope>/<method name>

<Brekeke PBX>

http(s)://<host>:<port>/pbx/api/<api scope>/<method name>

 

Sending REST requests with Postman.

Step 1. Open Postman. Then Create a GET request.

  • Enter appropriate URL of your PBX/BSS.
  • Open the [Authorization] tab and select the Type”Bearer Token“.
  • Set your API Key at the [Token] field.

 

Step 2. Open the [Body] tab. Following the reference of methods, set appropriate body with JSON format.

 

Step 3. Press Send button.

 

Related Links:

 

Yes No
Suggest Edit