Inhalt | ||||
---|---|---|---|---|
|
GET /api/v3/policy
Extra fields:
Parameter | Type | IN | Example | Description |
---|---|---|---|---|
policy_document | integer | QUERY | add[policy_document]=true | Allow to display policy_document field |
Filtering parameters:
Parameter | Type | IN | Example | Description |
---|---|---|---|---|
branch | integer | QUERY | filters[branch]=34 | Filtering by branch id = value |
insurance | integer | QUERY | filters[insurance]=123 | Filtering by policy insurance contact id = value |
own | boolean | QUERY | filters[own]=true | If user is admin and s/he wants to use filtering by permissions s/he needs to set this filter to true. |
/wiki/spaces/BROK/pages/693181 #List defaults
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
count | int | Number of all results marching criteria |
status | int | Response status (same as in http code) |
Data: object.data[array]
Parameter | Type | Description |
---|---|---|
id | integer | Policy id |
nr | string|null | Policy nr |
nr_register | string|null | Policy nr registration |
start_date | string | Policy start date |
end_date | string | Policy end date |
archive_date | string|null | Policy archive date (if archived) |
contact | array | Policy API: Contact /wiki/spaces/BROK/pages/693431 data |
contact[id] | integer|null | Contact id |
contact[name] | string|null | Contact name |
contact[name_1] | string|null | Contact first name |
contact[name_2] | string|null | Contact last name |
insurance | array | API: Contact /wiki/spaces/BROK/pages/693431 insurance data |
insurance[id] | integer|null | Insurance id |
insurance[name] | string|null | Insurance name |
branch | arrayAPI: Branch | /wiki/spaces/BROK/pages/692961 |
branch[id] | integer|null | Branch id |
branch[name] | string|null | Branch name in DE language |
branch[name_e] | string|null | Branch name in EN language |
branch[name_i] | string|null | Branch name in IT language |
branch[name_f] | string|null | Branch name in FR language |
branch[short_name] | string|null | Branch short-name in DE language |
branch[short_name_e] | string|null | Branch short-name in EN language |
branch[short_name_i] | string|null | Branch short-name in IT language |
branch[short_name_f] | string|null | Branch short-name in FR language |
status | array | Policy status |
status[id] | integer|null | Status id |
status[name] | string|null | Status name in DE language |
status[name_e] | string|null | Status name in EN language |
status[name_i] | string|null | Status name in IT language |
status[name_f] | string|null | Status name in FR language |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
API: _ Default behavior /wiki/spaces/BROK/pages/693181 #Authentication defaults
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -X GET https://public.brokerstar.biz/api/v3/policy?add[policy_document]=true --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg' |
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
200 OK { "count": "14", "data": [ { "nr": "75.868.240", "nr_register": null, "start_date": "2017-05-09T00:00:00+02:00", "end_date": "2022-12-31T00:00:00+01:00", "archive_date": null, "contact": { "name": "User Simple", "name_1": "User", "name_2": "Simple", "id": 9427 }, "insurance": { "name": "Zurich, Generalagentur Micha Rentsch AG ", "id": 230 }, "branch": { "name_e": "Motor vehicle", "name_f": "Véhicule automobile", "name_i": "Veicolo a motore", "short_name": "MF", "short_name_e": "MF", "short_name_f": "MF", "short_name_i": "MF", "id": 34, "name": "Motorfahrzeug" }, "status": { "name_e": "repealed", "name_f": "révoqué", "name_i": "sospeso", "id": 3, "name": "aufgehoben" }, "id": 20285, #this field requires requesting it (extra data section) "policy_document": { "id": 7696, "name": "file.pdf", "size": 8973, "created_at": "2022-12-12 19:38:28 " } }, [...] ], "status": 200 } |
Or one of
- API: _ Default behavior #Authentication defaults API: _ Default behavior
- /wiki/spaces/BROK/pages/693181 #Authentication defaults
- /wiki/spaces/BROK/pages/693181 #List defaults
GET /api/v3/policy/{id}
Request parameter:
Parameter | Type | In | Description |
---|---|---|---|
id | int | url | id of requested policy |
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
status | int | Response status (same as in http code) |
Data: object.data
Parameter | Type | Description |
---|---|---|
All columns from single policy + | ||
payment_type | array | Policy payment type |
payment_type[id] | integer|null | Payment type id |
payment_type[name] | string|null | Payment type name in DE language |
payment_type[name_e] | string|null | Payment type name in EN language |
payment_type[name_i] | string|null | Payment type name in IT language |
payment_type[name_f] | string|null | Payment type name in FR language |
sub_contact | arrayAPI: Contact | /wiki/spaces/BROK/pages/693431 |
sub_contact[id] | integer|null | Sub-Contact id |
sub_contact[name] | string|null | Sub-Contact name |
sub_contact[name_1] | string|null | Sub-Contact first name |
sub_contact[name_2] | string|null | Sub-Contact last name |
Extra fields (additional parameter required) | ||
policy_document | array | Latest policy document |
policy_document[id] | int|null | id of API: File /wiki/spaces/BROK/pages/692845 |
policy_document[name] | string|null | name of file |
policy_document[size] | int|null | size in bytes |
policy_document[created_at] | string(date)|null | creation date |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -X GET https://public.brokerstar.biz/api/v3/policy/16448 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg' |
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
200 OK { "data": { "nr": "2/496375/V4", "nr_register": null, "start_date": "2022-07-01T00:00:00+02:00", "end_date": "2025-12-31T00:00:00+01:00", "breakup_date": "1970-01-01T00:00:00+01:00", "cancellation_date": null, "archive_date": null, "contact": { "name": "7 Alps Bio GmbH ", "name_1": "7 Alps Bio GmbH ", "name_2": null, "id": 17556 }, "insurance": { "name": "AXA ", "id": 236 }, "branch": { "name_e": "BVG/LPP", "name_f": "LPP", "name_i": "LPP", "short_name": "BVG", "short_name_e": "BVG", "short_name_f": "BVG", "short_name_i": "BVG", "id": 7, "name": "BVG Pensionskasse" }, "status": { "name_e": "in force", "name_f": "en vigueur", "name_i": "in vigore", "id": 1, "name": "in Kraft" }, "payment_type": { "name_e": "Annually", "name_f": "Annuel", "name_i": "Annuale", "id": 1, "name": "Jährlich" }, "sub_contact": { "name": null, "name_1": null, "name_2": null, "id": null }, "id": 37140, "policy_document": { "id": 7696, "name": "file.pdf", "size": 8973, "created_at": "2022-12-12 19:38:28 " } }, "status": 200 } |
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
404 Not found { "error": "Entity not found", "code": 404 } |
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
403 Forbidden { "error": "You have no access to contact id:123", "code": 403 } |
Or one of
- API: _ Default behavior /wiki/spaces/BROK/pages/693181 #Authentication defaults