Managing third-party clients

Web Console

You can easily manage your API clients with the api web console located at app.sipgate.com/io/hooks.

Alternatively, you can use your computer’s command line interface (CLI):

CLI / Programmatic Way

In case you have to maintain your clients programmatically or by command line, you can utilize the sipgate REST API with any http client tool.

Following examples show how to create, modify or delete your API clients with the powerfull curl command line utility.

Authentication

Using Personal Access Tokens

Learn how to use Personal Access Tokens for your Application in our authentication documentation.

Using OAuth 2.0 authentication

Read the chapter on OAuth 2.0 Authentication to obtain an access_token.

Use cases

In the following examples our REST-API will be used. For a more detailed documentation we recommend having a look at our Swagger-UI.

Creating a new client

In order to create a new client you must provide a name, a description, web origins and redirect URIs.

If you want to use the REST-API from inside a browser, you will have to add wildcards for the URIs where your user should be able to log in with sipgate to the redirectURIs URI and can safely ignore web origins.

If you want to create a client to use it with the sipgate Webphone, add only [ „https://phone.sipgate.com/*“] to redirectURIs and add wildcards for all domains where you want to integrate the webphone to webOrigins.

curl \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer...' \
--url https://api.sipgate.com/v2/authorization/oauth2/clients \
--data '{ "name": "Example name", "description": "Example description", "redirectUris": [ "https://*.example.com/*" ], "webOrigins": [ "https://*.example.com" ]}' 

Retrieving all clients

This will give you a list of all clients.

 curl \
--request GET \
--header 'Authorization: Bearer...' \
--url https://api.sipgate.com/v2/authorization/oauth2/clients

Retrieving a single client

This will give you the name, description, client secret, redirect URIs and web origins of the specified client.

curl \
--request GET \
--header 'Authorization: Bearer...' \
--url https://api.sipgate.com/v2/authorization/oauth2/clients/{clientId}

Updating an existing client

When updating a client, please make sure to provide a clientId in the path parameter.

curl \
--request PUT \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer...' \
--url https://api.sipgate.com/v2/authorization/oauth2/clients/{clientId} \
--data '{ "name": "Example name", "description": "Example description", "redirectUris": [ "https://*.example.com/*" ], "webOrigins": [ "https://*.example.com" ]}'

Deleting a client

Warning
A client, once deleted, cannot be recovered. Your users will need to authenticate themselves again with a new client.

 

curl \
--request DELETE \
--header 'Authorization: Bearer ' \
--url https://api.sipgate.com/v2/authorization/oauth2/clients/{clientId}