How to query pdf in the infocenter¶
Concepts¶
The data which is accessible in infocenter API can be retrieved in pdf format.. To request a pdf it is necessary to set up Accept header with value application/pdf
. Pdf template depends on project which was queried in the request.
Information
Max count of documents requested for DPF should be less or equal to 50.
Warning
Not all of the endpoints support Accept application/pdf
header for now. Endpoints which don't support pdf result will ignore this header and return regular data
Endpoint¶
Currently, only the search result can be retrieved as PDF. To request PDF file with search results it is necessary to provide search request parameters to one of the search pdf endpoints. It is also required to provide project
and template
properties. Where project
is the name of the project which template is necessary to use, and template
is the name of the template of provided partner.
Available search endpoints:
- /search/pdf/{project}/{template}
Example
{
"project": "grf-chur",
"type": "Event",
"filters": [
"schedule/any(item: item/startDate le 2022-04-03T00:00:00+02:00 or item/endDate ge 2022-03-31T00:00:00+02:00)"
],
"orderBy": "nextOccurrence asc, recurredCount asc",
"facets": []
}
Templates¶
PDF structured from 3 parts: header, footer and body. For each of them discover.swiss have separate templete in html format. Templates could be different for any supported endpoint and for any supported project.
How to upload your templates
Get in contact with us and we will provide a template for your project.
Localization¶
default: de-CH
Language: Based on the Accept-Language header localized properties are translated in the pdf response.