Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
api:api_applications_id_offers_id_letters [2025/01/02 15:47] – Lauri | api:api_applications_id_offers_id_letters [2025/01/02 21:33] (current) – [POST] Lauri | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== / | ====== / | ||
+ | |||
+ | Letterheads are document templates that can be used to generate attachments to offers. | ||
+ | |||
+ | In reality, there is also a middle-step in that process — first a Letter is created from the Letterhead. Such a Letter represents a generated (and potentially user-customised) document, where each template marker has already been replaced by actual applicant data. For the purposes of attaching to an offer, the Letter is converted to a PDF and attached to an offer just like a regular uploaded PDF. All of this happens seamlessly in the UI, however, for the API the entire data model is explicitly shown. | ||
+ | |||
+ | Fetching a list of the Letters is usually not useful for the API consumers. | ||
+ | |||
+ | The only useful call here is the one to generate a new letter. As a matter of convenience, | ||
===== HEAD, GET ===== | ===== HEAD, GET ===== | ||
Line 19: | Line 27: | ||
==== Response example ==== | ==== Response example ==== | ||
- | TODO | + | { |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
===== POST ===== | ===== POST ===== | ||
- | TODO | + | This allows to generate a new offer attachment from a letterhead. |
+ | |||
+ | The process is actually comprised of 3 stages: | ||
+ | - A letter is generated from a letterhead | ||
+ | - The letter is rendered to PDF | ||
+ | - The PDF file is attached to the offer | ||
+ | |||
+ | This POST call, by the semantics of it, is meant to allow step 1 — the creation of the letter. But a bare letter, on its own, is pretty useless. Therefore, as a matter of convenience, | ||
+ | Note that this call is equivalent to the "one click attach" | ||
+ | * There should not already be a pre-existing letter generated from this letterhead. Otherwise, this call could overwrite existing user customisation beyond the letterhead template. Keep in mind that the letterhead template can (and often is) edited when generating (and attaching) a letter. | ||
+ | * The letterhead template markers should all be possible to correctly fill. For example, if there is a marker to replace the applicant' | ||
==== Syntax ==== | ==== Syntax ==== | ||