updated API documentation
This commit is contained in:
@@ -19,3 +19,8 @@ c8aaf11d-e10e-11f0-9b16-00155d00153f.83f0383262a4875f6c6d4bb5aa8577818ca7f71cb2b
|
|||||||
When you encounter a problem with the API, you will most likely receive an HTTP status code in the response. This code can help indicate the nature of the issue.
|
When you encounter a problem with the API, you will most likely receive an HTTP status code in the response. This code can help indicate the nature of the issue.
|
||||||
### Response codes
|
### Response codes
|
||||||
These are some of the response codes you may receive when making a call to the API:
|
These are some of the response codes you may receive when making a call to the API:
|
||||||
|
|
||||||
|
## Method override
|
||||||
|
Some web servers (such as Nginx) may restrict direct use of PUT and DELETE requests, which can result in a 405 Method Not Allowed response.
|
||||||
|
|
||||||
|
To work around this limitation, you can send a POST request and include the `X-HTTP-Method-Override` header to indicate the intended HTTP method (e.g., PUT or DELETE). This will be reflected in the API request examples.
|
||||||
62
API/v1/customers/companies/PUT Activate.md
Normal file
62
API/v1/customers/companies/PUT Activate.md
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# PUT Activate company
|
||||||
|
Companies are imported into Sentri from external systems. Before a company can be used within Sentri, it must be activated.
|
||||||
|
|
||||||
|
This API call activates a company by changing its status from inactive to active.
|
||||||
|
|
||||||
|
#### Location
|
||||||
|
```
|
||||||
|
/api/v1/customers/companies/activate/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Permissions required
|
||||||
|
`customers-companies` RW
|
||||||
|
|
||||||
|
#### Body parameters
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| ------------- | ------ | -------- | ---------------------------------------------- |
|
||||||
|
| 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)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"company_uuid": "e0a60eba-52f6-11f1-8bcc-bc2411125ba4",
|
||||||
|
"copmany_state": "active",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Request
|
||||||
|
```php
|
||||||
|
$curl = curl_init();
|
||||||
|
|
||||||
|
curl_setopt_array($curl, [
|
||||||
|
CURLOPT_URL => $baseUrl . '/api/v1/customers/companies/activate/',
|
||||||
|
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
|
||||||
|
"company state successfully updated"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 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.
|
||||||
56
API/v1/office/stompjes/DELETE Stomp.md
Normal file
56
API/v1/office/stompjes/DELETE Stomp.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# DELETE Stomp
|
||||||
|
This API call deletes a stomp from a user.
|
||||||
|
#### Location
|
||||||
|
```
|
||||||
|
/api/v1/office/stompjes/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Permissions required
|
||||||
|
`office-stompjes` RW
|
||||||
|
|
||||||
|
#### Body parameters
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| ---------- | ------ | -------- | ---------------------- |
|
||||||
|
| stomp_uuid | string | yes | Unique id of the stomp |
|
||||||
|
|
||||||
|
### Example Body (json)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"stomp_uuid": "e0a60eba-52f6-11f1-8bcc-bc2411125ba4",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Request
|
||||||
|
```php
|
||||||
|
$curl = curl_init();
|
||||||
|
|
||||||
|
curl_setopt_array($curl, [
|
||||||
|
CURLOPT_URL => $baseUrl . '/api/v1/office/stompjes/',
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_POST => true,
|
||||||
|
CURLOPT_POSTFIELDS => $json_payload,
|
||||||
|
CURLOPT_HTTPHEADER => [
|
||||||
|
'Authorization: Bearer ' . $token,
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'X-HTTP-Method-Override: DELETE'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$response = curl_exec($curl);
|
||||||
|
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||||
|
|
||||||
|
if ($response === false) {
|
||||||
|
echo curl_error($curl);
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_close($curl);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Response
|
||||||
|
```json
|
||||||
|
"Stomp removed."
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 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.
|
||||||
54
API/v1/office/stompjes/POST Stomp user.md
Normal file
54
API/v1/office/stompjes/POST Stomp user.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# POST Stomp user
|
||||||
|
This API call adds a stomp to a user.
|
||||||
|
#### Location
|
||||||
|
```
|
||||||
|
/api/v1/office/stompjes/
|
||||||
|
```
|
||||||
|
#### Permissions required
|
||||||
|
`ofice-stompjes-canstomp` RW
|
||||||
|
|
||||||
|
#### Body parameters
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| --------- | ------ | -------- | ----------------------------------- |
|
||||||
|
| user_uuid | string | yes | Unique id of the user to be stomped |
|
||||||
|
|
||||||
|
### Example Body (json)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"user_uuid": "5219edbb-512d-11f1-8bac-bc2411125ba4",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Request
|
||||||
|
```php
|
||||||
|
$curl = curl_init();
|
||||||
|
|
||||||
|
curl_setopt_array($curl, [
|
||||||
|
CURLOPT_URL => $baseUrl . '/api/v1/office/stompjes/',
|
||||||
|
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
|
||||||
|
"Stomp added."
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 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.
|
||||||
@@ -130,7 +130,7 @@ curl_setopt_array($curl, array(
|
|||||||
"Authorization: Bearer <API your Bearer token>",
|
"Authorization: Bearer <API your Bearer token>",
|
||||||
],
|
],
|
||||||
CURLOPT_POST => true,
|
CURLOPT_POST => true,
|
||||||
CURLOPT_POSTFIELDS =>'<json payload body>',
|
CURLOPT_POSTFIELDS => '<json payload body>',
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
|
|||||||
@@ -76,6 +76,6 @@ Next, configure the SMTP connection in [[Mail|Mail]] under Portal Management so
|
|||||||
|
|
||||||
Finally, enable the [[index#Modules|modules]] you want to use in [[Portal Management/Settings/Modules|Modules]] under Portal Management.
|
Finally, enable the [[index#Modules|modules]] you want to use in [[Portal Management/Settings/Modules|Modules]] under Portal Management.
|
||||||
#### Create users and check permissions
|
#### Create users and check permissions
|
||||||
Go to the
|
Go to the access control and create new users. If you want you could take a look at altering the permissions.
|
||||||
#### Getting started
|
#### Getting started
|
||||||
After completing the installation, continue with the [[Getting Started]] guide to configure and begin using Sentri.
|
After completing the installation, continue with the [[Getting Started]] guide to configure and begin using Sentri.
|
||||||
|
|||||||
@@ -84,8 +84,10 @@
|
|||||||
`21-12-2025`
|
`21-12-2025`
|
||||||
Initial release.
|
Initial release.
|
||||||
## Roadmap
|
## Roadmap
|
||||||
- Rename the servers module to Inventory so it supports other things aswell.
|
- Rename the servers module to Inventory so it supports other things as well.
|
||||||
- Docker container.
|
- Docker container.
|
||||||
|
- Use of CDN's for CSS and other static content.
|
||||||
|
- security.txt + PGP key
|
||||||
## Roadmap features
|
## Roadmap features
|
||||||
- Self-destructing message
|
- Self-destructing message
|
||||||
- SSO/SAML/User provisioning.
|
- SSO/SAML/User provisioning.
|
||||||
|
|||||||
Reference in New Issue
Block a user