Use cases
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}