diff --git a/flexiapi/public/css/style.css b/flexiapi/public/css/style.css
index 9b52681..94299b8 100644
--- a/flexiapi/public/css/style.css
+++ b/flexiapi/public/css/style.css
@@ -177,12 +177,18 @@ content {
}
body.welcome content {
- min-height: calc(100vh - 17rem);
+ min-height: calc(100vh - 18rem);
align-items: center;
margin: 0 auto;
max-width: 1024px;
}
+@media screen and (max-width: 800px) {
+ body.welcome content {
+ min-height: calc(100vh - 16rem);
+ }
+}
+
hr {
border-bottom: 1px solid var(--grey-3);
margin: 2rem 0;
@@ -245,7 +251,7 @@ ul.tabs li.current {
header nav {
padding: 3rem 1rem;
display: flex;
- min-height: 6rem;
+ min-height: 5rem;
}
header nav a {
@@ -261,20 +267,6 @@ header nav a i {
font-size: 2.5rem;
}
-@media screen and (max-width: 800px) {
- header nav {
- padding: 1rem;
- }
-
- header nav a {
- padding: 1rem;
- }
-
- header nav a i {
- margin-right: 0;
- }
-}
-
header nav a#logo {
font-weight: 700;
padding-left: 2rem;
@@ -324,6 +316,25 @@ header nav a.oppose ~ a.oppose {
margin-left: 0;
}
+@media screen and (max-width: 800px) {
+ header nav {
+ padding: 1rem;
+ }
+
+ header nav a,
+ header nav a#logo {
+ padding: 1rem;
+ }
+
+ header nav a#logo::before {
+ margin-right: 0;
+ }
+
+ header nav a i {
+ margin-right: 0;
+ }
+}
+
/** Section **/
content section {
@@ -464,7 +475,7 @@ content > nav a i {
/** Footer **/
body.welcome::after {
- background-position: bottom center;
+ background-position: top center;
background-repeat: repeat-x;
background-image: url('../img/footer.svg');
display: block;
@@ -472,7 +483,8 @@ body.welcome::after {
width: 100%;
background-size: 50rem;
content: '';
- height: 9rem;
+ height: 5rem;
+ margin-top: 2rem;
}
/** Titles **/
@@ -485,6 +497,11 @@ h1 {
display: flex;
align-items: center;
margin-right: 1rem;
+ margin-bottom: 1rem;
+}
+
+header > h1 {
+ margin-bottom: 0;
}
h1 i {
@@ -558,6 +575,10 @@ ul + h1, ul + h2, ul + h3, ul + h4, h3 + p {
background-color: var(--color-yellow);
}
+.badge.badge-error {
+ background-color: var(--color-purple);
+}
+
/** Table **/
table {
diff --git a/flexiapi/resources/views/about.blade.php b/flexiapi/resources/views/about.blade.php
index a03eb26..03c94eb 100644
--- a/flexiapi/resources/views/about.blade.php
+++ b/flexiapi/resources/views/about.blade.php
@@ -11,6 +11,8 @@
Terms and Conditions and Privacy policy
+ API Documentation and General Documentation
+
GNU General Public Licence v3.0 (Licence)
{{ config('instance.copyright') }}
diff --git a/flexiapi/resources/views/account/documentation.blade.php b/flexiapi/resources/views/account/documentation.blade.php
index 2ef60d1..3f0ee58 100644
--- a/flexiapi/resources/views/account/documentation.blade.php
+++ b/flexiapi/resources/views/account/documentation.blade.php
@@ -1,6 +1,8 @@
-@extends('layouts.main')
+@extends('layouts.main', ['welcome' => true])
@section('content')
- {{-- This view is only a wrapper for the markdown page --}}
- {!! $documentation !!}
+
+ {{-- This view is only a wrapper for the markdown page --}}
+ {!! $documentation !!}
+
@endsection
\ No newline at end of file
diff --git a/flexiapi/resources/views/account/documentation_markdown.blade.php b/flexiapi/resources/views/account/documentation_markdown.blade.php
index a71936a..86d0e67 100644
--- a/flexiapi/resources/views/account/documentation_markdown.blade.php
+++ b/flexiapi/resources/views/account/documentation_markdown.blade.php
@@ -40,7 +40,7 @@ Once activated {{ $app_name }} will ask your to provide a password to finish you
To authenticate please fill in the username or phone number and password you provided during the registration phase.
-If you forgot your password or didn't configured it, you can always recover your account using the recover password forms, using your @if (config('app.web_panel')) [email address]({{ route('account.login_email') }}) @else email address @endif or @if (config('app.web_panel') && config('app.phone_authentication')) [phone number]({{ route('account.login_phone') }}) @else phone number (not enabled) @endif. Once authenticated you will then be able to change your password.
+If you forgot your password or didn't configured it, you can always recover your account using the recover password forms, using your @if (config('app.web_panel')) [email address]({{ route('account.recovery.show.email') }}) @else email address @endif or @if (config('app.web_panel') && config('app.phone_authentication')) [phone number]({{ route('account.recovery.show.phone') }}) @else phone number (not enabled) @endif. Once authenticated you will then be able to change your password.
## Code based authentication
@@ -68,7 +68,7 @@ Your account can be deleted from the panel using the @if (config('app.web_panel'
*The feature is not enabled on this instance.*
@endif
-From the @if (config('app.web_panel'))[devices management panel]({{ route('admin.account.device.index') }}) @else devices management panel @endif an admin will be able to list and delete the devices attached to a SIP account.
+From the devices management panel an admin will be able to list and delete the devices attached to a SIP account.
# Admin panel
diff --git a/flexiapi/resources/views/api/documentation_markdown.blade.php b/flexiapi/resources/views/api/documentation_markdown.blade.php
index 0b37970..aa2d0a2 100644
--- a/flexiapi/resources/views/api/documentation_markdown.blade.php
+++ b/flexiapi/resources/views/api/documentation_markdown.blade.php
@@ -8,7 +8,6 @@ A `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
```
@@ -74,7 +73,9 @@ You can find more documentation on the related [IETF RFC-7616](https://tools.iet
## Ping
### `GET /ping`
+
Public
+
Returns `pong`
## Account Creation Request Tokens
@@ -82,6 +83,7 @@ Returns `pong`
An `account_creation_request_token` is a unique token that can be validated and then used to generate a valid `account_creation_token`.
### `POST /account_creation_request_tokens`
+
Public
Create and return an `account_creation_request_token` that should then be validated to be used.
@@ -91,7 +93,9 @@ Create and return an `account_creation_request_token` that should then be valida
An `account_creation_token` is a unique token that allow the creation of a **unique** account.
### `POST /account_creation_tokens/send-by-push`
+
Public
+
Create and send an `account_creation_token` using a push notification to the device.
Return `403` if a token was already sent, or if the tokens limit is reached for this device.
Return `503` if the token was not successfully sent.
@@ -103,7 +107,9 @@ JSON parameters:
* `pn_prid` the push notification unique id
### `POST /account_creation_tokens/using-account-creation-request-token`
+
Public
+
Create an `account_creation_token` using an `account_creation_request_token`.
Return an `account_creation_token`.
Return `404` if the `account_creation_request_token` provided is not valid or expired otherwise.
@@ -113,6 +119,7 @@ JSON parameters:
* `account_creation_request_token` required
### `POST /account_creation_tokens`
+
Admin
Create and return an `account_creation_token`.
@@ -120,13 +127,17 @@ Create and return an `account_creation_token`.
## Auth Tokens
### `POST /accounts/auth_token`
+
Public
+
Generate an `auth_token`. To attach the generated token to an account see [`auth_token` attachement endpoint](#get-accountsauthtokenauthtokenattach).
Return the `auth_token` object.
### `GET /accounts/auth_token/{auth_token}/attach`
+
User
+
Attach a publicly generated authentication token to the currently authenticated account.
Return `404` if the token is non existing or invalid.
@@ -135,10 +146,11 @@ Return `404` if the token is non existing or invalid.
### `POST /accounts/public`
-@if(config('app.dangerous_endpoints'))**Enabled on this instance**@else**Not enabled on this instance**@endif
+@if(!config('app.dangerous_endpoints'))Disabled@endif
Public
-Unsecure endpoint
+Unsecure endpoint
+
Create an account.
Return `422` if the parameters are invalid.
Send an email with the activation key if `email` is set, send an SMS otherwise.
@@ -154,7 +166,9 @@ JSON parameters:
* `account_creation_token` the unique `account_creation_token`
### `POST /accounts/with-account-creation-token`
+
Public
+
Create an account using an `account_creation_token`.
Return `422` if the parameters are invalid or if the token is expired.
@@ -167,25 +181,31 @@ JSON parameters:
* `dtmf_protocol` optional, values must be `sipinfo`, `sipmessage` or `rfc2833`
### `GET /accounts/{sip}/info`
+
Public
+
Retrieve public information about the account.
Return `404` if the account doesn't exists.
### `GET /accounts/{phone}/info-by-phone`
-@if(config('app.dangerous_endpoints'))**Enabled on this instance**@else**Not enabled on this instance**@endif
+
+@if(!config('app.dangerous_endpoints'))Disabled@endif
Public
-Unsecure endpoint
+Unsecure endpoint
+
Retrieve public information about the account.
Return `404` if the account doesn't exists.
Return `phone: true` if the returned account has a phone number.
### `POST /accounts/recover-by-phone`
-@if(config('app.dangerous_endpoints'))**Enabled on this instance**@else**Not enabled on this instance**@endif
+
+@if(!config('app.dangerous_endpoints'))Disabled@endif
Public
-Unsecure endpoint
+Unsecure endpoint
+
Send a SMS with a recovery PIN code to the `phone` number provided.
Return `404` if the account doesn't exists.
@@ -195,10 +215,12 @@ JSON parameters:
* `account_creation_token` the unique `account_creation_token`
### `GET /accounts/{sip}/recover/{recover_key}`
-@if(config('app.dangerous_endpoints'))**Enabled on this instance**@else**Not enabled on this instance**@endif
+
+@if(!config('app.dangerous_endpoints'))Disabled@endif
Public
-Unsecure endpoint
+Unsecure endpoint
+
Activate the account if the correct `recover_key` is provided.
The `sip` parameter can be the default SIP account or the phone based one.
@@ -208,7 +230,9 @@ Return the account information (including the hashed password) if valid.
Return `404` if the account doesn't exists.
### `POST /accounts/{sip}/activate/email`
+
Public
+
Activate an account using a secret code received by email.
Return `404` if the account doesn't exists or if the code is incorrect, the validated account otherwise.
JSON parameters:
@@ -216,7 +240,9 @@ JSON parameters:
* `confirmation_key` the confirmation key
### `POST /accounts/{sip}/activate/phone`
+
Public
+
Activate an account using a pin code received by phone.
Return `404` if the account doesn't exists or if the code is incorrect, the validated account otherwise.
JSON parameters:
@@ -224,7 +250,9 @@ JSON parameters:
* `confirmation_key` the PIN code
### `GET /accounts/me/api_key/{auth_token}`
+
Public
+
Generate and retrieve a fresh API Key from an `auth_token`. The `auth_token` must be attached to an existing account, see [`auth_token` attachement endpoint](#get-accountsauthtokenauthtokenattach) to do so.
Return `404` if the token is invalid or not attached.
@@ -232,33 +260,45 @@ Return `404` if the token is invalid or not attached.
This endpoint is also setting the API Key as a Cookie.
### `GET /accounts/me/api_key`
+
User
+
Generate and retrieve a fresh API Key.
This endpoint is also setting the API Key as a Cookie.
### `GET /accounts/me`
+
User
+
Retrieve the account information.
### `GET /accounts/me/provision`
+
User
+
Provision the account by generating a fresh `provisioning_token`.
Return the account object.
### `DELETE /accounts/me`
+
User
+
Delete the account.
### `POST /accounts/me/email/request`
+
User
+
Change the account email. An email will be sent to the new email address to confirm the operation.
JSON parameters:
* `email` the new email address, must be unique if `ACCOUNT_EMAIL_UNIQUE` is set to `true`
### `POST /accounts/me/password`
+
User
+
Change the account password.
JSON parameters:
@@ -267,7 +307,9 @@ JSON parameters:
* `password` required, the new password
### `POST /accounts`
+
Admin
+
To create an account directly from the API.
If `activated` is set to `false` a random generated `confirmation_key` and `provisioning_token` will be returned to allow further activation using the public endpoints and provision the account. Check `confirmation_key_expires` to also set an expiration date on that `confirmation_key`.
@@ -286,7 +328,9 @@ JSON parameters:
* `confirmation_key_expires` optional, a datetime of this format: Y-m-d H:i:s. Only used when `activated` is not used or `false`. Enforces an expiration date on the returned `confirmation_key`. After that datetime public email or phone activation endpoints will return `403`.
### `PUT /accounts/{id}`
+
Admin
+
Update an existing account.
JSON parameters:
@@ -301,52 +345,74 @@ JSON parameters:
* `dtmf_protocol` optional, values must be `sipinfo`, `sipmessage` or `rfc2833`
### `GET /accounts`
+
Admin
+
Retrieve all the accounts, paginated.
### `GET /accounts/{id}`
+
Admin
+
Retrieve a specific account.
### `POST /accounts/{id}/recover-by-email`
+
Admin
+
Send the account recovery email containing a fresh `provisioning_token` and `confirmation_key`
### `GET /accounts/{sip}/search`
+
Admin
+
Search for a specific account by sip address.
### `GET /accounts/{email}/search-by-email`
+
Admin
+
Search for a specific account by email.
### `DELETE /accounts/{id}`
+
Admin
+
Delete a specific account and its related information.
### `GET /accounts/{id}/activate`
+
Admin
+
Activate an account.
### `GET /accounts/{id}/deactivate`
+
Admin
+
Deactivate an account.
### `GET /accounts/{id}/provision`
+
Admin
+
Provision an account by generating a fresh `provisioning_token`.
## Accounts phone number
### `POST /accounts/me/phone/request`
+
User
+
Request a specific code by SMS
JSON parameters:
* `phone` the phone number to send the SMS
### `POST /accounts/me/phone`
+
User
+
Confirm the code received and change the phone number
JSON parameters:
@@ -357,35 +423,49 @@ Return the updated account
## Accounts devices
### `GET /accounts/me/devices`
+
User
+
Return the user registered devices.
### `DELETE /accounts/me/devices/{uuid}`
+
User
+
Remove one of the user registered devices.
## Accounts contacts
### `GET /accounts/me/contacts`
+
User
+
Return the user contacts.
### `GET /accounts/me/contacts/{sip}`
+
User
+
Return a user contact.
## Contacts
### `GET /accounts/{id}/contacts`
+
Admin
+
Get all the account contacts.
### `POST /accounts/{id}/contacts/{contact_id}`
+
Admin
+
Add a contact to the list.
### `DELETE /accounts/{id}/contacts/{contact_id}`
+
Admin
+
Remove a contact from the list.
## Account Actions
@@ -393,15 +473,21 @@ Remove a contact from the list.
The following endpoints will return `403 Forbidden` if the requested account doesn't have a DTMF protocol configured.
### `GET /accounts/{id}/actions`
+
Admin
+
Show an account related actions.
### `GET /accounts/{id}/actions/{action_id}`
+
Admin
+
Show an account related action.
### `POST /accounts/{id}/actions/`
+
Admin
+
Create an account action.
JSON parameters:
@@ -410,7 +496,9 @@ JSON parameters:
* `code` required, alpha numeric, lowercase
### `PUT /accounts/{id}/actions/{action_id}`
+
Admin
+
Create an account action.
JSON parameters:
@@ -419,21 +507,29 @@ JSON parameters:
* `code` required, alpha numeric, lowercase
### `DELETE /accounts/{id}/actions/{action_id}`
+
Admin
+
Delete an account related action.
## Contacts Lists
### `GET /contacts_lists`
+
Admin
+
Show all the contacts lists.
### `GET /contacts_lists/{id}`
+
Admin
+
Show a contacts list.
### `POST /contacts_lists`
+
Admin
+
Create a contacts list.
JSON parameters:
@@ -442,7 +538,9 @@ JSON parameters:
* `description` required
### `PUT /contacts_lists/{id}`
+
Admin
+
Update a contacts list.
JSON parameters:
@@ -451,37 +549,53 @@ JSON parameters:
* `description` required
### `DELETE /contacts_lists/{id}`
+
Admin
+
Delete a contacts list.
### `POST /contacts_lists/{contacts_list_id}/contacts/{contact_id}`
+
Admin
+
Add a contact to the contacts list.
### `DELETE /contacts_lists/{contacts_list_id}/contacts/{contact_id}`
+
Admin
+
Remove a contact from the contacts list.
### `POST /accounts/{id}/contacts_lists/{contacts_list_id}`
+
Admin
+
Add a contacts list to the account.
### `DELETE /accounts/{id}/contacts_lists/{contacts_list_id}`
+
Admin
+
Remove a contacts list from the account.
## Account Types
### `GET /account_types`
+
Admin
+
Show all the account types.
### `GET /account_types/{id}`
+
Admin
+
Show an account type.
### `POST /account_types`
+
Admin
+
Create an account type.
JSON parameters:
@@ -489,7 +603,9 @@ JSON parameters:
* `key` required, alpha numeric with dashes, lowercase
### `PUT /account_types/{id}`
+
Admin
+
Update an account type.
JSON parameters:
@@ -497,21 +613,29 @@ JSON parameters:
* `key` required, alpha numeric with dashes, lowercase
### `DELETE /account_types/{id}`
+
Admin
+
Delete an account type.
### `POST /accounts/{id}/types/{type_id}`
+
Admin
+
Add a type to the account.
### `DELETE /accounts/{id}/contacts/{type_id}`
+
Admin
+
Remove a type from the account.
## Messages
### `POST /messages`
+
Admin
+
Send a message over SIP.
JSON parameters:
@@ -519,6 +643,35 @@ JSON parameters:
* `to` required, SIP address of the receiver
* `body` required, content of the message
+## Statistics
+
+FlexiAPI can record logs generated by the FlexiSIP server and compile them into statistics.
+
+### `POST /statistics/messages`
+
+Admin
+
+Announce the creation of a message.
+
+JSON parameters:
+
+* `id` required, string
+* `from` required, string the sender of the message
+* `sent_at` required, string, format ISO8601, when the mesage was actually sent
+* `encrypted` required, boolean
+* `conference_id` string
+
+### `PATCH /statistics/messages/{message_id}/to/{to}/devices/{device_id}`
+
+Admin
+
+Complete a message status.
+
+JSON parameters:
+
+* `last_status` required, an integer containing the last status code
+* `received_at` required, format ISO8601, when the message was received
+
# Non-API Endpoints
The following URLs are **not API endpoints** they are not returning `JSON` content and they are not located under `/api` but directly under the root path.
@@ -528,11 +681,15 @@ The following URLs are **not API endpoints** they are not returning `JSON` conte
When an account is having an available `provisioning_token` it can be provisioned using the two following URL.
### `GET /provisioning`
+
Public
+
Return the provisioning information available in the liblinphone configuration file (if correctly configured).
### `GET /provisioning/{provisioning_token}?reset_password`
+
Public
+
Return the provisioning information available in the liblinphone configuration file.
If the `provisioning_token` is valid the related account information are added to the returned XML. The account is then considered as "provisioned" and those account related information will be removed in the upcoming requests (the content will be the same as the previous url).
@@ -543,7 +700,9 @@ URL parameters:
* `reset_password` optional, reset the password while doing the provisioning
### `GET /provisioning/qrcode/{provisioning_token}?reset_password`
+
Public
+
Return a QRCode that points to the provisioning URL.
URL parameters:
@@ -551,13 +710,17 @@ URL parameters:
* `reset_password` optional, reset the password while doing the provisioning
### `GET /provisioning/me`
+
User
+
Return the same base content as the previous URL and the account related information, similar to the `provisioning_token` endpoint. However this endpoint will always return those information.
## Contacts list
### `GET /contacts/vcard`
+
User
+
Return the authenticated user contacts list, in [vCard 4.0 format](https://datatracker.ietf.org/doc/html/rfc6350).
Here is the format of the vCard list returned by the endpoint:
@@ -582,5 +745,7 @@ END:VCARD
```
### `GET /contacts/vcard/{sip}`
+
User
+
Return a specific user authenticated contact, in [vCard 4.0 format](https://datatracker.ietf.org/doc/html/rfc6350).
\ No newline at end of file