How to use SideDrawer's Info Request.
To create a report request from an existing Plan, use the following endpoint:
POST/api/v1/reports/sidedrawer/sidedrawer-id/{sidedrawerId}/reports
{
"reportTypeName": "plan_request",
"locale": "en-CA",
"destinationSidedrawerId": "string",
"destinationRecordId": "string",
"params": {},
"externalKeys": [
{
"key": "string",
"value": {}
}
]
}To get the
reportTypeNameused in the request body above, use this endpoint:
GET/api/v1/reports/sidedrawer/sidedrawer-id/{sidedrawerId}/report-types[ { "reportTypeId": "{reportTypeId}", "name": "plan_request", "title": "Info Request Report", "description": "Info Request default template", "provider": "plan_request_provider", "format": "pdf", "template": "{HTML code}", "public": true, "locale": "es-US", "params": [], "formats": [] } ]The returned value for the parameter
nameis thereportTypeNamerequired for creating a report request above.
To check whether the report request has been sent, check the report status:
GET/api/v1/reports/sidedrawer/sidedrawer-id/{sidedrawerId}/reports/report-id/{reportId}/status
{
"reportId": "{reportId}",
"status": "available" // otherwise "pending"
}You can also find all the reports in a certain location using the endpoint
GET/api/v1/reports/sidedrawer/sidedrawer-id/{sidedrawerId}/reports
Reports are "files" and so this endpoint will give each report's file token, as well as identifiers, report status, location, etc.
The endpoint below provides the report "templates" or types available to use.
GET/api/v1/reports/sidedrawer/sidedrawer-id/{sidedrawerId}/report-types
The response returns a parameter provider.
provider = "plan_request_provider" denotes an internal report template with HTML.
provider = "plan_request_fill_form_provider" is a report template that allows users to fill out a PDF form. The PDFs need to be available to the tenant in order for this to work.
For Tenants
As a tenant, you can create your own report templates, in addition to the default SideDrawer templates.
POST/api/v1/tenants/tenant/tenant-id/{tenantId}/report-types
{
"name": "string", // must be unique (within the locale)
"title": "string",
"description": "string",
"provider": "plan_request_provider", // "plan_request_provider" or "plan_request_fill_form_provider"
"format": "pdf", // format of the output
"template": "<!doctype html>", // the actual HTML for your desired report template or the URL of the PDF
"public": true,
"locale": "en-CA",
"params": [
{
"name": "string",
"valueType": "string",
"optional": true,
"description": "string",
"defaultValue": "string"
}
],
"formats": [
{
"name": "string",
"valueType": "string",
"optional": true,
"description": "string",
"defaultValue": "string"
}
]
}As a tenant, you can also push a report request without having an "origin" drawer in your frontend that you're using.
GET/api/v1/tenants/tenant/tenant-id/{tenantId}/reports
The difference between this and the "create report request" endpoint above is that you don't need to specify the current drawer (sidedrawer) identifier.
