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": []
}
Event filters by date - Supported Query Patterns¶
This endpoint is used to create an Event-Calendar to deliver reoccuring events properly on each day they occur we "flatten" the schedule und than apply filters. Here some hints about filters which do work:
Comparison Operators:
- le (≤), lt (<), ge (≥), gt (>), eq (=), ne (≠)
Query Patterns:
-
Overlap queries - Find events that overlap with a time period:
startDate le periodEnd AND endDate ge periodStart -
Containment queries - Find events fully contained within a period:
startDate ge periodStart AND endDate lt periodEnd -
Logical operators - Support for both
ANDandORconditions:startDate le date1 OR endDate ge date2
Special handling: - Null dates treated as open-ended (StartDate=null → earliest possible, EndDate=null → latest possible) - Timezone-aware comparisons using Swiss timezone conversion
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.