API: JasperReport
Create JasperReport
Generate report and optionally save it in filemanager (Only individual report supported)
POST /api/v3/jasperreport/create
Request data:
Parameter | Out Type | In Type | Description |
---|---|---|---|
report_name (required) | string |
| JasperReport name |
contact (required) | int |
| Contact ID |
bundle_name | string |
| Bundle name (default: contact) |
entity_name | string |
| Entity name (default: contact) |
parameters | array|null |
| Default Jasper parameters (optional) depends on the report |
parameters[doc_type] | string|null |
| Created report type (default: pdf) |
parameters[from_date] | date|null |
| Report parameter |
parameters[date_from] | date|null |
| Report parameter |
parameters[contact_id] | int|null |
| Report parameter |
parameters[user_locale] | string|null |
| Report parameter |
parameters[host] | string|null |
| Report parameter |
parameters[custom_parameter] | array|null |
| Create own report parameter |
image_base64 | string|null |
| Report parameter |
return_base64 | boolean|null |
| If true the file will be returned as base64 string |
file_parameters | array|null |
| Passing parameters for the entity “FileManager” (Use with save_file=true) paremeter |
file_parameters[public_access] | boolean|null |
| Set the file for Brokerweb access (brokerwebAccess) (Use with save_file=true) paremeter |
file_parameters[document_category_item] | int|null |
| Set the document category (Use with save_file=true) paremeter |
save_file | boolean|null |
| Default=false. If set to true new FileManager entity will be created and sotred in system. |
Response:
Parameter | Type | Description |
---|---|---|
file_manager_id | integer | Filemanager ID, if returnBase64=false |
file_base64 | string | The report encoded as base64, if returnBase64=true |
code | integer | HTTP code (201 Created) |
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} |
curl -X POST https://public.brokerstar.biz/api/v3/jasperreport/create -d '{
"contact":17556,
"save_file": true,
"report_name":"reportName",
"parameters": {
"doc_type": "pdf"
"custom_parameter": {
"something": "something"
},
"file_parameters":{
"public_access": true,
"document_category_item": entityId
},
}
}' --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg' -
return_base64=false
201 Created
{
"file_manager_id": 123
"code": 201
}
return_base64=true
201 Created
{
"file_base64": "JVBERi0xLjUKJeLjz9MKMyAwIG9iago8PC9Db2xvclNwYWNlWy9JbmRleGVkL0RldmljZVJHQiAyMTI..."
"code": 201
}
Or one of
API: _ Default behavior #Authentication defaults
Get JasperReport list
Get list of avaiable jasper reports
GET /api/v3/jasperreport/list
Request data:
Parameter | Out Type | In Type | Description |
---|---|---|---|
bundle_name | string |
| Bundle name (default: contact) |
entity_name | string |
| Entity name (default: contact) |
is_individual | boolean |
| Is it indyvidual report (default: true) |
Response:
Parameter | Type | Description |
---|---|---|
data[] | array | List of reports |
code | integer | HTTP code (201 Created) |
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} |