From 697f0cc1f9ccf8438233f146f5ab584ea7526891 Mon Sep 17 00:00:00 2001 From: Meteo Date: Mon, 8 Jun 2026 22:30:58 +0200 Subject: [PATCH] More API call documentation --- API/v1/customers/companies/PUT Activate.md | 1 + API/v1/office/stompjes/DELETE Stomp.md | 1 + API/v1/office/stompjes/POST Stomp user.md | 2 + .../configure/PUT Portal settings.md | 63 ++++++++++++++++ .../PUT Group permissions.md | 63 ++++++++++++++++ .../mail/configure/PUT Mail settings.md | 73 +++++++++++++++++++ .../mail/test/POST Send test mail.md | 56 ++++++++++++++ 7 files changed, 259 insertions(+) create mode 100644 API/v1/portal-management/configure/PUT Portal settings.md create mode 100644 API/v1/portal-management/group-permissions/PUT Group permissions.md create mode 100644 API/v1/portal-management/mail/configure/PUT Mail settings.md create mode 100644 API/v1/portal-management/mail/test/POST Send test mail.md diff --git a/API/v1/customers/companies/PUT Activate.md b/API/v1/customers/companies/PUT Activate.md index 0101ab9..555500e 100644 --- a/API/v1/customers/companies/PUT Activate.md +++ b/API/v1/customers/companies/PUT Activate.md @@ -16,6 +16,7 @@ This API call activates a company by changing its status from inactive to active | ------------- | ------ | -------- | ---------------------------------------------- | | company_uuid | string | yes | Unique id of the company | | company_state | enum | yes | The state of the company (active or imported). | + **imported** is the state of the company when its imported from the source. ### Example Body (json) diff --git a/API/v1/office/stompjes/DELETE Stomp.md b/API/v1/office/stompjes/DELETE Stomp.md index b224a5b..c3bbaaf 100644 --- a/API/v1/office/stompjes/DELETE Stomp.md +++ b/API/v1/office/stompjes/DELETE Stomp.md @@ -1,5 +1,6 @@ # DELETE Stomp This API call deletes a stomp from a user. + #### Location ``` /api/v1/office/stompjes/ diff --git a/API/v1/office/stompjes/POST Stomp user.md b/API/v1/office/stompjes/POST Stomp user.md index 99fc066..c0bebb9 100644 --- a/API/v1/office/stompjes/POST Stomp user.md +++ b/API/v1/office/stompjes/POST Stomp user.md @@ -1,9 +1,11 @@ # POST Stomp user This API call adds a stomp to a user. + #### Location ``` /api/v1/office/stompjes/ ``` + #### Permissions required `ofice-stompjes-canstomp` RW diff --git a/API/v1/portal-management/configure/PUT Portal settings.md b/API/v1/portal-management/configure/PUT Portal settings.md new file mode 100644 index 0000000..243d827 --- /dev/null +++ b/API/v1/portal-management/configure/PUT Portal settings.md @@ -0,0 +1,63 @@ +# PUT Portal settings +This PUT call configures the global Sentri settings. + +#### Location +``` +/api/v1/portal-management/configure/ +``` + +#### Permissions required +`admin-portalsettings` RW + +#### Body parameters +| Parameter | Type | Required | Description | +| -------------------- | ------ | -------- | ------------------------------------------------------------------ | +| portal_uuid | uuid | yes | Unique id of Sentri instance. | +| portal_name | string | yes | The name of the portal. | +| portal_provider_name | string | yes | The name of the Sentri provider | +| admin_auth_methods | string | yes | The authentication method. Currently supports only `database_auth` | + +### Example Body (json) +```json +{ + "portal_uuid": "5219edbb-512d-11f1-8bac-bc2411125ba4", + "portal_name": "Sentri", + "portal_provider_name": "Your company name", + "admin_auth_methods": "database_auth" +} +``` + +### Example Request +```php +$curl = curl_init(); + +curl_setopt_array($curl, [ + CURLOPT_URL => $baseUrl . '/api/v1/portal-management/configure/', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $json_payload, + CURLOPT_HTTPHEADER => [ + 'Authorization: Bearer ' . $token, + 'Content-Type: application/json', + 'X-HTTP-Method-Override: PUT' + ], +]); + +$response = curl_exec($curl); +$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + +if ($response === false) { + echo curl_error($curl); +} + +curl_close($curl); +``` + +### Example Response +```json +"portal settings updated successfully." +``` + +#### Known errors or issues. +None are known at the time +If you do encounter issues and get an http code in return, check the response codes on this page. \ No newline at end of file diff --git a/API/v1/portal-management/group-permissions/PUT Group permissions.md b/API/v1/portal-management/group-permissions/PUT Group permissions.md new file mode 100644 index 0000000..6207ea4 --- /dev/null +++ b/API/v1/portal-management/group-permissions/PUT Group permissions.md @@ -0,0 +1,63 @@ +# PUT Group permissions +This PUT request updates the permissions of a user group. + +You can only modify a group's permissions if your group's weight is equal to or higher than the weight of the group being modified. + +#### Location +``` +/api/v1/portal-management/group-permissions/ +``` + +#### Permissions required +`admin-access-control-permissions` RW + +#### Body parameters +| Parameter | Type | Required | Description | +| ---------------- | ---- | -------- | ----------------------------------------- | +| permission_uuid | uuid | yes | Unique id of the permission. | +| user_group_uuid | uuid | yes | Unique id of the user group. | +| permission_value | enum | yes | The permission value (`NA`, `RO` or `RW`) | + +### Example Body (json) +```json +{ + "permission_uuid": "11abc93d-c265-11f0-95da-7e99ed98b725", + "user_group_uuid": "5c1f0102-51ea-11f1-8bac-bc2411125ba4", + "permission_value": "RO" +} +``` + +### Example Request +```php +$curl = curl_init(); + +curl_setopt_array($curl, [ + CURLOPT_URL => $baseUrl . '/api/v1/portal-management/group-permissions/', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $json_payload, + CURLOPT_HTTPHEADER => [ + 'Authorization: Bearer ' . $token, + 'Content-Type: application/json', + 'X-HTTP-Method-Override: PUT' + ], +]); + +$response = curl_exec($curl); +$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + +if ($response === false) { + echo curl_error($curl); +} + +curl_close($curl); +``` + +### Example Response +```json +"Access rights changed successfully." +``` + +#### Known errors or issues. +None are known at the time +If you do encounter issues and get an http code in return, check the response codes on this page. \ No newline at end of file diff --git a/API/v1/portal-management/mail/configure/PUT Mail settings.md b/API/v1/portal-management/mail/configure/PUT Mail settings.md new file mode 100644 index 0000000..1fda5f3 --- /dev/null +++ b/API/v1/portal-management/mail/configure/PUT Mail settings.md @@ -0,0 +1,73 @@ +# PUT Mail settings +This PUT request updates the mail settings. + +#### Location +``` +/api/v1/portal-management/mail/configure/ +``` + +#### Permissions required +`admin-mailsettings` RW + +#### Body parameters +| Parameter | Type | Required | Description | +| ----------------- | ------- | -------- | ---------------------------------------------------- | +| portal_uuid | uuid | yes | Unique id of the portal. | +| mail_from_name | string | yes | Mail from name. | +| mail_from_address | email | yes | Mail from address. | +| mail_smtp_host | string | yes | SMTP FQDN hostname. | +| mail_smtp_secure | enum | yes | Secure connection type. Either `tls`, `ssl` or `no`. | +| mail_smtp_port | integer | yes | Mail server port number. Default `587` or `25`. | +| mail_smtp_auth | boolean | yes | Use SMTP authentication. | +| mail_smtp_user | string | yes | SMTP authentication user. | +| mail_smtp_pass | string | yes | SMTP authentication password. | + +### Example Body (json) +```json +{ + "portal_uuid": "11abc93d-c265-11f0-95da-7e99ed98b725", + "mail_from_name": "Sentri Company", + "mail_from_address": "sentri@company.com", + "mail_smtp_host": "smtp.company.com", + "mail_smtp_secure": "tls", + "mail_smtp_port": 587, + "mail_smtp_auth": true, + "mail_smtp_user": "smtpuser", + "mail_smtp_pass": "securepassword" +} +``` + +### Example Request +```php +$curl = curl_init(); + +curl_setopt_array($curl, [ + CURLOPT_URL => $baseUrl . '/api/v1/portal-management/mail/configure/', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $json_payload, + CURLOPT_HTTPHEADER => [ + 'Authorization: Bearer ' . $token, + 'Content-Type: application/json', + 'X-HTTP-Method-Override: PUT' + ], +]); + +$response = curl_exec($curl); +$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + +if ($response === false) { + echo curl_error($curl); +} + +curl_close($curl); +``` + +### Example Response +```json +"mail settings updated successfully." +``` + +#### Known errors or issues. +None are known at the time +If you do encounter issues and get an http code in return, check the response codes on this page. \ No newline at end of file diff --git a/API/v1/portal-management/mail/test/POST Send test mail.md b/API/v1/portal-management/mail/test/POST Send test mail.md new file mode 100644 index 0000000..cb2da0d --- /dev/null +++ b/API/v1/portal-management/mail/test/POST Send test mail.md @@ -0,0 +1,56 @@ +# POST Send test mail +This API call will send an test email to the given mail address. + +#### Location +``` +/api/v1/portal-management/mail/test/ +``` + +#### Permissions required +`ofice-stompjes-canstomp` RW + +#### Body parameters +| Parameter | Type | Required | Description | +| --------- | ----- | -------- | -------------------------------------------- | +| mailt_to | email | yes | The mail address to send the test email to. | + +### Example Body (json) +```json +{ + "mail_to": "test@company.com", +} +``` + +### Example Request +```php +$curl = curl_init(); + +curl_setopt_array($curl, [ + CURLOPT_URL => $baseUrl . '/api/v1/portal-management/mail/test/', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $json_payload, + CURLOPT_HTTPHEADER => [ + 'Authorization: Bearer ' . $token, + 'Content-Type: application/json', + ], +]); + +$response = curl_exec($curl); +$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + +if ($response === false) { + echo curl_error($curl); +} + +curl_close($curl); +``` + +### Example Response +```json +"The test email was sent." +``` + +#### Known errors or issues. +None are known at the time +If you do encounter issues and get an http code in return, check the response codes on this page. \ No newline at end of file