API: Document Category Item
Preconditions (setup)
By API only public
document_category_items are accessible, user with correct permissions need to set up this field for selected items.
GET /api/v3/document-category-item
Request parameter:
No Request parameter
Extra fields:
Parameter | Type | IN | Example | Description |
---|---|---|---|---|
contact | integer | QUERY | add[contact]=123 | Adds files related to contact id=value |
policy | integer | QUERY | add[policy]=1234 | Adds files related to policy id=value |
claim | integer | QUERY | add[claim]=12345 | Adds files related to claim id=value |
Filtering parameters:
Parameter | Type | IN | Example | Description |
---|---|---|---|---|
module | integer | QUERY | filters[module]=1 | Filtering by module id = value (1=Contact,5=Policy,9=Claim) |
document_category | integer | QUERY | filters[document_category]=1 | Filtering by document category id = value |
contactType | integer | QUERY | filters[contactType]=1 | Filtering by contact type id = value (1=company, 2=person) |
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 | Document category item id |
name | string | Name in DE language |
name_e | string | Name in EN language |
name_f | string | Name in FR language |
name_i | string | Name in IT language |
sort | int | Ordering column |
document_category | array | API: Document Category |
document_category[id] | integer | Category id |
document_category[name] | string | Category name in DE language |
document_category[name_e] | string | Category name in EN language |
document_category[name_f] | string | Category name in FR language |
document_category[name_i] | string | Category name in IT language |
module | array | Related module |
module[id] | int | Module id |
module[name] | string | Module name in DE language |
module[name_e] | string | Module name in EN language |
module[name_f] | string | Module name in FR language |
module[name_i] | string | Module name in IT language |
Extra fields | ||
file | array | If using extra param: contact,policy or claim API: File related to entity and connected to document_category is attached. |
file[id] | int|null | File id |
file[name] | string|null | File name |
file[title] | string|null | File title |
file[size] | int|null | File size |
file[crated_at] | string(date)|null | File creation (upload) date |
file[downloaded] | bool|null | Was file uploaded? |
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 #Authentication defaults
Request
curl -X GET https://public.brokerstar.biz/api/v3/document-category-item --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK { "count": "57", "data": [ { "sort": 1, "name_e": "Broker mandate", "name_f": "Mandat de courtier", "name_i": "Mandato di broker", "document_category": { "name_e": "Mandate", "name_f": "Mandat", "name_i": "Mandato", "id": 1, "name": "Mandat" }, "module": { "name_e": "Address book", "name_f": "Carnet d'adresses", "name_i": "Indirizzario", "id": 1, "name": "Contacts (Adressbuch)" }, "id": 1, "name": "Broker Mandat" # when using add[contact|claim|plicy] "file": { "id": 7704, "name": "note.pdf", "title": "Appointment note", "size": 8973, "created_at": "2022-12-13 17:28:09 ", "downloaded": false } }, [...] ], "status": 200 }
Response (Error)
400 Bad request { "error": "Module parameter not send or module id not in (1=contact,5=policy,9=claim)", "code": 400 }
Response (Error)
400 Bad request { "error": "Id of entity needs to be send (eg: id of contact)", "code": 400 }
Response (Error)
403 Forbidden { "error": "You have no access to contact id:123", "code": 403 }
Response (Error)
403 Forbidden { "error": "You have no access to policy id:123", "code": 403 }
Response (Error)
403 Forbidden { "error": "You have no access to claim id:123", "code": 403 }
Or one of
- API: _ Default behavior #Authentication defaults
- API: _ Default behavior #List defaults
POST /api/v3/document-category-item/upload/{documentCategoryItem}/{id}/{language}
Request parameter:
Parameter | Type | In | Description |
---|---|---|---|
file | file | FILES | file contents |
documentCategoryItem | int | QUERY | If of related document category item |
id | int | QUERY | if of related entity (eg. contact - module is taken from doument_category_item module. |
language | string|null | QUERY | Language is needed to set up file title, by default language is DE |
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
data | array | data set |
status | int | Response status (same as in http code) |
Data: object.data[array]
Parameter | Type | Description |
---|---|---|
id | integer | Newly created file id |
name | string | File name |
title | string | File title |
size | int | Size of file in bytes |
created_at | string | Date of file upload/creation |
downloaded | bool | Was file downloaded before |
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} |
Response data:
- API: _ Default behavior #update defaults
Request
curl -X GET https://public.brokerstar.biz/api/v3/document-category-item/upload/3/123/en --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK { "status": 200, "data": { "id": 7704, "name": "note.pdf", "title": "Appointment note", "size": 8973, "created_at": "2022-12-13 17:28:09 ", "downloaded": false } }
Response (Error)
400 Bad request { "error": "File was not send along with request", "code": 400 }
DELETE /api/v3/document-category-item/remove/{file}
Request parameter:
Parameter | Type | In | Description |
---|---|---|---|
file | int | QUERY | Id of file to be removed |
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
message | string | Comment |
status | int | Response status (same as in http code) |
Request
curl -X GET https://public.brokerstar.biz/api/v3/document-category-item/remove/345 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK { "status": 200, "message": "File was removed" }
Response (Success)
403 Forbidden { "status": 403, "message": "You have no access to this file" }