More API call documentation

This commit is contained in:
2026-06-08 22:30:58 +02:00
parent 3e7f38c497
commit 697f0cc1f9
7 changed files with 259 additions and 0 deletions

View File

@@ -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.

View File

@@ -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.