@extends('layouts.main') @section('content')

Flexisip API

An API to deal with the Flexisip server

The API is available under /api

A from (consisting of the user SIP address, prefixed with sip:), content-type and accept HTTP headers are required to use the API properly

> GET /api/{endpoint}
> from: sip:foobar@sip.example.org
> content-type: application/json
> accept: application/json

Authentication

Restricted endpoints are protected using a DIGEST authentication or an API Key mechanisms.

Using the API Key

To authenticate using an API Key, you need to authenticate to your account panel and being an administrator.

On your panel you will then find a form to generate your personnal key.

You can then use your freshly generated key by adding a new x-api-key header to your API requests:

    > GET /api/{endpoint}
    > from: sip:foobar@sip.example.org
    > x-api-key: {your-api-key}
    > …

Using DIGEST

To discover the available hashing algorythm you MUST send an unauthenticated request to one of the restricted endpoints.
For the moment only DIGEST-MD5 and DIGEST-SHA-256 are supported through the authentication layer.

> GET /api/{restricted-endpoint}
> …

< HTTP 401
< content-type: application/json
< www-authenticate: Digest realm=test,qop=auth,algorithm=MD5,nonce="{nonce}",opaque="{opaque}"
< www-authenticate: Digest realm=test,qop=auth,algorithm=SHA-256,nonce="{nonce}",opaque="{opaque}"

You can find more documentation on the related IETF RFC-7616.

Endpoints

Accounts (User)

GET /accounts/me

Retrieve the account information.

POST /accounts/email/request

Change the account email. An email will be sent to the new email address to confirm the operation.

JSON parameters:

POST /accounts/password

Change the account password.

JSON parameters:

Accounts (Administrator)

Those endpoints are authenticated and requires an admin account.

POST /accounts

To create an account directly from the API.

JSON parameters:

GET /accounts

Retrieve all the accounts, paginated.

GET /accounts/{id}

Retrieve a specific account.

DELETE /accounts/{id}

Delete a specific account and its related information.

GET /accounts/{id}/activate

Activate an account.

GET /accounts/{id}/deactivate

Deactivate an account.

Ping

GET /ping

Returns pong

Devices

GET /devices

Return the user registered devices.

DELETE /devices/{uuid}

Remove one of the user registered devices.

@endsection