Introduction
This is the API documentation for AIC Online Backend.
This documentation will provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {ACCESS_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Address
Retrieve a list of addresses or a single address.
requires authentication
Returns either all addresses for the current workspace or a specific address with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '10',
'page' => '1',
'with[0]' => 'contacts',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/address/1?per_page=10&page=1&with[]=contacts" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/address/1"
);
const params = {
"per_page": "10",
"page": "1",
"with[0]": "contacts",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"architecto"
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"street": "Main St",
"housenumber": "123",
"zip": "12345",
"city": "Sample City",
"region": "Sample Region",
"country": "Sample Country",
"lat": 52.52,
"lng": 13.405,
"attributes": [],
// ...other fields...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new address.
requires authentication
Validates the request data and creates a new address record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'street' => '"Main St"',
'housenumber' => '"123"',
'zip' => '"12345"',
'city' => '"Sample City"',
'region' => '"Sample Region"',
'country' => '"Sample Country"',
'lat' => 52.52,
'lng' => 13.405,
'attributes' => [
'architecto',
],
'object_id' => 16,
'object_type' => 'architecto',
'connection_type' => 'architecto',
'connection_data' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/address" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"street\": \"\\\"Main St\\\"\",
\"housenumber\": \"\\\"123\\\"\",
\"zip\": \"\\\"12345\\\"\",
\"city\": \"\\\"Sample City\\\"\",
\"region\": \"\\\"Sample Region\\\"\",
\"country\": \"\\\"Sample Country\\\"\",
\"lat\": 52.52,
\"lng\": 13.405,
\"attributes\": [
\"architecto\"
],
\"object_id\": 16,
\"object_type\": \"architecto\",
\"connection_type\": \"architecto\",
\"connection_data\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/address"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"street": "\"Main St\"",
"housenumber": "\"123\"",
"zip": "\"12345\"",
"city": "\"Sample City\"",
"region": "\"Sample Region\"",
"country": "\"Sample Country\"",
"lat": 52.52,
"lng": 13.405,
"attributes": [
"architecto"
],
"object_id": 16,
"object_type": "architecto",
"connection_type": "architecto",
"connection_data": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "address created successfully",
"data": {
"data": {
"id": 1,
"street": "Main St",
// ...other fields...
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing address.
requires authentication
Validates the request data and updates the specified address record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'street' => '"Main St"',
'housenumber' => '"123"',
'zip' => '"12345"',
'city' => '"Sample City"',
'region' => '"Sample Region"',
'country' => '"Sample Country"',
'lat' => 52.52,
'lng' => 13.405,
'attributes' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/address/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"street\": \"\\\"Main St\\\"\",
\"housenumber\": \"\\\"123\\\"\",
\"zip\": \"\\\"12345\\\"\",
\"city\": \"\\\"Sample City\\\"\",
\"region\": \"\\\"Sample Region\\\"\",
\"country\": \"\\\"Sample Country\\\"\",
\"lat\": 52.52,
\"lng\": 13.405,
\"attributes\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/address/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"street": "\"Main St\"",
"housenumber": "\"123\"",
"zip": "\"12345\"",
"city": "\"Sample City\"",
"region": "\"Sample Region\"",
"country": "\"Sample Country\"",
"lat": 52.52,
"lng": 13.405,
"attributes": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "address updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an address.
requires authentication
Removes the specified address from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/address/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/address/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "address deletion successful"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Connect an address to another object.
requires authentication
Validates the request data and connects the address to the specified object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/connect';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 2,
'object_type' => '"App\\\\Models\\\\Contact"',
'connection_type' => '"primary"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/address/1/connect" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": 2,
\"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\Contact\\\"\",
\"connection_type\": \"\\\"primary\\\"\"
}"
const url = new URL(
"http://localhost/api/address/1/connect"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": 2,
"object_type": "\"App\\\\Models\\\\Contact\"",
"connection_type": "\"primary\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "address connected to object"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Disconnect an address from another object.
requires authentication
Validates the request data and disconnects the address from the specified object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/disconnect';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 2,
'object_type' => '"App\\\\Models\\\\Contact"',
'connection_type' => '"primary"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/address/1/disconnect" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": 2,
\"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\Contact\\\"\",
\"connection_type\": \"\\\"primary\\\"\"
}"
const url = new URL(
"http://localhost/api/address/1/disconnect"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": 2,
"object_type": "\"App\\\\Models\\\\Contact\"",
"connection_type": "\"primary\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "address disconnected from object"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the connection data between an address and another object.
requires authentication
Validates the request data and updates the connection information.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/update-connection';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 2,
'object_type' => '"App\\\\Models\\\\Contact"',
'connection_type' => '"primary"',
'data' => [
'type' => '"secondary"',
'data' => [
'architecto',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/address/1/update-connection" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": 2,
\"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\Contact\\\"\",
\"connection_type\": \"\\\"primary\\\"\",
\"data\": {
\"type\": \"\\\"secondary\\\"\",
\"data\": [
\"architecto\"
]
}
}"
const url = new URL(
"http://localhost/api/address/1/update-connection"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": 2,
"object_type": "\"App\\\\Models\\\\Contact\"",
"connection_type": "\"primary\"",
"data": {
"type": "\"secondary\"",
"data": [
"architecto"
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "address connection updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get weather data for an address.
requires authentication
Returns weather information for the specified address.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/weather';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/address/1/weather" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/address/1/weather"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "weather data",
"data": {
// weather data fields
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Auth
Register a new user and send activation mail.
Creates a new user for the specified workspace, assigns a role and group, and sends an activation email.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/register';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"user@example.com"',
'password' => '|]|{+-',
'tfatype' => '"email"',
'firstname' => '"John"',
'lastname' => '"Doe"',
'salutation' => '"M"',
'type' => '"customer"',
'subtype' => 'architecto',
'workspace' => 1,
'google2fa_secret' => 'architecto',
'group_id' => 2,
'active_language' => '"en"',
'company' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"user@example.com\\\"\",
\"password\": \"|]|{+-\",
\"tfatype\": \"\\\"email\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"salutation\": \"\\\"M\\\"\",
\"type\": \"\\\"customer\\\"\",
\"subtype\": \"architecto\",
\"workspace\": 1,
\"google2fa_secret\": \"architecto\",
\"group_id\": 2,
\"active_language\": \"\\\"en\\\"\",
\"company\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/auth/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"user@example.com\"",
"password": "|]|{+-",
"tfatype": "\"email\"",
"firstname": "\"John\"",
"lastname": "\"Doe\"",
"salutation": "\"M\"",
"type": "\"customer\"",
"subtype": "architecto",
"workspace": 1,
"google2fa_secret": "architecto",
"group_id": 2,
"active_language": "\"en\"",
"company": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "user created successfully",
"data": {
"id": 1
}
}
Example response (400):
{
"status": false,
"message": "user already exists"
}
Example response (404):
{
"success": false,
"message": "workspace does not exist"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Authenticate user and send two-factor information.
Checks email and password, sends two-factor authentication info if required, and returns user data.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/login';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace' => 1,
'email' => '"user@example.com"',
'password' => '|]|{+-',
'group_id' => 2,
'uuid1' => 'architecto',
'uuid2' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace\": 1,
\"email\": \"\\\"user@example.com\\\"\",
\"password\": \"|]|{+-\",
\"group_id\": 2,
\"uuid1\": \"architecto\",
\"uuid2\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace": 1,
"email": "\"user@example.com\"",
"password": "|]|{+-",
"group_id": 2,
"uuid1": "architecto",
"uuid2": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "login successful, user exists",
"data": {
"user": {
"id": 1,
"tfatype": "email"
}
}
}
Example response (401):
{
"success": false,
"message": "invalid username or password"
}
Example response (429):
{
"success": false,
"message": "too many login attempts, please try again in X minutes"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send password reset email.
Sends an email to the user with instructions to reset their password.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/forgotpassword';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"user@example.com"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/forgotpassword" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"user@example.com\\\"\"
}"
const url = new URL(
"http://localhost/api/auth/forgotpassword"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"user@example.com\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "email to reset password successfully sent"
}
Example response (404):
{
"success": false,
"message": "user does not exist"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Verify two-factor token and log in the user.
Validates the provided one-time password for two-factor authentication and logs in the user.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/tfalogin';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'user_id' => 1,
'one_time_password' => 'architecto',
'uuid1' => 'architecto',
'uuid2' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/tfalogin" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 1,
\"one_time_password\": \"architecto\",
\"uuid1\": \"architecto\",
\"uuid2\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/auth/tfalogin"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": 1,
"one_time_password": "architecto",
"uuid1": "architecto",
"uuid2": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "two-factor authentication successful"
}
Example response (401):
{
"success": false,
"message": "invalid or expired two-factor token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Log in using a token.
Authenticates the user using a previously issued token.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/token';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'token' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/auth/token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "login successful",
"data": {
"user_id": 1
}
}
Example response (401):
{
"success": false,
"message": "invalid token"
}
Example response (429):
{
"success": false,
"message": "too many login attempts, please try again in X minutes"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Change the active group of the authenticated user.
requires authentication
Sets the user's active group to the specified group if the user has access.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/group';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'group_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/group" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"group_id\": 2
}"
const url = new URL(
"http://localhost/api/auth/group"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"group_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "group changed successfully",
"data": {
"user": {},
"group": {}
}
}
Example response (403):
{
"success": false,
"message": "user does not have access to this group"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Refresh the access token for the authenticated user.
requires authentication
Returns a new access token for the currently authenticated user.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/refresh';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/refresh" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/auth/refresh"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "access token refreshed successfully",
"data": {
"user": {}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Log out the current user and invalidate the token.
requires authentication
Invalidates the current user's authentication token and logs them out.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/logout';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/auth/logout" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/auth/logout"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "logout successful"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Benchmark
Compare a policy with a benchmark.
requires authentication
Compares the specified policy with the benchmark based on insurance sum, building type, gustavo, and group.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/compare';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurance_sum' => 200000.0,
'building_type' => '"house"',
'gustavo' => true,
'group_id' => 2,
'policy_id' => 5,
'workspace_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/benchmark/compare" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurance_sum\": 200000,
\"building_type\": \"\\\"house\\\"\",
\"gustavo\": true,
\"group_id\": 2,
\"policy_id\": 5,
\"workspace_id\": 1
}"
const url = new URL(
"http://localhost/api/benchmark/compare"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurance_sum": 200000,
"building_type": "\"house\"",
"gustavo": true,
"group_id": 2,
"policy_id": 5,
"workspace_id": 1
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "benchmark compared successfully",
"data": {
// comparison result data
}
}
Example response (404):
{
"success": false,
"message": "no benchmark found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve a list of all benchmarks or a single benchmark.
requires authentication
Returns either all benchmarks for the current workspace or a specific benchmark with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '10',
'page' => '1',
'with[0]' => 'benchmarkProducts',
'with[1]' => 'group',
'paged' => '1',
'shortresult' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/benchmark/1?per_page=10&page=1&with[]=benchmarkProducts&with[]=group&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/benchmark/1"
);
const params = {
"per_page": "10",
"page": "1",
"with[0]": "benchmarkProducts",
"with[1]": "group",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"name": "Sample Benchmark",
"group_id": 2,
"active": true,
"insurance_sum_from": 100000,
"insurance_sum_to": 500000,
"building_type": [
"house"
],
"gustavo": true,
"global": false,
"benchmarkProducts": [],
"group": {}
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new benchmark.
requires authentication
Validates the request data and creates a new benchmark record with associated products.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Sample Benchmark"',
'group_id' => 2,
'active' => true,
'insurance_sum_from' => 100000.0,
'insurance_sum_to' => 500000.0,
'building_type' => [
'house',
],
'gustavo' => true,
'global' => false,
'benchmark_products' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/benchmark" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Sample Benchmark\\\"\",
\"group_id\": 2,
\"active\": true,
\"insurance_sum_from\": 100000,
\"insurance_sum_to\": 500000,
\"building_type\": [
\"house\"
],
\"gustavo\": true,
\"global\": false,
\"benchmark_products\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/benchmark"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Sample Benchmark\"",
"group_id": 2,
"active": true,
"insurance_sum_from": 100000,
"insurance_sum_to": 500000,
"building_type": [
"house"
],
"gustavo": true,
"global": false,
"benchmark_products": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "benchmark created successfully",
"data": {
"data": {
"id": 1,
"name": "Sample Benchmark",
// ...other fields...
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing benchmark.
requires authentication
Validates the request data and updates the specified benchmark record and its products.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Benchmark"',
'group_id' => 2,
'active' => true,
'insurance_sum_from' => 100000.0,
'insurance_sum_to' => 500000.0,
'building_type' => [
'house',
],
'gustavo' => true,
'global' => false,
'benchmark_products' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/benchmark/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Benchmark\\\"\",
\"group_id\": 2,
\"active\": true,
\"insurance_sum_from\": 100000,
\"insurance_sum_to\": 500000,
\"building_type\": [
\"house\"
],
\"gustavo\": true,
\"global\": false,
\"benchmark_products\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/benchmark/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Benchmark\"",
"group_id": 2,
"active": true,
"insurance_sum_from": 100000,
"insurance_sum_to": 500000,
"building_type": [
"house"
],
"gustavo": true,
"global": false,
"benchmark_products": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "benchmark updated successfully",
"data": {
"data": {
"id": 1,
"name": "Updated Benchmark",
// ...other fields...
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a benchmark.
requires authentication
Removes the specified benchmark from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/benchmark/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/benchmark/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Canton
Retrieve a list of all cantons or a single canton.
requires authentication
Returns all cantons ordered by name, or a specific canton by name, short, or ID, including related canton indexes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'name' => '"Zürich"',
'short' => '"ZH"',
],
'json' => [
'name' => 'architecto',
'short' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/canton/1?name=%22Z%C3%BCrich%22&short=%22ZH%22" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"architecto\",
\"short\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/canton/1"
);
const params = {
"name": ""Zürich"",
"short": ""ZH"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "architecto",
"short": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Zürich",
"short": "ZH",
"cantonIndexes": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new canton.
requires authentication
Validates the request data and creates a new canton record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Zürich"',
'short' => '"ZH"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/canton" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Zürich\\\"\",
\"short\": \"\\\"ZH\\\"\"
}"
const url = new URL(
"http://localhost/api/canton"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Zürich\"",
"short": "\"ZH\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "canton created successfully",
"data": {
"id": 1,
"name": "Zürich",
"short": "ZH"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing canton.
requires authentication
Validates the request data and updates the specified canton record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Bern"',
'short' => '"BE"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/canton/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Bern\\\"\",
\"short\": \"\\\"BE\\\"\"
}"
const url = new URL(
"http://localhost/api/canton/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Bern\"",
"short": "\"BE\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "canton updated successfully",
"data": {
"id": 1,
"name": "Bern",
"short": "BE"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a canton.
requires authentication
Removes the specified canton from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/canton/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/canton/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "canton deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Canton Index
Retrieve a list of all canton indexes for a canton or a single index.
requires authentication
Returns all indexes for the specified canton or a specific index with its related canton.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index/5';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/canton/1/index/5" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/canton/1/index/5"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 5,
"year": 2023,
"index": 102,
"canton_id": 1,
"canton": {
"id": 1,
"name": "Zürich",
"short": "ZH"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new canton index for a canton.
requires authentication
Validates the request data and creates a new index for the specified canton.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'year' => 2023,
'index' => 102,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/canton/1/index" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"year\": 2023,
\"index\": 102
}"
const url = new URL(
"http://localhost/api/canton/1/index"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"year": 2023,
"index": 102
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "canton index created successfully",
"data": {
"data": {
"id": 5,
"year": 2023,
"index": 102,
"canton_id": 1
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing canton index.
requires authentication
Validates the request data and updates the specified canton index.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'year' => 2024,
'index' => 105,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/canton/1/index/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"year\": 2024,
\"index\": 105
}"
const url = new URL(
"http://localhost/api/canton/1/index/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"year": 2024,
"index": 105
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "canton index updated successfully",
"data": {
"data": {
"id": 5,
"year": 2024,
"index": 105,
"canton_id": 1
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a canton index.
requires authentication
Removes the specified canton index from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/canton/1/index/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/canton/1/index/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "canton index deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Collection
Retrieve collections for a specific user.
requires authentication
Returns all collections associated with the specified user, paginated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/user/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/collection/user/1?per_page=15&page=1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/collection/user/1"
);
const params = {
"per_page": "15",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"name": "Sample Collection",
"group_id": 2
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing collection.
requires authentication
Validates the request data and updates the specified collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Collection"',
'group_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Collection\\\"\",
\"group_id\": 3
}"
const url = new URL(
"http://localhost/api/collection/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Collection\"",
"group_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "collection updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a collection.
requires authentication
Removes the specified collection from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/collection/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/collection/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "collection deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve a list of all collections or a single collection.
requires authentication
Returns all collections for the current workspace, optionally paginated, or a specific collection with its files.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'paged' => '1',
'per_page' => '15',
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/collection/1?paged=1&per_page=15&page=1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/collection/1"
);
const params = {
"paged": "1",
"per_page": "15",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Sample Collection",
"group_id": 2,
"files": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Attach objects to a collection.
requires authentication
Validates the request data and attaches the specified objects to the collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/object';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'objects' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection/1/object" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"objects\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/collection/1/object"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"objects": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "objects successfully added to collection",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Detach objects from a collection.
requires authentication
Validates the request data and detaches the specified objects from the collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/object';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'objects' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/collection/1/object" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"objects\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/collection/1/object"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"objects": [
"architecto"
]
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "objects successfully removed from collection",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add users to a collection.
requires authentication
Validates the request data and adds the specified users to the collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/user';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'users' => [
2,
3,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection/1/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"users\": [
2,
3
]
}"
const url = new URL(
"http://localhost/api/collection/1/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"users": [
2,
3
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "users successfully added to collection"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove users from a collection.
requires authentication
Validates the request data and removes the specified users from the collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/user';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'users' => [
2,
3,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/collection/1/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"users\": [
2,
3
]
}"
const url = new URL(
"http://localhost/api/collection/1/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"users": [
2,
3
]
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "users successfully removed from collection"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new collection.
requires authentication
Validates the request data and creates a new collection for the specified group.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Sample Collection"',
'group_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Sample Collection\\\"\",
\"group_id\": 2
}"
const url = new URL(
"http://localhost/api/collection"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Sample Collection\"",
"group_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "collection created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Invite a user to a collection via email.
requires authentication
Sends an invitation email to the specified address to join the collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/invite';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"invitee@example.com"',
'salutation' => '"Mr"',
'firstname' => '"John"',
'lastname' => '"Doe"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection/1/invite" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"invitee@example.com\\\"\",
\"salutation\": \"\\\"Mr\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\"
}"
const url = new URL(
"http://localhost/api/collection/1/invite"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"invitee@example.com\"",
"salutation": "\"Mr\"",
"firstname": "\"John\"",
"lastname": "\"Doe\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "invite sent successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Authorize a collection invite using a code.
requires authentication
Validates the invite code and adds the user to the collection.
Add group managers to a collection.
requires authentication
Validates the request data and adds all managers of the specified group to the collection.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/addGroupManagers';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'group_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection/1/addGroupManagers" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"group_id\": 2
}"
const url = new URL(
"http://localhost/api/collection/1/addGroupManagers"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"group_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Group managers successfully added to collection"
}
Example response (403):
{
"success": false,
"message": "You are not allowed to add group managers to this collection"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reject a collection invite.
requires authentication
Notifies the inviting user and deletes the invite.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/rejectInvite/2';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/collection/rejectInvite/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/collection/rejectInvite/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "invite rejected successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Contact
Retrieve a list of contacts or a single contact.
requires authentication
Returns all contacts for the current workspace or group, or a specific contact with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '10',
'page' => '1',
],
'json' => [
'per_page' => 16,
'page' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/contact/1?per_page=10&page=1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16
}"
const url = new URL(
"http://localhost/api/contact/1"
);
const params = {
"per_page": "10",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@example.com",
// ...other fields...
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new contact.
requires authentication
Validates the request data and creates a new contact record. Optionally connects the contact to an object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'salutation' => '"Mr"',
'firstname' => '"John"',
'lastname' => '"Doe"',
'company' => '"Acme Inc."',
'email' => '"john.doe@example.com"',
'phone' => '"+123456789"',
'mobile' => '"+987654321"',
'fax' => '"+1122334455"',
'homepage' => '"https://acme.com"',
'address_id' => 2,
'street' => '"Main St"',
'housenumber' => '"42"',
'zip' => '"12345"',
'city' => '"Sample City"',
'region' => '"Sample Region"',
'country' => '"Sample Country"',
'lat' => '"52.52"',
'lng' => '"13.405"',
'object_id' => 16,
'object_type' => 'architecto',
'connection_type' => 'architecto',
'connection_subtype' => 'architecto',
'connection_data' => [
'architecto',
],
'attributes' => [
'architecto',
],
'workspace_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/contact" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"salutation\": \"\\\"Mr\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"company\": \"\\\"Acme Inc.\\\"\",
\"email\": \"\\\"john.doe@example.com\\\"\",
\"phone\": \"\\\"+123456789\\\"\",
\"mobile\": \"\\\"+987654321\\\"\",
\"fax\": \"\\\"+1122334455\\\"\",
\"homepage\": \"\\\"https:\\/\\/acme.com\\\"\",
\"address_id\": 2,
\"street\": \"\\\"Main St\\\"\",
\"housenumber\": \"\\\"42\\\"\",
\"zip\": \"\\\"12345\\\"\",
\"city\": \"\\\"Sample City\\\"\",
\"region\": \"\\\"Sample Region\\\"\",
\"country\": \"\\\"Sample Country\\\"\",
\"lat\": \"\\\"52.52\\\"\",
\"lng\": \"\\\"13.405\\\"\",
\"object_id\": 16,
\"object_type\": \"architecto\",
\"connection_type\": \"architecto\",
\"connection_subtype\": \"architecto\",
\"connection_data\": [
\"architecto\"
],
\"attributes\": [
\"architecto\"
],
\"workspace_id\": 1
}"
const url = new URL(
"http://localhost/api/contact"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"salutation": "\"Mr\"",
"firstname": "\"John\"",
"lastname": "\"Doe\"",
"company": "\"Acme Inc.\"",
"email": "\"john.doe@example.com\"",
"phone": "\"+123456789\"",
"mobile": "\"+987654321\"",
"fax": "\"+1122334455\"",
"homepage": "\"https:\/\/acme.com\"",
"address_id": 2,
"street": "\"Main St\"",
"housenumber": "\"42\"",
"zip": "\"12345\"",
"city": "\"Sample City\"",
"region": "\"Sample Region\"",
"country": "\"Sample Country\"",
"lat": "\"52.52\"",
"lng": "\"13.405\"",
"object_id": 16,
"object_type": "architecto",
"connection_type": "architecto",
"connection_subtype": "architecto",
"connection_data": [
"architecto"
],
"attributes": [
"architecto"
],
"workspace_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "contact created successfully",
"data": {
"data": {
"id": 1,
"firstname": "John",
// ...other fields...
},
"newGroup": false
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing contact.
requires authentication
Validates the request data and updates the specified contact record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'salutation' => '"Ms"',
'firstname' => '"Jane"',
'lastname' => '"Doe"',
'company' => '"Acme Inc."',
'email' => '"jane.doe@example.com"',
'phone' => '"+123456789"',
'mobile' => '"+987654321"',
'fax' => '"+1122334455"',
'homepage' => '"https://acme.com"',
'address_id' => 2,
'street' => '"Main St"',
'housenumber' => '"42"',
'zip' => '"12345"',
'city' => '"Sample City"',
'region' => '"Sample Region"',
'country' => '"Sample Country"',
'lat' => '"52.52"',
'lng' => '"13.405"',
'attributes' => [
'architecto',
],
'workspace_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/contact/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"salutation\": \"\\\"Ms\\\"\",
\"firstname\": \"\\\"Jane\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"company\": \"\\\"Acme Inc.\\\"\",
\"email\": \"\\\"jane.doe@example.com\\\"\",
\"phone\": \"\\\"+123456789\\\"\",
\"mobile\": \"\\\"+987654321\\\"\",
\"fax\": \"\\\"+1122334455\\\"\",
\"homepage\": \"\\\"https:\\/\\/acme.com\\\"\",
\"address_id\": 2,
\"street\": \"\\\"Main St\\\"\",
\"housenumber\": \"\\\"42\\\"\",
\"zip\": \"\\\"12345\\\"\",
\"city\": \"\\\"Sample City\\\"\",
\"region\": \"\\\"Sample Region\\\"\",
\"country\": \"\\\"Sample Country\\\"\",
\"lat\": \"\\\"52.52\\\"\",
\"lng\": \"\\\"13.405\\\"\",
\"attributes\": [
\"architecto\"
],
\"workspace_id\": 1
}"
const url = new URL(
"http://localhost/api/contact/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"salutation": "\"Ms\"",
"firstname": "\"Jane\"",
"lastname": "\"Doe\"",
"company": "\"Acme Inc.\"",
"email": "\"jane.doe@example.com\"",
"phone": "\"+123456789\"",
"mobile": "\"+987654321\"",
"fax": "\"+1122334455\"",
"homepage": "\"https:\/\/acme.com\"",
"address_id": 2,
"street": "\"Main St\"",
"housenumber": "\"42\"",
"zip": "\"12345\"",
"city": "\"Sample City\"",
"region": "\"Sample Region\"",
"country": "\"Sample Country\"",
"lat": "\"52.52\"",
"lng": "\"13.405\"",
"attributes": [
"architecto"
],
"workspace_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "contact updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a contact.
requires authentication
Removes the specified contact from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/contact/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/contact/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "contact deletion successful"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Connect a contact to another object.
requires authentication
Validates the request data and connects the contact to the specified object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/connect';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 2,
'object_type' => '"App\\\\Models\\\\User"',
'connection_type' => '"primary"',
'connection_subtype' => '"manager"',
'connection_data' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/contact/1/connect" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": 2,
\"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\User\\\"\",
\"connection_type\": \"\\\"primary\\\"\",
\"connection_subtype\": \"\\\"manager\\\"\",
\"connection_data\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/contact/1/connect"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": 2,
"object_type": "\"App\\\\Models\\\\User\"",
"connection_type": "\"primary\"",
"connection_subtype": "\"manager\"",
"connection_data": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "contact connected to object"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Disconnect a contact from one or more objects.
requires authentication
Validates the request data and disconnects the contact from the specified object(s).
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/disconnect';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 2,
'object_ids' => [
2,
3,
],
'object_type' => '"App\\\\Models\\\\User"',
'connection_type' => '"primary"',
'connection_subtype' => '"manager"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/contact/1/disconnect" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": 2,
\"object_ids\": [
2,
3
],
\"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\User\\\"\",
\"connection_type\": \"\\\"primary\\\"\",
\"connection_subtype\": \"\\\"manager\\\"\"
}"
const url = new URL(
"http://localhost/api/contact/1/disconnect"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": 2,
"object_ids": [
2,
3
],
"object_type": "\"App\\\\Models\\\\User\"",
"connection_type": "\"primary\"",
"connection_subtype": "\"manager\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "contact disconnected from object"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the connection data between a contact and another object.
requires authentication
Validates the request data and updates the connection information.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/update-connection';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 2,
'object_type' => '"App\\\\Models\\\\User"',
'connection_type' => '"primary"',
'connection_subtype' => '"manager"',
'data' => [
'type' => '"secondary"',
'subtype' => '"assistant"',
'data' => [
'architecto',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/contact/1/update-connection" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": 2,
\"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\User\\\"\",
\"connection_type\": \"\\\"primary\\\"\",
\"connection_subtype\": \"\\\"manager\\\"\",
\"data\": {
\"type\": \"\\\"secondary\\\"\",
\"subtype\": \"\\\"assistant\\\"\",
\"data\": [
\"architecto\"
]
}
}"
const url = new URL(
"http://localhost/api/contact/1/update-connection"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": 2,
"object_type": "\"App\\\\Models\\\\User\"",
"connection_type": "\"primary\"",
"connection_subtype": "\"manager\"",
"data": {
"type": "\"secondary\"",
"subtype": "\"assistant\"",
"data": [
"architecto"
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "contact connection updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DamageReport
Download the damage report PDF file.
requires authentication
Downloads the generated PDF file for the specified damage report, or returns an error if not available.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205/download';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/damagereport/205/download" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/damagereport/205/download"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
PDF file download.
Example response (404):
{
"success": false,
"message": "damage report pdf not yet generated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send a damage report document package link by email.
requires authentication
Queues a job to send a document package link for the specified damage report to the given email address.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205/sendzipemail';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_ids' => [
10,
11,
],
'email' => '"recipient@example.com"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/damagereport/205/sendzipemail" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_ids\": [
10,
11
],
\"email\": \"\\\"recipient@example.com\\\"\"
}"
const url = new URL(
"http://localhost/api/damagereport/205/sendzipemail"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_ids": [
10,
11
],
"email": "\"recipient@example.com\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "damage report document package queued successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Invite a user to the documents section of a damage report.
requires authentication
Creates a guest user and sends an invitation to access the documents section of the specified damage report.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205/invite-upload-center';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'salutation' => '"Mr"',
'firstname' => '"John"',
'lastname' => '"Doe"',
'email' => '"john.doe@example.com"',
'folders' => [
1,
2,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/damagereport/205/invite-upload-center" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"salutation\": \"\\\"Mr\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"email\": \"\\\"john.doe@example.com\\\"\",
\"folders\": [
1,
2
]
}"
const url = new URL(
"http://localhost/api/damagereport/205/invite-upload-center"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"salutation": "\"Mr\"",
"firstname": "\"John\"",
"lastname": "\"Doe\"",
"email": "\"john.doe@example.com\"",
"folders": [
1,
2
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "guest invite successfully created",
"user": {
"id": 5,
"email": "john.doe@example.com"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve a list of damage reports or a single damage report.
requires authentication
Returns all damage reports for the current workspace, optionally paginated, or a specific damage report with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'moduleObject',
'with[1]' => 'user',
'with[2]' => 'journals',
'with[3]' => 'files',
'with[4]' => 'policy',
'with[5]' => 'contacts',
'with[6]' => 'addresses',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'files',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/damagereport/205?per_page=15&page=1&with[]=moduleObject&with[]=user&with[]=journals&with[]=files&with[]=policy&with[]=contacts&with[]=addresses&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"files\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/damagereport/205"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "moduleObject",
"with[1]": "user",
"with[2]": "journals",
"with[3]": "files",
"with[4]": "policy",
"with[5]": "contacts",
"with[6]": "addresses",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"files"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Storm Damage",
"user_id": 2,
"policy_id": 3,
"module_object_id": 4,
"contacts": [],
"addresses": [],
// ...other fields...
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve a list of damage reports or a single damage report.
requires authentication
Returns all damage reports for the current workspace, optionally paginated, or a specific damage report with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'moduleObject',
'with[1]' => 'user',
'with[2]' => 'journals',
'with[3]' => 'files',
'with[4]' => 'policy',
'with[5]' => 'contacts',
'with[6]' => 'addresses',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'files',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/damagereport?per_page=15&page=1&with[]=moduleObject&with[]=user&with[]=journals&with[]=files&with[]=policy&with[]=contacts&with[]=addresses&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"files\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/damagereport"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "moduleObject",
"with[1]": "user",
"with[2]": "journals",
"with[3]": "files",
"with[4]": "policy",
"with[5]": "contacts",
"with[6]": "addresses",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"files"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Storm Damage",
"user_id": 2,
"policy_id": 3,
"module_object_id": 4,
"contacts": [],
"addresses": [],
// ...other fields...
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing damage report.
requires authentication
Validates the request data and updates the specified damage report record. Optionally connects contacts and triggers jobs.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Damage"',
'module_object_id' => 5,
'policy_id' => 4,
'contacts' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/damagereport/205" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Damage\\\"\",
\"module_object_id\": 5,
\"policy_id\": 4,
\"contacts\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/damagereport/205"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Damage\"",
"module_object_id": 5,
"policy_id": 4,
"contacts": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "damagereport updated",
"data": {
"data": {
"id": 1,
"name": "Updated Damage"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a damage report.
requires authentication
Removes the specified damage report from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/damagereport/205" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/damagereport/205"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "damagereport deleted"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new damage report.
requires authentication
Validates the request data and creates a new damage report record. Optionally connects contacts and triggers jobs.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Storm Damage"',
'module_object_id' => 4,
'policy_id' => 3,
'contacts' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/damagereport" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Storm Damage\\\"\",
\"module_object_id\": 4,
\"policy_id\": 3,
\"contacts\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/damagereport"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Storm Damage\"",
"module_object_id": 4,
"policy_id": 3,
"contacts": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "damagereport created",
"data": {
"data": {
"id": 1,
"name": "Storm Damage"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DamageTypeModuleProduct
Retrieve a list of all damage type module products or a single damage type module product.
requires authentication
Returns all damage type module products for the current workspace, optionally paginated, or a specific damage type module product with its related module product.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'moduleProduct',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'moduleProduct',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/damagetypemoduleproduct/1?per_page=15&page=1&with[]=moduleProduct&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"moduleProduct\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/damagetypemoduleproduct/1"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "moduleProduct",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"moduleProduct"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"type": "fire",
"module_product_id": 2,
"moduleProduct": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing damage type module product.
requires authentication
Validates the request data and updates the specified damage type module product record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => '"water"',
'module_product_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/damagetypemoduleproduct/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"\\\"water\\\"\",
\"module_product_id\": 3
}"
const url = new URL(
"http://localhost/api/damagetypemoduleproduct/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "\"water\"",
"module_product_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "damage type module product updated",
"data": {
"data": {
"id": 1,
"type": "water",
"module_product_id": 3
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a damage type module product.
requires authentication
Removes the specified damage type module product from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/damagetypemoduleproduct/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/damagetypemoduleproduct/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "damage type module product deleted"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new damage type module product.
requires authentication
Validates the request data and creates a new damage type module product record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => '"fire"',
'module_product_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/damagetypemoduleproduct" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"\\\"fire\\\"\",
\"module_product_id\": 2
}"
const url = new URL(
"http://localhost/api/damagetypemoduleproduct"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "\"fire\"",
"module_product_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "damage type module product created",
"data": {
"data": {
"id": 1,
"type": "fire",
"module_product_id": 2
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Dashboard
Get dashboard data for the authenticated user.
requires authentication
Returns dashboard statistics and information for the current user, including leads, buildings, policies, and more.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/dashboard';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/dashboard" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/dashboard"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Dashboard data",
"data": {
"last_login": "2024-06-01 12:00:00",
"leads": 10,
"leadVolume": 500000,
"pendingLeads": 2,
"buildingsCount": 5,
"insuranceSum": 1200000,
"policyCount": 4,
"policyTotal": 3500,
"openDamages": 1,
"openTasks": 0,
"buildings": [],
"careByAic": 3,
"notCareByAic": 2,
"objectGustavo": 4,
"objectNotGustavo": 1,
"gustavoPercentage": 80,
"notGustavoPercentage": 20,
"ownerTypeStwegCount": 2,
"ownerTypeStwegPercentage": 40,
"ownerTypeMegCount": 1,
"ownerTypeMegPercentage": 20,
"ownerTypeInvestorCount": 1,
"ownerTypeInvestorPercentage": 20,
"ownerTypeErbengemeinschaftCount": 1,
"ownerTypeErbengemeinschaftPercentage": 20,
"objectTypeWohnenCount": 3,
"objectTypeWohnenPercentage": 60,
"objectTypeGewerbeCount": 2,
"objectTypeGewerbePercentage": 40,
"groupLocations": []
}
}
Example response (400):
{
"success": false,
"message": "No data found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Declaration
Retrieve a list of declarations or a single declaration.
requires authentication
Returns all declarations for the current workspace, optionally paginated, or a specific declaration with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'formLead',
'with[1]' => 'file',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'file',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/declaration/1?per_page=15&page=1&with[]=formLead&with[]=file&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"file\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/declaration/1"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "formLead",
"with[1]": "file",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"file"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"form_lead_id": 2,
"file_id": 3,
"bkp1": 1000,
"bkp2": 2000,
"bkp3": 3000,
"bkp4": 4000,
"preparatory_work": 500,
"operational_equipment": 600,
"damages": "Some damages",
"account_holder": "John Doe",
"account_bank": "Bank AG",
"iban": "CH9300762011623852957",
"filler_name": "John",
"filler_firstname": "Doe",
"filler_email": "john.doe@example.com",
"filler_phone": "+41791234567",
"formLead": {},
"file": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing declaration.
requires authentication
Validates the request data and updates the specified declaration record. Optionally sends an email to the insurer if requested.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'form_lead_id' => 2,
'file_id' => 3,
'bkp1' => 1000.0,
'bkp2' => 2000.0,
'bkp3' => 3000.0,
'bkp4' => 4000.0,
'preparatory_work' => 500.0,
'operational_equipment' => 600.0,
'damages' => '"Some damages"',
'account_holder' => '"John Doe"',
'account_bank' => '"Bank AG"',
'iban' => '"CH9300762011623852957"',
'filler_name' => '"John"',
'filler_firstname' => '"Doe"',
'filler_email' => '"john.doe@example.com"',
'filler_phone' => '"+41791234567"',
'send_email' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/declaration/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"form_lead_id\": 2,
\"file_id\": 3,
\"bkp1\": 1000,
\"bkp2\": 2000,
\"bkp3\": 3000,
\"bkp4\": 4000,
\"preparatory_work\": 500,
\"operational_equipment\": 600,
\"damages\": \"\\\"Some damages\\\"\",
\"account_holder\": \"\\\"John Doe\\\"\",
\"account_bank\": \"\\\"Bank AG\\\"\",
\"iban\": \"\\\"CH9300762011623852957\\\"\",
\"filler_name\": \"\\\"John\\\"\",
\"filler_firstname\": \"\\\"Doe\\\"\",
\"filler_email\": \"\\\"john.doe@example.com\\\"\",
\"filler_phone\": \"\\\"+41791234567\\\"\",
\"send_email\": true
}"
const url = new URL(
"http://localhost/api/declaration/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"form_lead_id": 2,
"file_id": 3,
"bkp1": 1000,
"bkp2": 2000,
"bkp3": 3000,
"bkp4": 4000,
"preparatory_work": 500,
"operational_equipment": 600,
"damages": "\"Some damages\"",
"account_holder": "\"John Doe\"",
"account_bank": "\"Bank AG\"",
"iban": "\"CH9300762011623852957\"",
"filler_name": "\"John\"",
"filler_firstname": "\"Doe\"",
"filler_email": "\"john.doe@example.com\"",
"filler_phone": "\"+41791234567\"",
"send_email": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "declaration updated",
"data": {
"data": {
"id": 1,
"form_lead_id": 2,
// ...other fields...
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a declaration.
requires authentication
Removes the specified declaration from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/declaration/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/declaration/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "declaration deleted"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new declaration.
requires authentication
Validates the request data and creates a new declaration record. Optionally sends an email to the insurer if requested.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'form_lead_id' => 2,
'file_id' => 3,
'bkp1' => 1000.0,
'bkp2' => 2000.0,
'bkp3' => 3000.0,
'bkp4' => 4000.0,
'preparatory_work' => 500.0,
'operational_equipment' => 600.0,
'damages' => '"Some damages"',
'account_holder' => '"John Doe"',
'account_bank' => '"Bank AG"',
'iban' => '"CH9300762011623852957"',
'filler_name' => '"John"',
'filler_firstname' => '"Doe"',
'filler_email' => '"john.doe@example.com"',
'filler_phone' => '"+41791234567"',
'send_email' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/declaration" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"form_lead_id\": 2,
\"file_id\": 3,
\"bkp1\": 1000,
\"bkp2\": 2000,
\"bkp3\": 3000,
\"bkp4\": 4000,
\"preparatory_work\": 500,
\"operational_equipment\": 600,
\"damages\": \"\\\"Some damages\\\"\",
\"account_holder\": \"\\\"John Doe\\\"\",
\"account_bank\": \"\\\"Bank AG\\\"\",
\"iban\": \"\\\"CH9300762011623852957\\\"\",
\"filler_name\": \"\\\"John\\\"\",
\"filler_firstname\": \"\\\"Doe\\\"\",
\"filler_email\": \"\\\"john.doe@example.com\\\"\",
\"filler_phone\": \"\\\"+41791234567\\\"\",
\"send_email\": true
}"
const url = new URL(
"http://localhost/api/declaration"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"form_lead_id": 2,
"file_id": 3,
"bkp1": 1000,
"bkp2": 2000,
"bkp3": 3000,
"bkp4": 4000,
"preparatory_work": 500,
"operational_equipment": 600,
"damages": "\"Some damages\"",
"account_holder": "\"John Doe\"",
"account_bank": "\"Bank AG\"",
"iban": "\"CH9300762011623852957\"",
"filler_name": "\"John\"",
"filler_firstname": "\"Doe\"",
"filler_email": "\"john.doe@example.com\"",
"filler_phone": "\"+41791234567\"",
"send_email": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "declaration created",
"data": {
"data": {
"id": 1,
"form_lead_id": 2,
// ...other fields...
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
Edit Form Lead
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
const url = new URL(
"http://localhost/api/formlead/26"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Form Lead Construction Change
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/formlead/26/constructionchange/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/constructionchange/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Form Lead Construction Change
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/constructionchange" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/constructionchange"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit Form Lead Construction Change
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange/16';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/constructionchange/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/constructionchange/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Form Lead Construction Change
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/formlead/26/constructionchange/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/constructionchange/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
extend a policy with invoice and send invoice to invoiceReceiver
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/extension';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy/28/extension" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/policy/28/extension"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/contact/{contact?}/listing
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/listing';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/contact/1/listing" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/contact/1/listing"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/login
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/login';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/login" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/login"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 90
x-ratelimit-remaining: 89
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
{
"status": "false",
"message": "please login"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
File
Create a new file or folder.
requires authentication
Validates and creates a new file or folder. Optionally links to form lead, user, or another model.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'parent_id',
'contents' => '2'
],
[
'name' => 'name',
'contents' => '"Document.pdf"'
],
[
'name' => 'form_lead_id',
'contents' => '3'
],
[
'name' => 'user_id',
'contents' => '4'
],
[
'name' => 'link_model',
'contents' => '"Policy"'
],
[
'name' => 'link_id',
'contents' => '5'
],
[
'name' => 'mime',
'contents' => '"application/pdf"'
],
[
'name' => 'data',
'contents' => fopen('/tmp/phpLrTMc4', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/file" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "parent_id=2"\
--form "name="Document.pdf""\
--form "form_lead_id=3"\
--form "user_id=4"\
--form "link_model="Policy""\
--form "link_id=5"\
--form "mime="application/pdf""\
--form "data=@/tmp/phpLrTMc4" const url = new URL(
"http://localhost/api/file"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('parent_id', '2');
body.append('name', '"Document.pdf"');
body.append('form_lead_id', '3');
body.append('user_id', '4');
body.append('link_model', '"Policy"');
body.append('link_id', '5');
body.append('mime', '"application/pdf"');
body.append('data', document.querySelector('input[name="data"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "file created successfully",
"data": {
"file_id": 1,
"uploadCenter_id": 2
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a specific user to a file (for upload center).
requires authentication
Grants access to a user for a file in the upload center.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/user';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'form_lead_id' => 3,
'user_id' => 4,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/file/1/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"form_lead_id\": 3,
\"user_id\": 4
}"
const url = new URL(
"http://localhost/api/file/1/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"form_lead_id": 3,
"user_id": 4
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "user access to file added successfully",
"data": {
"uploadCenter_id": 2
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a specific user from a file (for upload center).
requires authentication
Revokes access for a user to a file in the upload center.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/user';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'form_lead_id' => 3,
'user_id' => 4,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/file/1/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"form_lead_id\": 3,
\"user_id\": 4
}"
const url = new URL(
"http://localhost/api/file/1/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"form_lead_id": 3,
"user_id": 4
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user access to file removed successfully"
}
Example response (400):
{
"success": false,
"message": "given user or form lead not found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve a list of files or a single file.
requires authentication
Returns all folders with their content, or a specific file with its users and folder content.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Document.pdf",
"mime": "application/pdf",
"users": [],
"folderContent": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update file name or parent folder.
requires authentication
Updates the name or parent folder of the specified file.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'parent_id' => 2,
'name' => '"UpdatedDocument.pdf"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"parent_id\": 2,
\"name\": \"\\\"UpdatedDocument.pdf\\\"\"
}"
const url = new URL(
"http://localhost/api/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"parent_id": 2,
"name": "\"UpdatedDocument.pdf\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "file updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a file.
requires authentication
Deletes the specified file from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "file deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download a file.
requires authentication
Downloads the specified file. Returns an error if the file is a folder. For S3 storage, returns a temporary download link.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/download';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/file/1/download" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/file/1/download"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
File download stream or redirect.
Example response (400):
{
"success": false,
"message": "downloading folder is not possible"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a download link for a file, valid for 30 minutes.
requires authentication
Returns a temporary download link for the specified file. Only available for S3 storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/link';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/file/1/link" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/file/1/link"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "download link is valid for 30 minutes.",
"data": {
"link": "https://s3.amazonaws.com/bucket/file.pdf?..."
}
}
Example response (400):
{
"success": false,
"message": "creating download link for a folder is not possible"
}
Example response (400):
{
"success": false,
"message": "creating download link for local storage is not possible"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Link a model to a file.
requires authentication
Attaches a model (by type and ID) to the specified file.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/link';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'link_model' => '"Policy"',
'link_id' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/file/1/link" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"link_model\": \"\\\"Policy\\\"\",
\"link_id\": 5
}"
const url = new URL(
"http://localhost/api/file/1/link"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"link_model": "\"Policy\"",
"link_id": 5
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "file linked successfully"
}
Example response (400):
{
"success": false,
"message": "could not attach file to model: ..."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FormHint
Retrieve form hints for a template or a single form hint.
Returns all form hints for the specified template, or a specific form hint.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint/2';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/template/1/formhint/2" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/template/1/formhint/2"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 2,
"template_id": 1,
"name": "hint_name",
"content": "This is a hint.",
"label": "Hint Label"
}
]
Example response (200):
{
"id": 2,
"template_id": 1,
"name": "hint_name",
"content": "This is a hint.",
"label": "Hint Label"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new form hint for a template.
requires authentication
Validates the request data and creates a new form hint for the specified template.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"hint_name"',
'content' => '"This is a hint."',
'label' => '"Hint Label"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/template/1/formhint" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"hint_name\\\"\",
\"content\": \"\\\"This is a hint.\\\"\",
\"label\": \"\\\"Hint Label\\\"\"
}"
const url = new URL(
"http://localhost/api/template/1/formhint"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"hint_name\"",
"content": "\"This is a hint.\"",
"label": "\"Hint Label\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "form hint created successfully",
"data": {
"id": 2
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing form hint.
requires authentication
Validates the request data and updates the specified form hint.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"updated_hint"',
'content' => '"Updated hint content."',
'label' => '"Updated Label"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/template/1/formhint/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"updated_hint\\\"\",
\"content\": \"\\\"Updated hint content.\\\"\",
\"label\": \"\\\"Updated Label\\\"\"
}"
const url = new URL(
"http://localhost/api/template/1/formhint/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"updated_hint\"",
"content": "\"Updated hint content.\"",
"label": "\"Updated Label\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form hint updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a form hint.
requires authentication
Removes the specified form hint from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/template/1/formhint/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/template/1/formhint/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form hint deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FormLead
Create Form Lead without an account.
Creates a new form lead for a user without an account. Generates contacts, attributes, and logs the creation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/withoutaccount';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'template_id' => 2,
'module_object_id' => 10,
'workspace_insurer_product_id' => 5,
'module_workspace_id' => 3,
'formStartSalutation' => '"Mr"',
'formStartFirstname' => '"John"',
'formStartName' => '"Doe"',
'isFastlane' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/withoutaccount" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"template_id\": 2,
\"module_object_id\": 10,
\"workspace_insurer_product_id\": 5,
\"module_workspace_id\": 3,
\"formStartSalutation\": \"\\\"Mr\\\"\",
\"formStartFirstname\": \"\\\"John\\\"\",
\"formStartName\": \"\\\"Doe\\\"\",
\"isFastlane\": true
}"
const url = new URL(
"http://localhost/api/formlead/withoutaccount"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"template_id": 2,
"module_object_id": 10,
"workspace_insurer_product_id": 5,
"module_workspace_id": 3,
"formStartSalutation": "\"Mr\"",
"formStartFirstname": "\"John\"",
"formStartName": "\"Doe\"",
"isFastlane": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "form lead created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"template_id": [
"The template_id field is required."
],
"workspace_insurer_product_id": [
"The workspace_insurer_product_id field is required."
],
"module_workspace_id": [
"The module_workspace_id field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Form Lead(s).
requires authentication
Retrieves a single form lead or a paginated list of form leads. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'template_id' => 2,
'filter' => '"active"',
'group_id' => 5,
'with' => [
'formLeadAttributes',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/formlead/26" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"template_id\": 2,
\"filter\": \"\\\"active\\\"\",
\"group_id\": 5,
\"with\": [
\"formLeadAttributes\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/formlead/26"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"template_id": 2,
"filter": "\"active\"",
"group_id": 5,
"with": [
"formLeadAttributes"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"template_id": 2,
"workspace_insurer_product_id": 5,
"formLeadAttributes": {...},
"contacts": [...],
"addresses": [...],
"...other relations..."
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new Form Lead.
requires authentication
Creates a new form lead and assigns the user as formfiller. Also creates contacts and attributes, triggers jobs and logs the creation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'template_id' => 2,
'module_object_id' => 10,
'workspace_insurer_product_id' => 5,
'user_id' => 7,
'module_workspace_id' => 3,
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"template_id\": 2,
\"module_object_id\": 10,
\"workspace_insurer_product_id\": 5,
\"user_id\": 7,
\"module_workspace_id\": 3,
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/formlead"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"template_id": 2,
"module_object_id": 10,
"workspace_insurer_product_id": 5,
"user_id": 7,
"module_workspace_id": 3,
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "form lead created successfully",
"data": {
"id": 1,
"lead_user_role_id": 2
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"template_id": [
"The template_id field is required."
],
"workspace_insurer_product_id": [
"The workspace_insurer_product_id field is required."
],
"module_workspace_id": [
"The module_workspace_id field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Continue fill up form lead chapter two.
requires authentication
Sends an email to the formfiller to continue chapter two of the form lead and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/continue-chapter-two';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/continue-chapter-two" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/continue-chapter-two"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form lead chapter two continued successfully",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "form lead chapter two fillup already continued",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send form lead zip link by email.
requires authentication
Sends a document package for the form lead to the specified email address.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/sendzipemail';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_ids' => [
1,
2,
3,
],
'email' => '"john.doe@example.com"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/sendzipemail" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_ids\": [
1,
2,
3
],
\"email\": \"\\\"john.doe@example.com\\\"\"
}"
const url = new URL(
"http://localhost/api/formlead/26/sendzipemail"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_ids": [
1,
2,
3
],
"email": "\"john.doe@example.com\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form lead document package queued successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set reaction to Bindexis emails.
requires authentication
Sets the user's reaction to Bindexis emails for the form lead, updates attributes, triggers Asana actions, and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/react';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'user_id' => 7,
'reaction' => '"contactMe"',
'contact_email' => '"john.doe@example.com"',
'contact_firstname' => '"John"',
'contact_name' => '"Doe"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/react" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 7,
\"reaction\": \"\\\"contactMe\\\"\",
\"contact_email\": \"\\\"john.doe@example.com\\\"\",
\"contact_firstname\": \"\\\"John\\\"\",
\"contact_name\": \"\\\"Doe\\\"\"
}"
const url = new URL(
"http://localhost/api/formlead/26/react"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": 7,
"reaction": "\"contactMe\"",
"contact_email": "\"john.doe@example.com\"",
"contact_firstname": "\"John\"",
"contact_name": "\"Doe\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Reaction set successfully",
"refreshToken": true
}
Example response (400):
{
"success": false,
"message": "Invalid reaction"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Form Lead.
requires authentication
Deletes the specified form lead and logs the deletion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/formlead/26" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form lead deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FormLeadAttribute
Retrieve form lead attributes or a single attribute.
requires authentication
Returns all attributes for the specified form lead, or a specific attribute with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute/2';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/formlead/26/attribute/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/attribute/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 2,
"form_lead_id": 1,
"name": "attribute_name",
"type": "string",
"value": "example value",
"category": "general",
"parent_id": null,
"formLead": {},
"childAttributes": []
}
]
Example response (200):
{
"id": 2,
"form_lead_id": 1,
"name": "attribute_name",
"type": "string",
"value": "example value",
"category": "general",
"parent_id": null,
"formLead": {},
"childAttributes": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new form lead attribute.
requires authentication
Validates the request data and creates a new attribute for the specified form lead. Triggers PDF generation and logs the creation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"attribute_name"',
'type' => '"string"',
'value' => '"example value"',
'category' => '"general"',
'parent_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/attribute" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"attribute_name\\\"\",
\"type\": \"\\\"string\\\"\",
\"value\": \"\\\"example value\\\"\",
\"category\": \"\\\"general\\\"\",
\"parent_id\": 2
}"
const url = new URL(
"http://localhost/api/formlead/26/attribute"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"attribute_name\"",
"type": "\"string\"",
"value": "\"example value\"",
"category": "\"general\"",
"parent_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "form lead attribute created successfully",
"data": {
"id": 3
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing form lead attribute.
requires authentication
Validates the request data and updates the specified attribute. Triggers PDF generation and logs the update.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute/2482';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"updated_name"',
'type' => '"int"',
'value' => '42',
'category' => '"details"',
'parent_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/attribute/2482" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"updated_name\\\"\",
\"type\": \"\\\"int\\\"\",
\"value\": \"42\",
\"category\": \"\\\"details\\\"\",
\"parent_id\": 3
}"
const url = new URL(
"http://localhost/api/formlead/26/attribute/2482"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"updated_name\"",
"type": "\"int\"",
"value": "42",
"category": "\"details\"",
"parent_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form lead attribute updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a form lead attribute.
requires authentication
Removes the specified attribute from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute/2482';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/formlead/26/attribute/2482" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/attribute/2482"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "form lead attribute deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FormLeadUser
Retrieve form lead users or a single user.
requires authentication
Returns either a specific user with their roles and contacts, or all user roles for the form lead, optionally paginated and with relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/user/2';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'user',
'with[1]' => 'role',
'with[2]' => 'formLead',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'user',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/formlead/26/user/2?per_page=15&page=1&with[]=user&with[]=role&with[]=formLead&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"user\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/formlead/26/user/2"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "user",
"with[1]": "role",
"with[2]": "formLead",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"user"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 2,
"user": {},
"role": {},
"formLead": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a user role to a form lead.
requires authentication
Assigns a role to the specified user for the given form lead and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/user/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'role_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/user/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"role_id\": 3
}"
const url = new URL(
"http://localhost/api/formlead/26/user/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"role_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "role for user on form added successfully",
"data": {
"id": 5
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a guest user for a form lead.
requires authentication
Creates a guest user for the specified form lead, assigns a role, creates a contact, sends an invite email, and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/guest';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"guest@example.com"',
'firstname' => '"John"',
'lastname' => '"Doe"',
'salutation' => '"M"',
'role_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/guest" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"guest@example.com\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"salutation\": \"\\\"M\\\"\",
\"role_id\": 3
}"
const url = new URL(
"http://localhost/api/formlead/26/guest"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"guest@example.com\"",
"firstname": "\"John\"",
"lastname": "\"Doe\"",
"salutation": "\"M\"",
"role_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "guest user for form lead created successfully",
"data": {
"user_id": 7,
"id": 8
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a guest user for a form lead.
requires authentication
Updates the contact information for the specified guest user and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/guest/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"newguest@example.com"',
'firstname' => '"Jane"',
'lastname' => '"Smith"',
'salutation' => '"F"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/guest/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"newguest@example.com\\\"\",
\"firstname\": \"\\\"Jane\\\"\",
\"lastname\": \"\\\"Smith\\\"\",
\"salutation\": \"\\\"F\\\"\"
}"
const url = new URL(
"http://localhost/api/formlead/26/guest/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"newguest@example.com\"",
"firstname": "\"Jane\"",
"lastname": "\"Smith\"",
"salutation": "\"F\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "guest user for form lead updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a guest user from a form lead.
requires authentication
Deletes the specified guest user from the form lead and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/guest/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/formlead/26/guest/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/guest/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "guest user deleted successfully"
}
Example response (400):
{
"success": false,
"message": "user is not a guest user"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a user role for a form lead.
requires authentication
Updates the role for the specified user on the form lead and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/role/5';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'role_id' => 4,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/role/5" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"role_id\": 4
}"
const url = new URL(
"http://localhost/api/formlead/26/role/5"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"role_id": 4
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "role for form lead updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a user role from a form lead.
requires authentication
Deletes the specified user role from the form lead and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/role/5';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/formlead/26/role/5" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/role/5"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "role for form lead deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Geo
Get geographic coordinates for a given address.
requires authentication
Returns the latitude and longitude for the specified address using the Google Geocoding API.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/geo/coordinates';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'address' => '"1600 Amphitheatre Parkway, Mountain View, CA"',
],
'json' => [
'address' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/geo/coordinates?address=%221600+Amphitheatre+Parkway%2C+Mountain+View%2C+CA%22" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"address\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/geo/coordinates"
);
const params = {
"address": ""1600 Amphitheatre Parkway, Mountain View, CA"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"address": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Coordinates fetched successfully",
"data": {
"lat": 37.4224764,
"lng": -122.0842499
}
}
Example response (400):
{
"success": false,
"message": "Failed to fetch coordinates"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Group
Retrieve a list of groups or a single group.
requires authentication
Returns all groups for the current workspace, optionally paginated, or a specific group with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'groupAttributes',
'with[1]' => 'collections',
'with[2]' => 'files',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'paged' => false,
'shortresult' => true,
'with' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/group/1?per_page=15&page=1&with[]=groupAttributes&with[]=collections&with[]=files&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"paged\": false,
\"shortresult\": true,
\"with\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/group/1"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "groupAttributes",
"with[1]": "collections",
"with[2]": "files",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"paged": false,
"shortresult": true,
"with": [
"architecto"
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Sample Group",
"type": "customer",
"groupAttributes": [],
"collections": [],
"files": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new group.
requires authentication
Validates the request data and creates a new group record, assigns the current user as a member, and sets attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name',
'contents' => '"Sample Group"'
],
[
'name' => 'user_id',
'contents' => '2'
],
[
'name' => 'type',
'contents' => '"company", "personal", "stweg", "meg" or "heirs"'
],
[
'name' => 'logo',
'contents' => fopen('/tmp/phpY1JXlX', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/group" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name="Sample Group""\
--form "user_id=2"\
--form "type="company", "personal", "stweg", "meg" or "heirs""\
--form "logo=@/tmp/phpY1JXlX" const url = new URL(
"http://localhost/api/group"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', '"Sample Group"');
body.append('user_id', '2');
body.append('type', '"company", "personal", "stweg", "meg" or "heirs"');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "group created successfully",
"data": {
"data": {
"id": 1,
"name": "Sample Group"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing group.
requires authentication
Validates the request data and updates the specified group record and its attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name',
'contents' => '"Updated Group"'
],
[
'name' => 'type',
'contents' => '"customer"'
],
[
'name' => 'logo',
'contents' => fopen('/tmp/phpyB9YrX', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/group/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name="Updated Group""\
--form "type="customer""\
--form "logo=@/tmp/phpyB9YrX" const url = new URL(
"http://localhost/api/group/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', '"Updated Group"');
body.append('type', '"customer"');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "group updated successfully",
"data": {
"data": {
"id": 1,
"name": "Updated Group"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a group.
requires authentication
Removes the specified group from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/group/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/group/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "group deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send a group request to the superadmin of the group.
requires authentication
Creates a group request and sends an email to the superadmin of the group.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/request';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/group/1/request" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/group/1/request"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "request sent successfully"
}
Example response (400):
{
"success": false,
"message": "no superadmin found for this group"
}
Example response (404):
{
"success": false,
"message": "no user found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get contact info statistics for a group.
requires authentication
Returns statistics about active policies, project insurances, building count, insurance sum, and total premium per year for the group.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/contactInfo';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/group/1/contactInfo" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/group/1/contactInfo"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"activePolicies": 5,
"projectInsurances": 2,
"buildingCount": 10,
"buildingInsuranceSum": 1000000,
"totalPremiumPerYear": 50000,
"damageBurden": 0
}
Example response (404):
{
"success": false,
"message": "no collection found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Authorize a group request using a code.
requires authentication
Validates the code and completes the group request if correct.
Reject a group request and notify the requesting user.
requires authentication
Sends a rejection email to the requesting user and deletes the user.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/reject/16';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/group/reject/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/group/reject/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "groupRequest rejected successfully"
}
Example response (404):
{
"success": false,
"message": "groupRequest entry not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GroupAttribute
Retrieve group attributes or a single attribute.
requires authentication
Returns all attributes for the specified group, or a specific attribute with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute/2';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/group/1/attribute/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/group/1/attribute/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 2,
"group_id": 1,
"name": "attribute_name",
"type": "string",
"value": "example value",
"category": "general",
"group": {}
}
]
Example response (200):
{
"id": 2,
"group_id": 1,
"name": "attribute_name",
"type": "string",
"value": "example value",
"category": "general",
"group": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new group attribute.
requires authentication
Validates the request data and creates a new attribute for the specified group.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"attribute_name"',
'type' => '"string"',
'value' => '"example value"',
'category' => '"general"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/group/1/attribute" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"attribute_name\\\"\",
\"type\": \"\\\"string\\\"\",
\"value\": \"\\\"example value\\\"\",
\"category\": \"\\\"general\\\"\"
}"
const url = new URL(
"http://localhost/api/group/1/attribute"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"attribute_name\"",
"type": "\"string\"",
"value": "\"example value\"",
"category": "\"general\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "group attribute created successfully",
"data": {
"id": 3
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing group attribute.
requires authentication
Validates the request data and updates the specified attribute.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"updated_name"',
'type' => '"int"',
'value' => '42',
'category' => '"details"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/group/1/attribute/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"updated_name\\\"\",
\"type\": \"\\\"int\\\"\",
\"value\": \"42\",
\"category\": \"\\\"details\\\"\"
}"
const url = new URL(
"http://localhost/api/group/1/attribute/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"updated_name\"",
"type": "\"int\"",
"value": "42",
"category": "\"details\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "group attribute updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a group attribute.
requires authentication
Removes the specified attribute from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/group/1/attribute/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/group/1/attribute/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GuestInvite
Invite a guest user to the upload center for a form lead.
requires authentication
Creates a guest user if not existing, assigns the upload center role, creates a contact, links folders, sends an invite email, and logs the action.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/guest/invite-upload-center';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'form_lead_id' => 1,
'salutation' => '"Mr"',
'firstname' => '"John"',
'lastname' => '"Doe"',
'email' => '"john.doe@example.com"',
'folders' => [
1,
2,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/guest/invite-upload-center" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"form_lead_id\": 1,
\"salutation\": \"\\\"Mr\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"email\": \"\\\"john.doe@example.com\\\"\",
\"folders\": [
1,
2
]
}"
const url = new URL(
"http://localhost/api/guest/invite-upload-center"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"form_lead_id": 1,
"salutation": "\"Mr\"",
"firstname": "\"John\"",
"lastname": "\"Doe\"",
"email": "\"john.doe@example.com\"",
"folders": [
1,
2
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "Guest Invite successfully created",
"data": {
"user": {
"id": 5,
"email": "john.doe@example.com"
},
"id": 10
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve a guest user by token.
requires authentication
Returns the guest user and their contacts for the given token.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/guest/"123e4567-e89b-12d3-a456-426614174000"';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/guest/"123e4567-e89b-12d3-a456-426614174000"" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/guest/"123e4567-e89b-12d3-a456-426614174000""
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Guest User found",
"data": {
"guestUser": {
"id": 5,
"email": "john.doe@example.com",
"contacts": []
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GustavoZip
Retrieve GustavoZip locations by zip, city, or area.
Returns a list of GustavoZip locations filtered by zip, city, or area.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'zip' => '"8001"',
'city' => '"Zurich"',
'area' => '"Downtown"',
],
'json' => [
'zip' => 'architecto',
'city' => 'architecto',
'area' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/gustavozip?zip=%228001%22&city=%22Zurich%22&area=%22Downtown%22" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"zip\": \"architecto\",
\"city\": \"architecto\",
\"area\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/gustavozip"
);
const params = {
"zip": ""8001"",
"city": ""Zurich"",
"area": ""Downtown"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"zip": "architecto",
"city": "architecto",
"area": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"zip": "8001",
"city": "Zurich",
"region": "Zurich",
"short": "ZH",
"country": "Switzerland",
"gustavo": true,
"area": "Downtown"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new GustavoZip location.
requires authentication
Validates the request data and creates a new GustavoZip location.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'zip' => '"8001"',
'city' => '"Zurich"',
'region' => '"Zurich"',
'short' => '"ZH"',
'country' => '"Switzerland"',
'gustavo' => true,
'area' => '"Downtown"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/gustavozip" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"zip\": \"\\\"8001\\\"\",
\"city\": \"\\\"Zurich\\\"\",
\"region\": \"\\\"Zurich\\\"\",
\"short\": \"\\\"ZH\\\"\",
\"country\": \"\\\"Switzerland\\\"\",
\"gustavo\": true,
\"area\": \"\\\"Downtown\\\"\"
}"
const url = new URL(
"http://localhost/api/gustavozip"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"zip": "\"8001\"",
"city": "\"Zurich\"",
"region": "\"Zurich\"",
"short": "\"ZH\"",
"country": "\"Switzerland\"",
"gustavo": true,
"area": "\"Downtown\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "location for GUSTAVO created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing GustavoZip location.
requires authentication
Validates the request data and updates the specified GustavoZip location.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'zip' => '"8002"',
'city' => '"Zurich"',
'region' => '"Zurich"',
'short' => '"ZH"',
'country' => '"Switzerland"',
'gustavo' => false,
'area' => '"Uptown"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/gustavozip/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"zip\": \"\\\"8002\\\"\",
\"city\": \"\\\"Zurich\\\"\",
\"region\": \"\\\"Zurich\\\"\",
\"short\": \"\\\"ZH\\\"\",
\"country\": \"\\\"Switzerland\\\"\",
\"gustavo\": false,
\"area\": \"\\\"Uptown\\\"\"
}"
const url = new URL(
"http://localhost/api/gustavozip/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"zip": "\"8002\"",
"city": "\"Zurich\"",
"region": "\"Zurich\"",
"short": "\"ZH\"",
"country": "\"Switzerland\"",
"gustavo": false,
"area": "\"Uptown\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "location for GUSTAVO updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a GustavoZip location.
requires authentication
Removes the specified GustavoZip location from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/gustavozip/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/gustavozip/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "location for GUSTAVO deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Import
Import properties from a CSV file.
requires authentication
Validates the uploaded CSV file and field mappings, then queues a job to import properties for the specified module category.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/import/properties';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'module_category_id',
'contents' => '1'
],
[
'name' => 'fields[]',
'contents' => 'architecto'
],
[
'name' => 'separator',
'contents' => '";"'
],
[
'name' => 'file',
'contents' => fopen('/tmp/phpkITQtr', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/import/properties" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "module_category_id=1"\
--form "fields[]=architecto"\
--form "separator=";""\
--form "file=@/tmp/phpkITQtr" const url = new URL(
"http://localhost/api/import/properties"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('module_category_id', '1');
body.append('fields[]', 'architecto');
body.append('separator', '";"');
body.append('file', document.querySelector('input[name="file"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "Property import queued."
}
Example response (400):
{
"success": false,
"message": "objectName is required."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsuranceAnnouncement
Get current coverage for a module object.
requires authentication
Returns benchmark and policy product data for the specified module object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/object/44/coverage';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurance/announcement/object/44/coverage" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/announcement/object/44/coverage"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Object Benchmark and policy",
"data": {
"benchmark": {},
"policy": {}
}
}
Example response (400):
{
"success": false,
"message": "Object has no group"
}
Example response (400):
{
"success": false,
"message": "Object attributes are missing"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create an insurance announcement for a module object.
requires authentication
Validates the request data and creates an insurance announcement for the specified module object, attaches products, receivers, and files, and sends emails.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/object/44';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'module_product_items' => [
'architecto',
],
'announcementReceivers' => [
3,
4,
],
'changeTo' => '"2024-07-01"',
'changeReason' => '"Renewal"',
'changeInfo' => '"Some info"',
'offerDeadline' => '"2024-07-15"',
'damageDocuments' => [
10,
11,
],
'requestDocuments' => [
'architecto',
],
'announcementDraft' => true,
'form_lead_id' => 4,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/announcement/object/44" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"module_product_items\": [
\"architecto\"
],
\"announcementReceivers\": [
3,
4
],
\"changeTo\": \"\\\"2024-07-01\\\"\",
\"changeReason\": \"\\\"Renewal\\\"\",
\"changeInfo\": \"\\\"Some info\\\"\",
\"offerDeadline\": \"\\\"2024-07-15\\\"\",
\"damageDocuments\": [
10,
11
],
\"requestDocuments\": [
\"architecto\"
],
\"announcementDraft\": true,
\"form_lead_id\": 4
}"
const url = new URL(
"http://localhost/api/insurance/announcement/object/44"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"module_product_items": [
"architecto"
],
"announcementReceivers": [
3,
4
],
"changeTo": "\"2024-07-01\"",
"changeReason": "\"Renewal\"",
"changeInfo": "\"Some info\"",
"offerDeadline": "\"2024-07-15\"",
"damageDocuments": [
10,
11
],
"requestDocuments": [
"architecto"
],
"announcementDraft": true,
"form_lead_id": 4
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "Insurance announcement created successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve insurance announcements or a single announcement.
requires authentication
Returns all insurance announcements for the current user, optionally paginated, or a specific announcement with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'insurerProductUser.user.contacts',
'with[1]' => 'insurerProductUser.user.workspace',
'with[2]' => 'announcementAttributes',
'with[3]' => 'products',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'products',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurance/announcement/1?per_page=15&page=1&with[]=insurerProductUser.user.contacts&with[]=insurerProductUser.user.workspace&with[]=announcementAttributes&with[]=products&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"products\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/insurance/announcement/1"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "insurerProductUser.user.contacts",
"with[1]": "insurerProductUser.user.workspace",
"with[2]": "announcementAttributes",
"with[3]": "products",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"products"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"workspace_insurer_product_id": 2,
"insurer_product_user_id": 3,
"form_lead_id": 4,
"user_id": 5,
"info": "Some info",
"announcementAttributes": [],
"products": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create one or multiple insurance announcements.
requires authentication
Validates the request data and creates insurance announcements for the specified insurer product users and workspace insurer products.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_products' => 'architecto',
'workspace_insurer_product_id' => 2,
'insurer_product_user_ids' => [
3,
4,
],
'form_lead_id' => 4,
'info' => '"Some info"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/announcement" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_products\": \"architecto\",
\"workspace_insurer_product_id\": 2,
\"insurer_product_user_ids\": [
3,
4
],
\"form_lead_id\": 4,
\"info\": \"\\\"Some info\\\"\"
}"
const url = new URL(
"http://localhost/api/insurance/announcement"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_products": "architecto",
"workspace_insurer_product_id": 2,
"insurer_product_user_ids": [
3,
4
],
"form_lead_id": 4,
"info": "\"Some info\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurance announcements created successfully",
"data": {
"ids": "[1,2,3]"
}
}
Example response (400):
{
"success": false,
"message": "insurance announcement not created because no insurer product user could be determined"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send a draft insurance announcement.
requires authentication
Sends the insurance announcement draft to all receivers and marks it as not a draft.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/11/send';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/announcement/11/send" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/announcement/11/send"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Insurance announcement draft sent successfully"
}
Example response (400):
{
"success": false,
"message": "Insurance announcement is not a draft"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurance announcement.
requires authentication
Validates the request data and updates the specified insurance announcement.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/11';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'insurer_product_user_id' => 3,
'form_lead_id' => 4,
'info' => '"Some info"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/announcement/11" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"insurer_product_user_id\": 3,
\"form_lead_id\": 4,
\"info\": \"\\\"Some info\\\"\"
}"
const url = new URL(
"http://localhost/api/insurance/announcement/11"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"insurer_product_user_id": 3,
"form_lead_id": 4,
"info": "\"Some info\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance announcement updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurance announcement.
requires authentication
Removes the specified insurance announcement from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/11';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurance/announcement/11" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/announcement/11"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance announcement deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsuranceCoverGrade
Retrieve insurance cover grades or a single insurance cover grade.
requires authentication
Returns all insurance cover grades for the current user, optionally paginated, or a specific insurance cover grade with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'workspaceInsurerProduct',
'with[1]' => 'formLead',
'with[2]' => 'user',
'with[3]' => 'insuranceCoverGradeContacts',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'insuranceCoverGradeContacts',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurance/covergrade/1?per_page=15&page=1&with[]=workspaceInsurerProduct&with[]=formLead&with[]=user&with[]=insuranceCoverGradeContacts&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"insuranceCoverGradeContacts\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/insurance/covergrade/1"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "workspaceInsurerProduct",
"with[1]": "formLead",
"with[2]": "user",
"with[3]": "insuranceCoverGradeContacts",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"insuranceCoverGradeContacts"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"workspace_insurer_product_id": 2,
"form_lead_id": 3,
"user_id": 4,
"info": "Some info",
"offer": 100000,
"construction_start": "2024-07-01",
"construction_end": "2024-08-01",
"workspaceInsurerProduct": {},
"formLead": {},
"user": {},
"insuranceCoverGradeContacts": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurance cover grade.
requires authentication
Validates the request data and creates a new insurance cover grade record, logs the creation, and sends emails to insurer product users.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'form_lead_id' => 3,
'info' => '"Some info"',
'offer' => 100000.0,
'construction_start' => '"2024-07-01"',
'construction_end' => '"2024-08-01"',
'insurer_product_user_ids' => [
5,
6,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/covergrade" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"form_lead_id\": 3,
\"info\": \"\\\"Some info\\\"\",
\"offer\": 100000,
\"construction_start\": \"\\\"2024-07-01\\\"\",
\"construction_end\": \"\\\"2024-08-01\\\"\",
\"insurer_product_user_ids\": [
5,
6
]
}"
const url = new URL(
"http://localhost/api/insurance/covergrade"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"form_lead_id": 3,
"info": "\"Some info\"",
"offer": 100000,
"construction_start": "\"2024-07-01\"",
"construction_end": "\"2024-08-01\"",
"insurer_product_user_ids": [
5,
6
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurance cover grade created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurance cover grade.
requires authentication
Validates the request data and updates the specified insurance cover grade record, logs the update.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade/10';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'form_lead_id' => 3,
'info' => '"Updated info"',
'offer' => 120000.0,
'construction_start' => '"2024-07-10"',
'construction_end' => '"2024-08-10"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/covergrade/10" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"form_lead_id\": 3,
\"info\": \"\\\"Updated info\\\"\",
\"offer\": 120000,
\"construction_start\": \"\\\"2024-07-10\\\"\",
\"construction_end\": \"\\\"2024-08-10\\\"\"
}"
const url = new URL(
"http://localhost/api/insurance/covergrade/10"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"form_lead_id": 3,
"info": "\"Updated info\"",
"offer": 120000,
"construction_start": "\"2024-07-10\"",
"construction_end": "\"2024-08-10\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance cover grade updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurance cover grade.
requires authentication
Removes the specified insurance cover grade from the database and logs the deletion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade/10';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurance/covergrade/10" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/covergrade/10"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance cover grade deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsuranceOffer
Retrieve insurance offers or a single insurance offer.
requires authentication
Returns all insurance offers visible to the current user, optionally paginated, or a specific insurance offer with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '15',
'page' => '1',
'with[0]' => 'workspaceInsurerProduct',
'with[1]' => 'formLead',
'with[2]' => 'insuranceOfferAttributes',
'with[3]' => 'files',
'with[4]' => 'products',
'with[5]' => 'user',
'with[6]' => 'policy',
'paged' => '1',
'shortresult' => '0',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'products',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurance/offer/1?per_page=15&page=1&with[]=workspaceInsurerProduct&with[]=formLead&with[]=insuranceOfferAttributes&with[]=files&with[]=products&with[]=user&with[]=policy&paged=1&shortresult=" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"products\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/insurance/offer/1"
);
const params = {
"per_page": "15",
"page": "1",
"with[0]": "workspaceInsurerProduct",
"with[1]": "formLead",
"with[2]": "insuranceOfferAttributes",
"with[3]": "files",
"with[4]": "products",
"with[5]": "user",
"with[6]": "policy",
"paged": "1",
"shortresult": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"products"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"workspace_insurer_product_id": 2,
"form_lead_id": 3,
"module_object_id": 4,
"user_id": 5,
"insuranceOfferAttributes": [],
"files": [],
"products": [],
"user": {},
"policy": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurance offer.
requires authentication
Validates the request data and creates a new insurance offer record, including offer products and attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'form_lead_id' => 3,
'module_object_id' => 4,
'replaceProduct' => false,
'items' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"form_lead_id\": 3,
\"module_object_id\": 4,
\"replaceProduct\": false,
\"items\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/insurance/offer"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"form_lead_id": 3,
"module_object_id": 4,
"replaceProduct": false,
"items": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurance offer created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurance offer.
requires authentication
Validates the request data and updates the specified insurance offer record, including offer products and attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'form_lead_id' => 3,
'module_object_id' => 4,
'replaceProduct' => false,
'items' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"form_lead_id\": 3,
\"module_object_id\": 4,
\"replaceProduct\": false,
\"items\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost/api/insurance/offer/30"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"form_lead_id": 3,
"module_object_id": 4,
"replaceProduct": false,
"items": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurance offer.
requires authentication
Removes the specified insurance offer from the database and logs the deletion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurance/offer/30" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/offer/30"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Accept an insurance offer using a token.
Validates the token and user ID, logs the acceptance, and dispatches jobs for further processing.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/accept';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'token' => 'architecto',
'user_id' => 5,
'portalAccept' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30/accept" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"architecto\",
\"user_id\": 5,
\"portalAccept\": true
}"
const url = new URL(
"http://localhost/api/insurance/offer/30/accept"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "architecto",
"user_id": 5,
"portalAccept": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer accepted successfully"
}
Example response (400):
{
"success": false,
"message": "offer token mismatch"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Check acceptance code for insurance offer.
requires authentication
Validates the code and acceptance status, logs the result, and completes the offer acceptance if accepted.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/checkAcceptCode';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'code' => 'architecto',
'accept' => true,
'reason' => '"Not interested"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30/checkAcceptCode" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"architecto\",
\"accept\": true,
\"reason\": \"\\\"Not interested\\\"\"
}"
const url = new URL(
"http://localhost/api/insurance/offer/30/checkAcceptCode"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "architecto",
"accept": true,
"reason": "\"Not interested\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer accepted successfully"
}
Example response (200):
{
"success": true,
"message": "insurance offer declined"
}
Example response (400):
{
"success": false,
"message": "code is incorrect"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsuranceOfferFile
Retrieve insurance offer files or a single insurance offer file.
requires authentication
Returns all files for the specified insurance offer, or a specific file with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file/2';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurance/offer/30/file/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/offer/30/file/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 2,
"insurance_offer_id": 1,
"insurer_avb_id": 3,
"file_id": 4,
"type": "contract",
"insuranceOffer": {},
"insurerAvb": {},
"file": {}
}
]
Example response (200):
{
"id": 2,
"insurance_offer_id": 1,
"insurer_avb_id": 3,
"file_id": 4,
"type": "contract",
"insuranceOffer": {},
"insurerAvb": {},
"file": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurance offer file.
requires authentication
Validates the request data and creates a new file for the specified insurance offer.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurer_avb_id' => 3,
'file_id' => 4,
'type' => '"contract"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30/file" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurer_avb_id\": 3,
\"file_id\": 4,
\"type\": \"\\\"contract\\\"\"
}"
const url = new URL(
"http://localhost/api/insurance/offer/30/file"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurer_avb_id": 3,
"file_id": 4,
"type": "\"contract\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurance offer file created successfully",
"data": {
"id": 2
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurance offer file.
requires authentication
Validates the request data and updates the specified insurance offer file.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurer_avb_id' => 3,
'file_id' => 4,
'type' => '"avb"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurer_avb_id\": 3,
\"file_id\": 4,
\"type\": \"\\\"avb\\\"\"
}"
const url = new URL(
"http://localhost/api/insurance/offer/30/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurer_avb_id": 3,
"file_id": 4,
"type": "\"avb\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer file updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurance offer file.
requires authentication
Removes the specified insurance offer file from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurance/offer/30/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/offer/30/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer file deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsuranceOfferProduct
Retrieve insurance offer products or a single insurance offer product.
requires authentication
Returns all products for the specified insurance offer, or a specific product with its relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product/2';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurance/offer/30/product/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/offer/30/product/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 2,
"insurance_offer_id": 1,
"insurer_product_item_id": 3,
"difference": "Coverage difference",
"approved": true,
"insuranceOffer": {},
"insurerProductItem": {}
}
]
Example response (200):
{
"id": 2,
"insurance_offer_id": 1,
"insurer_product_item_id": 3,
"difference": "Coverage difference",
"approved": true,
"insuranceOffer": {},
"insurerProductItem": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurance offer product.
requires authentication
Validates the request data and creates a new product for the specified insurance offer.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurer_product_item_id' => 3,
'difference' => '"Coverage difference"',
'approved' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30/product" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurer_product_item_id\": 3,
\"difference\": \"\\\"Coverage difference\\\"\",
\"approved\": true
}"
const url = new URL(
"http://localhost/api/insurance/offer/30/product"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurer_product_item_id": 3,
"difference": "\"Coverage difference\"",
"approved": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurance offer product created successfully",
"data": {
"id": 2
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurance offer product.
requires authentication
Validates the request data and updates the specified insurance offer product.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product/1123';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurer_product_item_id' => 3,
'difference' => '"Updated difference"',
'approved' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurance/offer/30/product/1123" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurer_product_item_id\": 3,
\"difference\": \"\\\"Updated difference\\\"\",
\"approved\": false
}"
const url = new URL(
"http://localhost/api/insurance/offer/30/product/1123"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurer_product_item_id": 3,
"difference": "\"Updated difference\"",
"approved": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer product updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurance offer product.
requires authentication
Removes the specified insurance offer product from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product/1123';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurance/offer/30/product/1123" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurance/offer/30/product/1123"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurance offer product deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Insurer AVB
Returns a list of all Insurer AVBs or a single AVB.
requires authentication
Returns either all AVBs of the current workspace or a specific AVB with related models.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurer/avb/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/avb/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"workspace_insurer_product_id": 2,
"file_id": 3,
"info": "Example info",
"type": "Example type"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Creates a new Insurer AVB.
requires authentication
Validates the input data and creates a new AVB.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'file_id' => 3,
'info' => '"Example info"',
'type' => '"Example type"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/avb" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"file_id\": 3,
\"info\": \"\\\"Example info\\\"\",
\"type\": \"\\\"Example type\\\"\"
}"
const url = new URL(
"http://localhost/api/insurer/avb"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"file_id": 3,
"info": "\"Example info\"",
"type": "\"Example type\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurer avb created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Updates an existing Insurer AVB.
requires authentication
Validates the input data and updates the specified AVB.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 2,
'file_id' => 3,
'info' => '"Example info"',
'type' => '"Example type"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/avb/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 2,
\"file_id\": 3,
\"info\": \"\\\"Example info\\\"\",
\"type\": \"\\\"Example type\\\"\"
}"
const url = new URL(
"http://localhost/api/insurer/avb/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 2,
"file_id": 3,
"info": "\"Example info\"",
"type": "\"Example type\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer avb updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Deletes an Insurer AVB.
requires authentication
Removes the specified AVB from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurer/avb/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/avb/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer avb deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsurerObligation
Retrieve insurer obligations or a single insurer obligation.
requires authentication
Returns all insurer obligations for the current workspace, or a specific obligation with its related workspace insurer product and file.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurer/obligation/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/obligation/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"workspace_insurer_product_id": 2,
"file_id": 3,
"info": "Some info",
"workspaceInsurerProduct": {},
"file": {}
}
]
Example response (200):
{
"id": 1,
"workspace_insurer_product_id": 2,
"file_id": 3,
"info": "Some info",
"workspaceInsurerProduct": {},
"file": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurer obligation.
requires authentication
Validates the request data and creates a new insurer obligation record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 3,
'workspace_insurer_product_id' => 2,
'info' => '"Some info"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/obligation" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 3,
\"workspace_insurer_product_id\": 2,
\"info\": \"\\\"Some info\\\"\"
}"
const url = new URL(
"http://localhost/api/insurer/obligation"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 3,
"workspace_insurer_product_id": 2,
"info": "\"Some info\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurer obligation created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurer obligation.
requires authentication
Validates the request data and updates the specified insurer obligation record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 3,
'workspace_insurer_product_id' => 2,
'info' => '"Updated info"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/obligation/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 3,
\"workspace_insurer_product_id\": 2,
\"info\": \"\\\"Updated info\\\"\"
}"
const url = new URL(
"http://localhost/api/insurer/obligation/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 3,
"workspace_insurer_product_id": 2,
"info": "\"Updated info\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer obligation updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurer obligation.
requires authentication
Removes the specified insurer obligation from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurer/obligation/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/obligation/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer obligation deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsurerProduct
Retrieve one or multiple insurer products.
requires authentication
If a product is provided, returns detailed information about that product including related models. Otherwise, returns a paginated or full list of insurer products, optionally with related data.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 16,
'page' => 16,
'with' => [
'workspace',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurer/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 16,
\"page\": 16,
\"with\": [
\"workspace\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/insurer/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 16,
"page": 16,
"with": [
"workspace"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Copy an insurer product into another workspace.
requires authentication
Duplicates the specified insurer product and all its related data into the target workspace. If a copy already exists, returns the existing copy.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/copy';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_id' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/product/1/copy" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_id\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/insurer/product/1/copy"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_id": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurer product.
requires authentication
Removes the specified insurer product from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurer/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get lead insurer contacts for a product.
requires authentication
Retrieves contact information for all users associated with the insurer product, grouped by their workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/contacts';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurer/product/1/contacts" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/product/1/contacts"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurer product.
requires authentication
Validates and creates an insurer product with the provided attributes. Automatically adds module product items based on the selected module product.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'architecto',
'description' => 'Eius et animi quos velit et.',
'start' => '2025-10-20T19:41:49',
'end' => '2025-10-20T19:41:49',
'module_product_id' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/product" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"architecto\",
\"description\": \"Eius et animi quos velit et.\",
\"start\": \"2025-10-20T19:41:49\",
\"end\": \"2025-10-20T19:41:49\",
\"module_product_id\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/insurer/product"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "architecto",
"description": "Eius et animi quos velit et.",
"start": "2025-10-20T19:41:49",
"end": "2025-10-20T19:41:49",
"module_product_id": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurer product.
requires authentication
Updates the specified insurer product with new attributes. If the module product changes, associated product items are replaced.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'architecto',
'description' => 'Eius et animi quos velit et.',
'start' => '2025-10-20T19:41:49',
'end' => '2025-10-20T19:41:49',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"architecto\",
\"description\": \"Eius et animi quos velit et.\",
\"start\": \"2025-10-20T19:41:49\",
\"end\": \"2025-10-20T19:41:49\"
}"
const url = new URL(
"http://localhost/api/insurer/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "architecto",
"description": "Eius et animi quos velit et.",
"start": "2025-10-20T19:41:49",
"end": "2025-10-20T19:41:49"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsurerProductItem
Retrieve one or multiple insurer product items.
requires authentication
This endpoint returns either a list of all items for a given insurer product, or detailed information about a specific item if an item ID is provided.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurer/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Item Name",
"insurer_product_id": 1,
"module_product_item_id": 2,
"info": "Additional info",
"type": "Type",
"coverage_type": "Coverage Type",
"coverage": "Coverage details",
"insurerProduct": {},
"moduleProductItem": {},
"insurerProductItemAttributes": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new insurer product item.
requires authentication
This endpoint validates and creates a new insurer product item with the provided attributes. Additional custom attributes are stored in the related attribute model.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Haftpflicht"',
'module_product_item_id' => 2,
'info' => '"Deckungssumme 10 Mio"',
'type' => '"Basis"',
'coverage_type' => '"Voll"',
'coverage' => '"Europaweit"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/product/1/item" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Haftpflicht\\\"\",
\"module_product_item_id\": 2,
\"info\": \"\\\"Deckungssumme 10 Mio\\\"\",
\"type\": \"\\\"Basis\\\"\",
\"coverage_type\": \"\\\"Voll\\\"\",
\"coverage\": \"\\\"Europaweit\\\"\"
}"
const url = new URL(
"http://localhost/api/insurer/product/1/item"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Haftpflicht\"",
"module_product_item_id": 2,
"info": "\"Deckungssumme 10 Mio\"",
"type": "\"Basis\"",
"coverage_type": "\"Voll\"",
"coverage": "\"Europaweit\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurer product item created successfully",
"data": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing insurer product item.
requires authentication
This endpoint updates the specified insurer product item with new attributes. Additional custom attributes are updated in the related attribute model.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Haftpflicht Plus"',
'module_product_item_id' => 3,
'info' => '"Deckungssumme 20 Mio"',
'type' => '"Premium"',
'coverage_type' => '"Teilkasko"',
'coverage' => '"Weltweit"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Haftpflicht Plus\\\"\",
\"module_product_item_id\": 3,
\"info\": \"\\\"Deckungssumme 20 Mio\\\"\",
\"type\": \"\\\"Premium\\\"\",
\"coverage_type\": \"\\\"Teilkasko\\\"\",
\"coverage\": \"\\\"Weltweit\\\"\"
}"
const url = new URL(
"http://localhost/api/insurer/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Haftpflicht Plus\"",
"module_product_item_id": 3,
"info": "\"Deckungssumme 20 Mio\"",
"type": "\"Premium\"",
"coverage_type": "\"Teilkasko\"",
"coverage": "\"Weltweit\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer product item updated successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an insurer product item.
requires authentication
This endpoint removes the specified insurer product item from the database.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurer/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer product item deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsurerProductUser
Add a User to an Insurer Product
requires authentication
Assigns a user to the specified insurer product. Optionally, the user can be set as the default user for the product. If the user is already assigned, you can update their default status.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/user/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'default' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/product/1/user/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"default\": true
}"
const url = new URL(
"http://localhost/api/insurer/product/1/user/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"default": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user set as default user for insurer product",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "user already assigned to insurer product",
"refreshToken": true
}
Example response (201):
{
"success": true,
"message": "user assigned as default user to insurer product",
"data": {
"id": 123
},
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a User from an Insurer Product
requires authentication
Removes the specified user from the insurer product. If the user is the default, another user will be set as default. At least one user must remain assigned to the insurer product.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/user/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurer/product/1/user/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/product/1/user/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user successfully removed from insurer product",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "at least one user must be assigned to insurer product",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "user is not assigned to insurer product",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
InsurerTariffConstructionCost
Get insurer tariff construction costs.
requires authentication
Retrieves one or multiple insurer tariff construction cost records. If a specific tariff is provided, returns its details including related workspace insurer product and child tariffs. Otherwise, returns a paginated list of tariffs filtered by user role and workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost/121';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'workspaceInsurerProduct',
],
'paged' => true,
'shortresult' => false,
'workspace_insurer_product_id' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/insurer/tariffconstructioncost/121" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"workspaceInsurerProduct\"
],
\"paged\": true,
\"shortresult\": false,
\"workspace_insurer_product_id\": 5
}"
const url = new URL(
"http://localhost/api/insurer/tariffconstructioncost/121"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"workspaceInsurerProduct"
],
"paged": true,
"shortresult": false,
"workspace_insurer_product_id": 5
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"workspace_insurer_product_id": 5,
"type": "construction_cost",
"low": 100000,
"high": 500000,
"workspaceInsurerProduct": {...},
"childTariffs": [...]
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create insurer tariff construction cost.
requires authentication
Creates a new insurer tariff construction cost record. Supports batch creation for multiple types, low, and high values. The first entry with type 'construction_cost' will be the parent, others will be children.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 5,
'type' => [
'construction_cost',
'other_type',
],
'low' => [
100000,
200000,
],
'high' => [
500000,
600000,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/tariffconstructioncost" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 5,
\"type\": [
\"construction_cost\",
\"other_type\"
],
\"low\": [
100000,
200000
],
\"high\": [
500000,
600000
]
}"
const url = new URL(
"http://localhost/api/insurer/tariffconstructioncost"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 5,
"type": [
"construction_cost",
"other_type"
],
"low": [
100000,
200000
],
"high": [
500000,
600000
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurer tariff construction cost created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (400):
{
"success": false,
"message": "type, low or high values missing",
"refreshToken": true
}
Example response (400):
{
"success": false,
"message": "one of the high values is lower as the low value",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update insurer tariff construction cost.
requires authentication
Updates an existing insurer tariff construction cost record. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost/121';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_insurer_product_id' => 5,
'type' => '"construction_cost"',
'high' => '500000',
'low' => '100000',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/insurer/tariffconstructioncost/121" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_insurer_product_id\": 5,
\"type\": \"\\\"construction_cost\\\"\",
\"high\": \"500000\",
\"low\": \"100000\"
}"
const url = new URL(
"http://localhost/api/insurer/tariffconstructioncost/121"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_insurer_product_id": 5,
"type": "\"construction_cost\"",
"high": "500000",
"low": "100000"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer tariff construction cost updated successfully",
"refreshToken": true
}
Example response (400):
{
"success": false,
"message": "the high value is lower as the low value",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete insurer tariff construction cost.
requires authentication
Deletes the specified insurer tariff construction cost record.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost/121';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/insurer/tariffconstructioncost/121" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/insurer/tariffconstructioncost/121"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer tariff construction cost deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Journal
Get journal entries.
requires authentication
Retrieves a single journal entry or a paginated list of journal entries. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal/998';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'paged' => true,
'per_page' => 15,
'page' => 1,
'with' => [
'journalAttributes',
],
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/journal/998" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"paged\": true,
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"journalAttributes\"
],
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/journal/998"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paged": true,
"per_page": 15,
"page": 1,
"with": [
"journalAttributes"
],
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"type": "state",
"visible": true,
"object_id": 123,
"object_type": "App\\Models\\Workspace",
"user_id": 5,
"journalAttributes": {...},
"user": {...}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit an existing journal entry.
requires authentication
Updates an existing journal entry. Only provided fields will be updated. Additional attributes will be stored in journalAttributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal/998';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => '"task"',
'visible' => false,
'object_id' => 124,
'object_type' => '"Workspace"',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/journal/998" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"\\\"task\\\"\",
\"visible\": false,
\"object_id\": 124,
\"object_type\": \"\\\"Workspace\\\"\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/journal/998"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "\"task\"",
"visible": false,
"object_id": 124,
"object_type": "\"Workspace\"",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "journal updated",
"data": {
"id": 1,
"type": "task",
"visible": false,
"object_id": 124,
"object_type": "App\\Models\\Workspace",
"user_id": 5
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"type": [
"The type field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a journal entry.
requires authentication
Deletes the specified journal entry.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal/998';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/journal/998" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/journal/998"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "journal deleted",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new journal entry.
requires authentication
Creates a new journal entry for a given object type and object ID. Additional attributes can be provided and will be stored as journal attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => '"state"',
'visible' => true,
'object_id' => 123,
'object_type' => '"Workspace"',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/journal" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"\\\"state\\\"\",
\"visible\": true,
\"object_id\": 123,
\"object_type\": \"\\\"Workspace\\\"\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/journal"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "\"state\"",
"visible": true,
"object_id": 123,
"object_type": "\"Workspace\"",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "journal created",
"data": {
"id": 1,
"type": "state",
"visible": true,
"object_id": 123,
"object_type": "App\\Models\\Workspace",
"user_id": 5
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"type": [
"The type field is required."
],
"object_id": [
"The object_id field is required."
],
"object_type": [
"The object_type field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Mandate
Get Mandates.
requires authentication
Retrieves a single mandate or a list of mandates for the given form lead. If a specific mandate is provided, returns its details including related form lead and file. Otherwise, returns all mandates for the form lead.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate/6';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/formlead/26/mandate/6" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/mandate/6"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"form_lead_id": 2,
"file_id": 3,
"user_id": 4,
"formLead": {...},
"file": {...}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Mandate.
requires authentication
Creates a new mandate for the given form lead. Requires file and user IDs. Additional attributes can be provided and will be stored. Triggers PDF generation and logs the creation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 3,
'user_id' => 4,
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/mandate" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 3,
\"user_id\": 4,
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/formlead/26/mandate"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 3,
"user_id": 4,
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "mandate created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"file_id": [
"The file_id field is required."
],
"user_id": [
"The user_id field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a Mandate.
requires authentication
Updates an existing mandate for the given form lead. Only provided fields will be updated. Additional attributes will be stored. Triggers PDF generation and logs the update.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate/6';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 3,
'user_id' => 4,
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/formlead/26/mandate/6" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 3,
\"user_id\": 4,
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/formlead/26/mandate/6"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 3,
"user_id": 4,
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "mandate updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"file_id": [
"The file_id field is invalid."
],
"user_id": [
"The user_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Mandate.
requires authentication
Deletes the specified mandate for the given form lead and logs the deletion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate/6';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/formlead/26/mandate/6" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/formlead/26/mandate/6"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "mandate deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Module
Get a module or all modules.
requires authentication
Retrieves a single module with its settings or a paginated list of modules. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'settings',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/module/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"settings\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/module/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"settings"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Module Name",
"settings": {...},
"products": [...]
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new module.
requires authentication
Creates a new module with the given name and optional settings.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"New Module"',
'settings' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"New Module\\\"\",
\"settings\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/module"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"New Module\"",
"settings": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing module.
requires authentication
Updates the name and settings of an existing module.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Module"',
'settings' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Module\\\"\",
\"settings\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/module/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Module\"",
"settings": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a category to a module.
requires authentication
Adds the specified category to the module.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/category/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/category/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/category/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "category added to module successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a category from a module.
requires authentication
Removes the specified category from the module.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/category/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/module/1/category/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/category/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "category removed from module successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an existing module.
requires authentication
Deletes the specified module.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/module/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleObject
Get Module Object(s).
requires authentication
Retrieves a single module object (with relations) or a paginated list of module objects. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'group_id' => 5,
'with' => [
'objectAttributes',
],
'paged' => true,
'shortresult' => false,
'user_id' => 'PB-0123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/object/44" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"group_id\": 5,
\"with\": [
\"objectAttributes\"
],
\"paged\": true,
\"shortresult\": false,
\"user_id\": \"PB-0123\"
}"
const url = new URL(
"http://localhost/api/object/44"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"group_id": 5,
"with": [
"objectAttributes"
],
"paged": true,
"shortresult": false,
"user_id": "PB-0123"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Object Name",
"module_category_id": 2,
"user_id": 3,
"objectAttributes": {...},
"contacts": [...],
"...other relations..."
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "object not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new Module Object.
requires authentication
Creates a new module object and assigns the user as owner. Also creates contacts and attributes, triggers jobs and logs the creation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
],
null,
[
'stdClass' => [
'type' => [
'owner',
],
'firstname' => [
'John',
],
'lastname' => [
'Doe',
],
],
],
[
'display_id' => '"OBJ-123"',
'name' => '"My Building"',
'category' => 2,
'group_id' => 5,
'contacts' => [
$o[0],
],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"display_id\": \"\\\"OBJ-123\\\"\",
\"name\": \"\\\"My Building\\\"\",
\"category\": 2,
\"group_id\": 5,
\"contacts\": [
{
\"type\": \"owner\",
\"firstname\": \"John\",
\"lastname\": \"Doe\"
}
]
}"
const url = new URL(
"http://localhost/api/object"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"display_id": "\"OBJ-123\"",
"name": "\"My Building\"",
"category": 2,
"group_id": 5,
"contacts": [
{
"type": "owner",
"firstname": "John",
"lastname": "Doe"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "object created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"category": [
"The category field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing Module Object.
requires authentication
Updates the fields and contacts of an existing module object. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
],
null,
[
'stdClass' => [
'type' => [
'owner',
],
'firstname' => [
'Jane',
],
'lastname' => [
'Smith',
],
],
],
[
'display_id' => '"OBJ-123"',
'name' => '"Updated Building"',
'category' => 2,
'contacts' => [
$o[0],
],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"display_id\": \"\\\"OBJ-123\\\"\",
\"name\": \"\\\"Updated Building\\\"\",
\"category\": 2,
\"contacts\": [
{
\"type\": \"owner\",
\"firstname\": \"Jane\",
\"lastname\": \"Smith\"
}
]
}"
const url = new URL(
"http://localhost/api/object/44"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"display_id": "\"OBJ-123\"",
"name": "\"Updated Building\"",
"category": 2,
"contacts": [
{
"type": "owner",
"firstname": "Jane",
"lastname": "Smith"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "object updated successfully"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"category": [
"The category field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Module Object.
requires authentication
Deletes the specified module object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/object/44" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/object/44"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "object deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send object zip link by email.
requires authentication
Queues a job to send a document package for the module object to the specified email address.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/sendZipEmail';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'files' => [
1,
2,
3,
],
'email' => '"john.doe@example.com"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44/sendZipEmail" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"files\": [
1,
2,
3
],
\"email\": \"\\\"john.doe@example.com\\\"\"
}"
const url = new URL(
"http://localhost/api/object/44/sendZipEmail"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"files": [
1,
2,
3
],
"email": "\"john.doe@example.com\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "object document package queued successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleObjectWorkspaceInsurerProduct
Add a WorkspaceInsurerProduct to a ModuleObject.
requires authentication
Assigns the specified workspace insurer product to the given module object. If the product is already assigned, returns an error.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/workspaceinsurerproduct/2';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44/workspaceinsurerproduct/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/object/44/workspaceinsurerproduct/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": false,
"message": "workspace insurer product already in module object",
"refreshToken": true
}
Example response (201):
{
"success": true,
"message": "workspace insurer product assigned to module object",
"data": {
"id": 1
},
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a WorkspaceInsurerProduct from a ModuleObject.
requires authentication
Removes the specified workspace insurer product from the given module object. If the product is not assigned, returns an error.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/workspaceinsurerproduct/2';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/object/44/workspaceinsurerproduct/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/object/44/workspaceinsurerproduct/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "workspace insurer product removed from module object",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "workspace insurer product is not assigned to module object",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleObjectContact
Get all module object contacts for a module object or a module object contact by id.
requires authentication
Retrieves either a single module object contact (with relations) or a paginated list of contacts for the given module object. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact/70';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'object',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/object/44/contact/70" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"object\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/object/44/contact/70"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"object"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"module_object_id": 2,
"name": "title",
"type": "string",
"value_string": "Contact Title",
"object": {...},
"parentContact": {...},
"childContacts": [...]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a module object contact to a module object.
requires authentication
Creates a new contact for the given module object. Additional contacts can be added as child contacts.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => '"Project Manager"',
'contacts' => null,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44/contact" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"\\\"Project Manager\\\"\",
\"contacts\": null
}"
const url = new URL(
"http://localhost/api/object/44/contact"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "\"Project Manager\"",
"contacts": null
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module object contact created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"title": [
"The title field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing module object contact.
requires authentication
Updates the title and/or child contacts of an existing module object contact.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact/70';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => '"Senior Manager"',
'contacts' => null,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44/contact/70" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"\\\"Senior Manager\\\"\",
\"contacts\": null
}"
const url = new URL(
"http://localhost/api/object/44/contact/70"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "\"Senior Manager\"",
"contacts": null
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module object contact updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"title": [
"The title field must be a string."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a module object contact from a module object.
requires authentication
Deletes the specified contact from the module object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact/70';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/object/44/contact/70" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/object/44/contact/70"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module object contact deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleObjectFile
Get ModuleObject files.
requires authentication
Retrieves a single module object file (with relations) or a paginated list of files for the given module object. Supports filtering and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/object/44/file/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1
}"
const url = new URL(
"http://localhost/api/object/44/file/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"module_object_id": 2,
"file_id": 3,
"type": "document",
"moduleObject": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "file not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a ModuleObject file.
requires authentication
Creates a new file for the given module object. Requires file ID and type.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 3,
'type' => '"document"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44/file" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 3,
\"type\": \"\\\"document\\\"\"
}"
const url = new URL(
"http://localhost/api/object/44/file"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 3,
"type": "\"document\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module object file created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"file_id": [
"The file_id field is required."
],
"type": [
"The type field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a ModuleObject file.
requires authentication
Updates the file ID and/or type of an existing module object file.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file/16';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 4,
'type' => '"image"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/object/44/file/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 4,
\"type\": \"\\\"image\\\"\"
}"
const url = new URL(
"http://localhost/api/object/44/file/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 4,
"type": "\"image\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module object file updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"file_id": [
"The file_id field is invalid."
],
"type": [
"The type field must be a string."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a ModuleObject file.
requires authentication
Deletes the specified file from the module object.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/object/44/file/16" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/object/44/file/16"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module object file deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleProduct
Get Module Product(s).
requires authentication
Retrieves a single module product (with relations) or a paginated list of module products for the given module. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'productItems',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/module/1/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"productItems\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/module/1/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"productItems"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Product Name",
"insure_what": "Building",
"parent_id": null,
"productItems": [...],
"childProducts": [...],
"modules": [...]
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "product not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Module Product.
requires authentication
Creates a new module product for the given module. Requires name and insure_what fields. Optionally, a parent product can be specified.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Fire Insurance"',
'insure_what' => '"Building"',
'parent_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Fire Insurance\\\"\",
\"insure_what\": \"\\\"Building\\\"\",
\"parent_id\": 2
}"
const url = new URL(
"http://localhost/api/module/1/product"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Fire Insurance\"",
"insure_what": "\"Building\"",
"parent_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module product created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"insure_what": [
"The insure_what field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Copy a Module Product to an Insurer Product.
requires authentication
Creates a new insurer product in the specified workspace by duplicating the given module product.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/copy';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product/1/copy" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_id\": 1
}"
const url = new URL(
"http://localhost/api/module/1/product/1/copy"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "insurer product created successfully",
"data": {
"id": 10
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"workspace_id": [
"The workspace_id field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a Module Product to a Module.
requires authentication
Assigns the specified module product to the given module. If already assigned, does nothing.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/add';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product/1/add" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/product/1/add"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product added to module successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a Module Product from a Module.
requires authentication
Removes the specified module product from the given module.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/remove';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product/1/remove" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/product/1/remove"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product removed from module successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Module Product.
requires authentication
Updates the fields of an existing module product. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Insurance"',
'insure_what' => '"Updated Building"',
'parent_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Insurance\\\"\",
\"insure_what\": \"\\\"Updated Building\\\"\",
\"parent_id\": 3
}"
const url = new URL(
"http://localhost/api/module/1/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Insurance\"",
"insure_what": "\"Updated Building\"",
"parent_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product edited successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"parent_id": [
"The parent_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a Module Product.
requires authentication
Deletes the specified module product from the module.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/module/1/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Module Product(s).
requires authentication
Retrieves a single module product (with relations) or a paginated list of module products. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'productItems',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"productItems\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"productItems"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Product Name",
"insure_what": "Building",
"parent_id": null,
"productItems": [...],
"childProducts": [...],
"modules": [...]
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "product not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Module Product.
requires authentication
Creates a new module product. Requires name and insure_what fields. Optionally, a parent product can be specified.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Fire Insurance"',
'insure_what' => '"Building"',
'parent_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/product" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Fire Insurance\\\"\",
\"insure_what\": \"\\\"Building\\\"\",
\"parent_id\": 2
}"
const url = new URL(
"http://localhost/api/product"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Fire Insurance\"",
"insure_what": "\"Building\"",
"parent_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module product created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"insure_what": [
"The insure_what field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Module Product.
requires authentication
Updates the fields of an existing module product. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Insurance"',
'insure_what' => '"Updated Building"',
'parent_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Insurance\\\"\",
\"insure_what\": \"\\\"Updated Building\\\"\",
\"parent_id\": 3
}"
const url = new URL(
"http://localhost/api/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Insurance\"",
"insure_what": "\"Updated Building\"",
"parent_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "product edited successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"parent_id": [
"The parent_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Module Product.
requires authentication
Deletes the specified module product.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/product/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/product/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "product deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleProductItem
Get Module Product Item(s).
requires authentication
Retrieves a single module product item (with relations) or a list of items for the given module product. Supports filtering and sorting.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/module/1/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"module_product_id": 2,
"name": "Item Name",
"info": "Description",
"type": "string",
"moduleProduct": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "item not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Module Product Item.
requires authentication
Creates a new item for the given module product. Requires name, optional info and type. Additional attributes can be provided and will be stored.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Fire Protection"',
'info' => '"Includes fire alarm system"',
'type' => '"safety"',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product/1/item" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Fire Protection\\\"\",
\"info\": \"\\\"Includes fire alarm system\\\"\",
\"type\": \"\\\"safety\\\"\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/module/1/product/1/item"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Fire Protection\"",
"info": "\"Includes fire alarm system\"",
"type": "\"safety\"",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module product item created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Module Product Item.
requires authentication
Updates the fields of an existing module product item. Only provided fields will be updated. Additional attributes can be provided and will be stored.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Protection"',
'info' => '"Now includes smoke detectors"',
'type' => '"security"',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Protection\\\"\",
\"info\": \"\\\"Now includes smoke detectors\\\"\",
\"type\": \"\\\"security\\\"\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/module/1/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Protection\"",
"info": "\"Now includes smoke detectors\"",
"type": "\"security\"",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product item updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field must be a string."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a Module Product Item.
requires authentication
Deletes the specified module product item.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/module/1/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product item deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Module Product Item(s).
requires authentication
Retrieves a single module product item (with relations) or a list of items for the given module product. Supports filtering and sorting.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"module_product_id": 2,
"name": "Item Name",
"info": "Description",
"type": "string",
"moduleProduct": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "item not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Module Product Item.
requires authentication
Creates a new item for the given module product. Requires name, optional info and type. Additional attributes can be provided and will be stored.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Fire Protection"',
'info' => '"Includes fire alarm system"',
'type' => '"safety"',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/product/1/item" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Fire Protection\\\"\",
\"info\": \"\\\"Includes fire alarm system\\\"\",
\"type\": \"\\\"safety\\\"\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/product/1/item"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Fire Protection\"",
"info": "\"Includes fire alarm system\"",
"type": "\"safety\"",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "module product item created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Module Product Item.
requires authentication
Updates the fields of an existing module product item. Only provided fields will be updated. Additional attributes can be provided and will be stored.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Protection"',
'info' => '"Now includes smoke detectors"',
'type' => '"security"',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Protection\\\"\",
\"info\": \"\\\"Now includes smoke detectors\\\"\",
\"type\": \"\\\"security\\\"\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Protection\"",
"info": "\"Now includes smoke detectors\"",
"type": "\"security\"",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product item updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field must be a string."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a Module Product Item.
requires authentication
Deletes the specified module product item.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/product/1/item/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/product/1/item/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module product item deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ModuleWorkspaces
Link a module to a workspace.
requires authentication
Assigns the specified module to the given workspace. If the module is already assigned, returns an error.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/workspace/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/workspace/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"success": false,
"message": "module already assigned to workspace",
"refreshToken": true
}
Example response (201):
{
"success": true,
"message": "module has been assigned to workspace",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Unlink a module from a workspace.
requires authentication
Removes the specified module from the given workspace. If the module is not assigned, returns an error.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/module/1/workspace/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/workspace/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module has been removed from workspace",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "module is not assigned to workspace",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get module workspace settings.
requires authentication
Retrieves the settings for the specified module and workspace combination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2/settings';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/module/1/workspace/2/settings" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/module/1/workspace/2/settings"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"settings": {...}
}
Example response (200):
[]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Save module workspace settings.
requires authentication
Updates the settings for the specified module and workspace combination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2/settings';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'settings' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/module/1/workspace/2/settings" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"settings\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/module/1/workspace/2/settings"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"settings": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "module settings updated successfully",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "module is not assigned to workspace",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Policy
Get Policy or Policies.
requires authentication
Retrieves a single policy (with relations) or a paginated list of policies. Supports filtering, sorting, and eager loading of relations. Policies are visible to policy creators, object users, insurer admins, and broker admins.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'group_id' => 5,
'with' => [
'user',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/policy/28" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"group_id\": 5,
\"with\": [
\"user\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/policy/28"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"group_id": 5,
"with": [
"user"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"module_object_workspace_insurer_product_id": 2,
"user_id": 3,
"parent_id": null,
"policyAttributes": {...},
"products": [...],
"offers": [...],
"journals": [...],
"files": [...],
"...other relations..."
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Policy.
requires authentication
Creates a new policy for a module object workspace insurer product. If IDs are not provided, related objects are created or fetched. Also creates policy products and fills attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
],
null,
[
'stdClass' => [
'insurer_product_item_id' => [
1,
],
'name' => [
'Coverage',
],
'value' => [
'10000',
],
],
],
[
'module_object_workspace_insurer_product_id' => 2,
'module_object_id' => 5,
'workspace_id' => 1,
'insurer_product_id' => 7,
'module_product_ids' => [
3,
4,
],
'parent_id' => 10,
'policy_products' => [
$o[0],
],
'attributes' => 'architecto',
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"module_object_workspace_insurer_product_id\": 2,
\"module_object_id\": 5,
\"workspace_id\": 1,
\"insurer_product_id\": 7,
\"module_product_ids\": [
3,
4
],
\"parent_id\": 10,
\"policy_products\": [
{
\"insurer_product_item_id\": 1,
\"name\": \"Coverage\",
\"value\": \"10000\"
}
],
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/policy"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"module_object_workspace_insurer_product_id": 2,
"module_object_id": 5,
"workspace_id": 1,
"insurer_product_id": 7,
"module_product_ids": [
3,
4
],
"parent_id": 10,
"policy_products": [
{
"insurer_product_item_id": 1,
"name": "Coverage",
"value": "10000"
}
],
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "policy created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"module_object_workspace_insurer_product_id": [
"The module_object_workspace_insurer_product_id field is required."
],
"module_object_id": [
"The module_object_id field is required."
],
"workspace_id": [
"The workspace_id field is required."
],
"insurer_product_id": [
"The insurer_product_id field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a Policy.
requires authentication
Updates the module object workspace insurer product and attributes of an existing policy.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'module_object_workspace_insurer_product_id' => 2,
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy/28" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"module_object_workspace_insurer_product_id\": 2,
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/policy/28"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"module_object_workspace_insurer_product_id": 2,
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "policy updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"module_object_workspace_insurer_product_id": [
"The module_object_workspace_insurer_product_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Policy.
requires authentication
Deletes the specified policy.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/policy/28" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/policy/28"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "policy deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PolicyFile
Get Policy File(s).
requires authentication
Retrieves a single policy file (with relations) or a list of files for the given policy. Supports eager loading of related policy, file, and insurer AVB.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file/24';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/policy/28/file/24" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/policy/28/file/24"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"policy_id": 2,
"file_id": 3,
"type": "document",
"invoice_paid": true,
"send_notification": false,
"employee_id": 4,
"individual_email": "john.doe@example.com",
"policy": {...},
"file": {...},
"insurerAvb": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "file not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Policy File.
requires authentication
Creates a new file for the given policy. Requires file ID and type. Optionally, invoice paid status, notification settings, employee, and individual email can be provided.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 3,
'insurer_avb_id' => 5,
'type' => '"document"',
'invoice_paid' => true,
'send_notification' => false,
'employee_id' => 4,
'individual_email' => '"john.doe@example.com"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy/28/file" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 3,
\"insurer_avb_id\": 5,
\"type\": \"\\\"document\\\"\",
\"invoice_paid\": true,
\"send_notification\": false,
\"employee_id\": 4,
\"individual_email\": \"\\\"john.doe@example.com\\\"\"
}"
const url = new URL(
"http://localhost/api/policy/28/file"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 3,
"insurer_avb_id": 5,
"type": "\"document\"",
"invoice_paid": true,
"send_notification": false,
"employee_id": 4,
"individual_email": "\"john.doe@example.com\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "policy file created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"file_id": [
"The file_id field is required."
],
"type": [
"The type field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Policy File.
requires authentication
Updates the file ID, insurer AVB ID, type, or invoice paid status of an existing policy file.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_id' => 4,
'insurer_avb_id' => 6,
'type' => '"image"',
'invoice_paid' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy/28/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_id\": 4,
\"insurer_avb_id\": 6,
\"type\": \"\\\"image\\\"\",
\"invoice_paid\": false
}"
const url = new URL(
"http://localhost/api/policy/28/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_id": 4,
"insurer_avb_id": 6,
"type": "\"image\"",
"invoice_paid": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "policy file updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"file_id": [
"The file_id field is invalid."
],
"type": [
"The type field must be a string."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a Policy File.
requires authentication
Deletes the specified file from the policy.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/policy/28/file/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/policy/28/file/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "policy file deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PolicyProduct
Get Policy Product(s).
requires authentication
Retrieves a single policy product (with relations) or a list of products for the given policy. Supports eager loading of related policy and insurer product item.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product/184';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/policy/28/product/184" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/policy/28/product/184"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"policy_id": 2,
"insurer_product_item_id": 3,
"name": "Coverage",
"value": "10000",
"info": "Details",
"excess": 500,
"approved": true,
"policy": {...},
"insurerProductItem": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "product not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Policy Product.
requires authentication
Creates a new product for the given policy. Requires name, optionally links to insurer product item or module product item. Additional fields like value, info, excess, and approved can be provided.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurer_product_item_id' => 3,
'name' => '"Coverage"',
'value' => '"10000"',
'info' => '"Details"',
'excess' => '500',
'approved' => true,
'module_product_item_id' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy/28/product" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurer_product_item_id\": 3,
\"name\": \"\\\"Coverage\\\"\",
\"value\": \"\\\"10000\\\"\",
\"info\": \"\\\"Details\\\"\",
\"excess\": \"500\",
\"approved\": true,
\"module_product_item_id\": 5
}"
const url = new URL(
"http://localhost/api/policy/28/product"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurer_product_item_id": 3,
"name": "\"Coverage\"",
"value": "\"10000\"",
"info": "\"Details\"",
"excess": "500",
"approved": true,
"module_product_item_id": 5
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "policy product created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"insurer_product_item_id": [
"The insurer_product_item_id field is invalid."
],
"module_product_item_id": [
"The module_product_item_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Policy Product.
requires authentication
Updates the fields of an existing policy product. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product/184';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'insurer_product_item_id' => 3,
'name' => '"Updated Coverage"',
'value' => '"15000"',
'info' => '"Updated details"',
'excess' => '1000',
'approved' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/policy/28/product/184" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"insurer_product_item_id\": 3,
\"name\": \"\\\"Updated Coverage\\\"\",
\"value\": \"\\\"15000\\\"\",
\"info\": \"\\\"Updated details\\\"\",
\"excess\": \"1000\",
\"approved\": false
}"
const url = new URL(
"http://localhost/api/policy/28/product/184"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"insurer_product_item_id": 3,
"name": "\"Updated Coverage\"",
"value": "\"15000\"",
"info": "\"Updated details\"",
"excess": "1000",
"approved": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "policy product updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"insurer_product_item_id": [
"The insurer_product_item_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a Policy Product.
requires authentication
Deletes the specified policy product from the policy.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product/184';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/policy/28/product/184" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/policy/28/product/184"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "policy product deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Propbase
Journal
APIs for managing journal entries.
Get journal entries.
requires authentication
Retrieves a single journal entry or a paginated list of journal entries. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/journal/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'paged' => false,
'per_page' => 15,
'page' => 1,
'with' => [
'user',
],
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/propbase/journal/architecto" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"paged\": false,
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"user\"
],
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/propbase/journal/architecto"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paged": false,
"per_page": 15,
"page": 1,
"with": [
"user"
],
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": 2567,
"type": "adipisci",
"visible": true,
"object_id": 1031881,
"object_type": "commodi",
"comment": "incidunt",
"information": [
"iure",
"odit",
"et"
],
"subtype": "et",
"categories": [
"modi",
"ipsum",
"nostrum"
],
"pinned": false,
"created_at": "2025-10-20T17:41:50.000000Z",
"updated_at": "2025-10-20T17:41:50.000000Z",
"additional_data": [
"autem",
"et",
"consequatur"
],
"user_id": 2637
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get journals for a specific object.
requires authentication
Retrieves all journal entries associated with a specific object type and ID.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/journal/object/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'user',
],
'paged' => false,
'shortresult' => false,
'type' => 'Modules\\ModuleObject',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/propbase/journal/object/architecto" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"user\"
],
\"paged\": false,
\"shortresult\": false,
\"type\": \"Modules\\\\ModuleObject\"
}"
const url = new URL(
"http://localhost/api/propbase/journal/object/architecto"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"user"
],
"paged": false,
"shortresult": false,
"type": "Modules\\ModuleObject"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": true,
"message": "3 entries found",
"current_page": 1,
"last_page": 1,
"per_page": 15,
"from": 1,
"to": 3,
"total": 3,
"data": [
{
"id": 1,
"type": "state",
"visible": true,
"object_id": 123,
"object_type": "App\\Models\\Workspace",
"user_id": 5,
"additional_data": {...},
"user": {...}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new journal entry.
requires authentication
Creates a new journal entry for a given object type and object ID. Additional attributes can be provided and will be stored as journal attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/journal';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => 'note',
'visible' => false,
'object_id' => 'PB-0123',
'object_type' => 'Modules\\ModuleObject',
'user_id' => 'PB-0123',
'comment' => 'This is a journal entry comment.',
'information' => '{"key":"value"}',
'subtype' => 'update',
'categories' => '["category1","category2"]',
'pinned' => false,
'additional_data' => [
'extra_info' => 'some value',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/propbase/journal" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"note\",
\"visible\": false,
\"object_id\": \"PB-0123\",
\"object_type\": \"Modules\\\\ModuleObject\",
\"user_id\": \"PB-0123\",
\"comment\": \"This is a journal entry comment.\",
\"information\": \"{\\\"key\\\":\\\"value\\\"}\",
\"subtype\": \"update\",
\"categories\": \"[\\\"category1\\\",\\\"category2\\\"]\",
\"pinned\": false,
\"additional_data\": {
\"extra_info\": \"some value\"
}
}"
const url = new URL(
"http://localhost/api/propbase/journal"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "note",
"visible": false,
"object_id": "PB-0123",
"object_type": "Modules\\ModuleObject",
"user_id": "PB-0123",
"comment": "This is a journal entry comment.",
"information": "{\"key\":\"value\"}",
"subtype": "update",
"categories": "[\"category1\",\"category2\"]",
"pinned": false,
"additional_data": {
"extra_info": "some value"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"status": true,
"message": "Journal entry created successfully",
"data": {
"id": 1,
"type": "state",
"visible": true,
"object_id": 123,
"object_type": "App\\Models\\Workspace",
"user_id": 5,
"additional_data": {...},
"user": {...}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Objects
APIs for managing module objects.
Get Module Object(s).
requires authentication
Retrieves a single module object (with relations) or a paginated list of module objects. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/object/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'group_id' => 2,
'with' => [
'policyList',
],
'paged' => false,
'shortresult' => false,
'user_id' => 'PB-0123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/propbase/object/architecto" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"group_id\": 2,
\"with\": [
\"policyList\"
],
\"paged\": false,
\"shortresult\": false,
\"user_id\": \"PB-0123\"
}"
const url = new URL(
"http://localhost/api/propbase/object/architecto"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"group_id": 2,
"with": [
"policyList"
],
"paged": false,
"shortresult": false,
"user_id": "PB-0123"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "object(s) retrieved successfully",
"data": {
"id": 1,
"name": "Object Name",
"module_category_id": 2,
"user_id": 3,
"objectAttributes": {...},
"contacts": [...],
"...other relations..."
},
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "object not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new Module Object.
requires authentication
Creates a new module object with the provided data.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/object';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 'OBJ-12345',
'name' => 'Sample Object',
'category' => 1,
'group_id' => 10,
'contacts' => [
[
'type' => 'address',
'street' => 'Main St',
'housenumber' => '123',
'zip' => '12345',
'city' => 'Anytown',
'region' => 'State',
'workspace_id' => 1,
],
],
'user_id' => 'USR-67890',
'propbase_id' => 'PB-54321',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/propbase/object" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": \"OBJ-12345\",
\"name\": \"Sample Object\",
\"category\": 1,
\"group_id\": 10,
\"contacts\": [
{
\"type\": \"address\",
\"street\": \"Main St\",
\"housenumber\": \"123\",
\"zip\": \"12345\",
\"city\": \"Anytown\",
\"region\": \"State\",
\"workspace_id\": 1
}
],
\"user_id\": \"USR-67890\",
\"propbase_id\": \"PB-54321\"
}"
const url = new URL(
"http://localhost/api/propbase/object"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": "OBJ-12345",
"name": "Sample Object",
"category": 1,
"group_id": 10,
"contacts": [
{
"type": "address",
"street": "Main St",
"housenumber": "123",
"zip": "12345",
"city": "Anytown",
"region": "State",
"workspace_id": 1
}
],
"user_id": "USR-67890",
"propbase_id": "PB-54321"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "object created successfully",
"data": {
"id": 1
}
}
Example response (400):
{
"success": false,
"message": "Validation error message"
}
Example response (404):
{
"success": false,
"message": "User not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User
APIs for managing users.
Register a new user.
requires authentication
Creates a new user and assigns a role and group.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/users';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'user@example.com',
'firstname' => 'John',
'lastname' => 'Doe',
'salutation' => 'M',
'company' => 'Acme Corp',
'type' => 'customer',
'subtype' => 'architecto',
'group_id' => 2,
'active_language' => 'de',
'propbase_id' => 'PB-54321',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/propbase/users" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"user@example.com\",
\"firstname\": \"John\",
\"lastname\": \"Doe\",
\"salutation\": \"M\",
\"company\": \"Acme Corp\",
\"type\": \"customer\",
\"subtype\": \"architecto\",
\"group_id\": 2,
\"active_language\": \"de\",
\"propbase_id\": \"PB-54321\"
}"
const url = new URL(
"http://localhost/api/propbase/users"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "user@example.com",
"firstname": "John",
"lastname": "Doe",
"salutation": "M",
"company": "Acme Corp",
"type": "customer",
"subtype": "architecto",
"group_id": 2,
"active_language": "de",
"propbase_id": "PB-54321"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "user created successfully",
"user": {
"workspace_id": 1,
"email": "mail@localhost",
"active": true,
"type": "customer",
"..."
}
Example response (400):
{
"status": false,
"message": "user already exists"
}
Example response (404):
{
"success": false,
"message": "workspace does not exist"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Role
Get Role by Name.
requires authentication
Retrieves a role by its name.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/role/name/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/role/name/architecto" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/role/name/architecto"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Admin",
"description": "Administrator role"
}
Example response (404):
{
"message": "No query results for model [App\\Models\\Role] Admin"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Role(s).
requires authentication
Retrieves a single role by ID or a list of all roles.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/role/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/role/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/role/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Admin",
"description": "Administrator role"
}
Example response (200):
[
{
"id": 1,
"name": "Admin",
"description": "Administrator role"
},
{
"id": 2,
"name": "User",
"description": "Standard user role"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Search
Search all indexed models.
requires authentication
Performs a search query across all Elasticsearch indices. Returns results grouped by model type. Supports fuzzy search and limits the number of results.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/search';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'query' => '"insurance"',
'limit' => 50,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/search" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"query\": \"\\\"insurance\\\"\",
\"limit\": 50
}"
const url = new URL(
"http://localhost/api/search"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"query": "\"insurance\"",
"limit": 50
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"formlead": [
{
"id": 1,
"name": "Lead A",
"...other fields..."
}
],
"user": [
{
"id": 2,
"name": "John Doe",
"...other fields..."
}
]
}
Example response (404):
{
"error": "No results found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Source
Track Source-Template Relation.
Tracks the relation between a source and a template by IP address. Prevents duplicate entries from the same IP within 30 minutes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/track';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'template' => '"template-uuid"',
'source' => '"source-uuid"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/source/track" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"template\": \"\\\"template-uuid\\\"\",
\"source\": \"\\\"source-uuid\\\"\"
}"
const url = new URL(
"http://localhost/api/source/track"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"template": "\"template-uuid\"",
"source": "\"source-uuid\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true
}
Example response (404):
{
"error": "template or source not found"
}
Example response (409):
{
"error": "entry from this ip already stored"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Source(s).
requires authentication
Retrieves a single source (with relations) or a paginated list of sources. Supports filtering, sorting, and eager loading of relations. Only master users can access all sources; others are limited to their workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'workspace',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/source/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"workspace\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/source/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"workspace"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Source Name",
"workspace_id": 2,
"workspace": {...},
"groups": [...],
"collections": [...],
"sourceAttributes": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "source not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Source.
requires authentication
Creates a new source. Requires name, optionally workspace_id and avatar image. Additional attributes are stored.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name',
'contents' => '"My Source"'
],
[
'name' => 'workspace_id',
'contents' => '2'
],
[
'name' => 'attributes',
'contents' => 'architecto'
],
[
'name' => 'avatar',
'contents' => fopen('/tmp/phpMju7xR', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/source" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name="My Source""\
--form "workspace_id=2"\
--form "attributes=architecto"\
--form "avatar=@/tmp/phpMju7xR" const url = new URL(
"http://localhost/api/source"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', '"My Source"');
body.append('workspace_id', '2');
body.append('attributes', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "source created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Source.
requires authentication
Updates the fields and attributes of an existing source. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name',
'contents' => '"Updated Source"'
],
[
'name' => 'workspace_id',
'contents' => '3'
],
[
'name' => 'attributes',
'contents' => 'architecto'
],
[
'name' => 'avatar',
'contents' => fopen('/tmp/phpxnBqfE', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/source/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name="Updated Source""\
--form "workspace_id=3"\
--form "attributes=architecto"\
--form "avatar=@/tmp/phpxnBqfE" const url = new URL(
"http://localhost/api/source/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', '"Updated Source"');
body.append('workspace_id', '3');
body.append('attributes', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "source edited successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"workspace_id": [
"The workspace_id field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Source.
requires authentication
Deletes the specified source.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/source/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/source/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "source deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Template
Get Template(s).
requires authentication
Retrieves a single template (with relations) or a paginated list of templates. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'settings',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/template/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"settings\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/template/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"settings"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Template Name",
"active": true,
"settings": {...}
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "template not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a Template.
requires authentication
Creates a new template. Requires name and active status.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"My Template"',
'active' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/template" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"My Template\\\"\",
\"active\": true
}"
const url = new URL(
"http://localhost/api/template"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"My Template\"",
"active": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "template created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"active": [
"The active field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit a Template.
requires authentication
Updates the name and active status of an existing template.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Template"',
'active' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/template/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Template\\\"\",
\"active\": false
}"
const url = new URL(
"http://localhost/api/template/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Template\"",
"active": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "template edited successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"active": [
"The active field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Template.
requires authentication
Deletes the specified template.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/template/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/template/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "template deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Template Settings for Module Workspace.
Retrieves the settings for the specified template and module workspace combination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/settings';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace' => 2,
'module' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/template/1/settings" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace\": 2,
\"module\": 3
}"
const url = new URL(
"http://localhost/api/template/1/settings"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace": 2,
"module": 3
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"template_id": 2,
"module_workspace_id": 3,
"name": "setting_name",
"value": "setting_value"
}
]
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"workspace": [
"The workspace field is required."
],
"module": [
"The module field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Save Template Settings for Module Workspace.
requires authentication
Updates the settings for the specified template and module workspace combination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/settings';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'workspace' => 2,
'module' => 3,
'settings' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/template/1/settings" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace\": 2,
\"module\": 3,
\"settings\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/template/1/settings"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"workspace": 2,
"module": 3,
"settings": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "template settings updated",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "module not assigned to Workspace",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"workspace": [
"The workspace field is required."
],
"module": [
"The module field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User
Change Password.
requires authentication
Updates the password for the currently authenticated user.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/change-password';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'password' => '|]|{+-',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/user/change-password" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"password\": \"|]|{+-\"
}"
const url = new URL(
"http://localhost/api/user/change-password"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "|]|{+-"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "password changed successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"password": [
"The password field is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Permissions for the User.
requires authentication
Retrieves the permissions for the specified user or the currently authenticated user.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/permissions/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/user/permissions/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/user/permissions/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"name": "Admin",
"permissions": [...]
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update User Permissions.
requires authentication
Updates the role of the specified user. Deprecated: use update user endpoint with role_id instead.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/permissions/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'roles' => [
2,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/user/permissions/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"roles\": [
2
]
}"
const url = new URL(
"http://localhost/api/user/permissions/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"roles": [
2
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user roles changed successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add User to Group.
requires authentication
Adds the specified user to a group with a given role. If no role is provided, assigns the 'superadmin' customer role.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/groups/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'group_id' => 5,
'role_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/user/groups/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"group_id\": 5,
\"role_id\": 2
}"
const url = new URL(
"http://localhost/api/user/groups/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"group_id": 5,
"role_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user added to group successfully",
"refreshToken": true
}
Example response (404):
{
"success": false,
"message": "group not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Current User.
requires authentication
Deletes the currently authenticated user and logs them out.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/remove';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/user/remove" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/user/remove"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Current User.
requires authentication
Retrieves the currently authenticated user with all relevant relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/current';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/user/current" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/user/current"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"email": "john.doe@example.com",
"active": true,
"contacts": [...],
"formRoles": [...],
"role": {...},
"workspace": {...},
"inGroups": {...},
"formRoles": {...},
"uploads": {...},
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get User(s).
requires authentication
Retrieves a single user (with relations) or a paginated list of users. Supports filtering, sorting, and eager loading of relations. Only admins can access all users; customers and guests have limited access.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'group_id' => 5,
'with' => [
'contacts',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/user/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"group_id\": 5,
\"with\": [
\"contacts\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/user/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"group_id": 5,
"with": [
"contacts"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"email": "john.doe@example.com",
"active": true,
"contacts": [...],
"formRoles": [...],
"role": {...},
"...other relations..."
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update User.
requires authentication
Updates the fields and attributes of an existing user. Only provided fields will be updated. Also updates contact and user attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"new.email@example.com"',
'active' => true,
'tfatype' => '"app"',
'google2fa_secret' => '"SECRET"',
'last_login' => '"2024-06-01"',
'last_activity' => '"2024-06-01"',
'password' => '|]|{+-',
'active_language' => '"en"',
'_data' => 'architecto',
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/user/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"new.email@example.com\\\"\",
\"active\": true,
\"tfatype\": \"\\\"app\\\"\",
\"google2fa_secret\": \"\\\"SECRET\\\"\",
\"last_login\": \"\\\"2024-06-01\\\"\",
\"last_activity\": \"\\\"2024-06-01\\\"\",
\"password\": \"|]|{+-\",
\"active_language\": \"\\\"en\\\"\",
\"_data\": \"architecto\",
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/user/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"new.email@example.com\"",
"active": true,
"tfatype": "\"app\"",
"google2fa_secret": "\"SECRET\"",
"last_login": "\"2024-06-01\"",
"last_activity": "\"2024-06-01\"",
"password": "|]|{+-",
"active_language": "\"en\"",
"_data": "architecto",
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field must be a valid email address."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Version
Get Versioned Model.
requires authentication
Retrieves the model instance for the given version. Loads additional relations if specified in the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/version/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/version/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/version/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"versionable_type": "App\\Models\\FormLead",
"versionable_id": 123,
"...model fields and relations..."
}
Example response (404):
{
"success": false,
"message": "Model not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Workspace
Check if User is Invitable to Workspace.
requires authentication
Checks if a user can be invited to the specified workspace and role.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"john.doe@example.com"',
'workspace' => 1,
'role' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/workspace/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"john.doe@example.com\\\"\",
\"workspace\": 1,
\"role\": 2
}"
const url = new URL(
"http://localhost/api/workspace/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"john.doe@example.com\"",
"workspace": 1,
"role": 2
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user already exists in workspace"
}
Example response (200):
{
"success": true,
"message": "role already assigned in workspace"
}
Example response (200):
{
"success": false,
"message": "user does not exist in workspace"
}
Example response (200):
{
"success": false,
"message": "role not assigned to user in workspace"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Invite User to Workspace.
requires authentication
Invites a user to the specified workspace with the given role and group. Optionally sends an email invitation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user/invite';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => '"john.doe@example.com"',
'password' => '"secret123"',
'workspace' => 1,
'role' => 2,
'tfatype' => '"email"',
'firstname' => '"John"',
'lastname' => '"Doe"',
'salutation' => '"M"',
'group_id' => 3,
'google2fa_secret' => '"SECRET"',
'without_mail' => false,
'active_language' => '"en"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/user/invite" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"\\\"john.doe@example.com\\\"\",
\"password\": \"\\\"secret123\\\"\",
\"workspace\": 1,
\"role\": 2,
\"tfatype\": \"\\\"email\\\"\",
\"firstname\": \"\\\"John\\\"\",
\"lastname\": \"\\\"Doe\\\"\",
\"salutation\": \"\\\"M\\\"\",
\"group_id\": 3,
\"google2fa_secret\": \"\\\"SECRET\\\"\",
\"without_mail\": false,
\"active_language\": \"\\\"en\\\"\"
}"
const url = new URL(
"http://localhost/api/workspace/user/invite"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"john.doe@example.com\"",
"password": "\"secret123\"",
"workspace": 1,
"role": 2,
"tfatype": "\"email\"",
"firstname": "\"John\"",
"lastname": "\"Doe\"",
"salutation": "\"M\"",
"group_id": 3,
"google2fa_secret": "\"SECRET\"",
"without_mail": false,
"active_language": "\"en\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "user invitation with given role to workspace succesful",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (404):
{
"success": false,
"message": "workspace does not exist"
}
Example response (422):
{
"message": "The given data was invalid."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Resend Invitation to User for Workspace.
requires authentication
Resends the invitation email to the specified user for the given role in the workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user/resend';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'user' => 1,
'role' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/user/resend" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user\": 1,
\"role\": 2
}"
const url = new URL(
"http://localhost/api/workspace/user/resend"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user": 1,
"role": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "resending user invitation with given role to workspace successful",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove User from Workspace.
requires authentication
Removes the specified user from the workspace or removes a role from the user in the workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'role' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/workspace/user/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"role\": 2
}"
const url = new URL(
"http://localhost/api/workspace/user/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"role": 2
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "user removed from workspace",
"refreshToken": true
}
Example response (200):
{
"success": true,
"message": "role removed for user in workspace",
"refreshToken": true
}
Example response (404):
{
"success": false,
"message": "no user with given role exists in workspace"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Workspace.
requires authentication
Creates a new workspace with the provided name, frontend URL, languages, default language, contacts, avatar, and attributes.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'name',
'contents' => '"My Workspace"'
],
[
'name' => 'frontend_url',
'contents' => '"https://frontend.example.com"'
],
[
'name' => 'languages[]',
'contents' => 'de'
],
[
'name' => 'default_language',
'contents' => '"de"'
],
[
'name' => 'contacts[]',
'contents' => 'architecto'
],
[
'name' => 'attributes[]',
'contents' => 'architecto'
],
[
'name' => 'avatar',
'contents' => fopen('/tmp/phpuIPTzM', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name="My Workspace""\
--form "frontend_url="https://frontend.example.com""\
--form "languages[]=de"\
--form "default_language="de""\
--form "contacts[]=architecto"\
--form "attributes[]=architecto"\
--form "avatar=@/tmp/phpuIPTzM" const url = new URL(
"http://localhost/api/workspace"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', '"My Workspace"');
body.append('frontend_url', '"https://frontend.example.com"');
body.append('languages[]', 'de');
body.append('default_language', '"de"');
body.append('contacts[]', 'architecto');
body.append('attributes[]', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "workspace created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"frontend_url": [
"The frontend_url field is required."
],
"contacts": [
"The contacts field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Workspace Details By Frontend URL.
Retrieves detailed information about a workspace by its frontend URL. The method normalizes the provided URL, searches for a matching workspace, and returns various workspace attributes and configuration values.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/url';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'frontend_url' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/workspace/url" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"frontend_url\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/workspace/url"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"frontend_url": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Workspace Name",
"avatar": "https://example.com/avatar.png",
"primaryColor": "#123456",
"fastlaneInsurerProductId": 10,
"fastlaneWorkspaceInsurerProductId": 20,
"fastlaneModuleWorkspaceId": 30,
"standardWorkspaceInsurerProductId": 40,
"standardModuleWorkspaceId": 50,
"standardModuleId": 60,
"standardModuleProductId": 70,
"currencyLocale": "de-DE",
"currency": "EUR",
"currencyPrefix": "€",
"currencyThousandsSeparator": ".",
"currencyDecimalSeparator": ",",
"privacyUrl": "https://example.com/privacy",
"termsUrl": "https://example.com/terms",
"languages": [
"de",
"en"
],
"defaultLanguage": "de",
"footerMenu": []
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"frontend_url": [
"The frontend_url field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Workspace(s).
requires authentication
Retrieves a single workspace (with relations) by ID or a paginated list of workspaces. Supports filtering, sorting, and eager loading of relations.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'per_page' => 15,
'page' => 1,
'with' => [
'users',
],
'paged' => true,
'shortresult' => false,
'with_inactive' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/workspace/architecto" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"users\"
],
\"paged\": true,
\"shortresult\": false,
\"with_inactive\": true
}"
const url = new URL(
"http://localhost/api/workspace/architecto"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"per_page": 15,
"page": 1,
"with": [
"users"
],
"paged": true,
"shortresult": false,
"with_inactive": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Workspace Name",
"avatar": "url",
"frontend_url": "https://frontend.example.com",
"active": true,
"languages": ["de", "en"],
"default_language": "de",
"users": [...],
"sources": [...],
"insurerProducts": [...],
"contacts": [...],
"workspaceAttributes": [...],
"...other relations..."
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "workspace does not exist"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update Workspace.
requires authentication
Updates the fields and contacts of an existing workspace. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'frontend_url',
'contents' => '"https://frontend.example.com"'
],
[
'name' => 'languages[]',
'contents' => 'de'
],
[
'name' => 'default_language',
'contents' => '"en"'
],
[
'name' => 'contacts[]',
'contents' => 'architecto'
],
[
'name' => 'attributes[]',
'contents' => 'architecto'
],
[
'name' => 'avatar',
'contents' => fopen('/tmp/phpddPvPy', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/architecto" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "frontend_url="https://frontend.example.com""\
--form "languages[]=de"\
--form "default_language="en""\
--form "contacts[]=architecto"\
--form "attributes[]=architecto"\
--form "avatar=@/tmp/phpddPvPy" const url = new URL(
"http://localhost/api/workspace/architecto"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('frontend_url', '"https://frontend.example.com"');
body.append('languages[]', 'de');
body.append('default_language', '"en"');
body.append('contacts[]', 'architecto');
body.append('attributes[]', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "workspace updated successfully",
"refreshToken": true
}
Example response (404):
{
"success": false,
"message": "workspace does not exist"
}
Example response (422):
{
"message": "The given data was invalid."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Workspace.
requires authentication
Deletes the specified workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/workspace/2" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/workspace/2"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "workspace deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
WorkspaceInsurerProduct
Get Workspace Insurer Product(s).
requires authentication
Retrieves a single workspace insurer product (with relations) or a paginated list of workspace insurer products for the given workspace. Supports filtering by module product, eager loading of relations, and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'module_product_id' => 2,
'per_page' => 15,
'page' => 1,
'with' => [
'insurerProduct',
],
'paged' => true,
'shortresult' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/workspace/2/insurerproduct/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"module_product_id\": 2,
\"per_page\": 15,
\"page\": 1,
\"with\": [
\"insurerProduct\"
],
\"paged\": true,
\"shortresult\": false
}"
const url = new URL(
"http://localhost/api/workspace/2/insurerproduct/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"module_product_id": 2,
"per_page": 15,
"page": 1,
"with": [
"insurerProduct"
],
"paged": true,
"shortresult": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"workspace_id": 2,
"insurer_product_id": 3,
"insurerProduct": {...},
"insuranceAnnouncements": [...],
"insurerAvbs": [...],
"insuranceOffers": [...],
"insurerTariffConstructionCosts": [...],
"moduleObjectWorkspaceInsurerProduct": [...]
}
Example response (403):
{
"success": false,
"message": "Unauthorized"
}
Example response (404):
{
"success": false,
"message": "workspace insurer product not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add an Insurer Product to Workspace.
requires authentication
Assigns the specified insurer product to the given workspace. If the product is already assigned, returns an error.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/2/insurerproduct/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/workspace/2/insurerproduct/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": false,
"message": "insurer product already in workspace",
"refreshToken": true
}
Example response (201):
{
"success": true,
"message": "insurer product assigned to workspace",
"data": {
"id": 1
},
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit Workspace Insurer Product.
requires authentication
Updates the attributes of an existing workspace insurer product. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1/edit';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'attributes' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/2/insurerproduct/1/edit" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"attributes\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/workspace/2/insurerproduct/1/edit"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"attributes": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "workspace insurer product updated",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "insurer product is not assigned to workspace",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove an Insurer Product from Workspace.
requires authentication
Deletes the specified insurer product from the workspace.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/workspace/2/insurerproduct/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/workspace/2/insurerproduct/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "insurer product removed from workspace",
"refreshToken": true
}
Example response (200):
{
"success": false,
"message": "insurer product is not assigned to workspace",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
WorkspaceAttributes
Get Workspace Attribute(s).
requires authentication
Retrieves a single workspace attribute (with relations) or a list of attributes for the given workspace. Supports eager loading of the workspace relation.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute/150';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/workspace/2/attribute/150" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/workspace/2/attribute/150"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"workspace_id": 2,
"name": "Attribute Name",
"type": "string",
"value_string": "Value",
"category": "General",
"workspace": {...}
}
]
Example response (200):
{
"id": 1,
"workspace_id": 2,
"name": "Attribute Name",
"type": "string",
"value_string": "Value",
"category": "General",
"workspace": {...}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Workspace Attribute.
requires authentication
Creates a new attribute for the given workspace. Requires name, type, and value. Optionally, a category can be provided.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Location"',
'type' => '"string"',
'value' => '"Berlin"',
'category' => '"General"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/2/attribute" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Location\\\"\",
\"type\": \"\\\"string\\\"\",
\"value\": \"\\\"Berlin\\\"\",
\"category\": \"\\\"General\\\"\"
}"
const url = new URL(
"http://localhost/api/workspace/2/attribute"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Location\"",
"type": "\"string\"",
"value": "\"Berlin\"",
"category": "\"General\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"message": "workspace attribute created successfully",
"data": {
"id": 1
},
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"type": [
"The type field is required."
],
"value": [
"The value field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit Workspace Attribute.
requires authentication
Updates the fields of an existing workspace attribute. Only provided fields will be updated.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute/150';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Updated Location"',
'type' => '"int"',
'value' => '42',
'category' => '"Details"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"http://localhost/api/workspace/2/attribute/150" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Updated Location\\\"\",
\"type\": \"\\\"int\\\"\",
\"value\": \"42\",
\"category\": \"\\\"Details\\\"\"
}"
const url = new URL(
"http://localhost/api/workspace/2/attribute/150"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Updated Location\"",
"type": "\"int\"",
"value": "42",
"category": "\"Details\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "workspace attribute updated successfully",
"refreshToken": true
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"value": [
"The value field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Workspace Attribute.
requires authentication
Deletes the specified workspace attribute.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute/150';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"http://localhost/api/workspace/2/attribute/150" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/workspace/2/attribute/150"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "workspace attribute deleted successfully",
"refreshToken": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Zefix
Get Zefix Company Search Results.
requires authentication
Searches for Swiss companies using the Zefix API by name. Returns a list of matching companies and, if only one result is found, additional details including address, purpose, publications, and office information.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/zefix';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {ACCESS_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'search' => '"Swisscom"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "http://localhost/api/zefix" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"search\": \"\\\"Swisscom\\\"\"
}"
const url = new URL(
"http://localhost/api/zefix"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"search": "\"Swisscom\""
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"search_result": [
{
"chid": "CHE123456789",
"name": "Swisscom AG",
"purpose": "Telecommunications",
"publications": [...],
"headOffices": [...],
"furtherHeadOffices": [...],
"branchOffices": [...]
}
],
"address": {
"postal_code": "8000",
"street_nr": "1",
"street": "Bahnhofstrasse",
"ch_number": "CHE123456789",
"city": "Zurich",
"name": "Swisscom AG",
"region": "ZH",
"country": "CH"
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"search": [
"The search field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.