Skip to content

Latest commit

 

History

History
83 lines (76 loc) · 1.84 KB

getPreview.md

File metadata and controls

83 lines (76 loc) · 1.84 KB

🔙

POST /documents/preview

Generates the document and returns the b64 pdf preview. Uses the same input format as POST /documents

Please note

  • To select a different language, pass the language query parameter. nb, nn and en are valid values. Example: ?language=nn.

Example request:

{
  "type": "varsel",
  "variant": "fag",
  "student": {
    "username": "bra2001"
  },
  "content": {
    // Varies based on type and variant
  }
}

Example response:

{
  "data": {
    "system": "minelev",
    "template": "varsel-fag",
    "language": "nb",
    "data": {
      "created": {
        "timestamp": 1606252264318,
        "createdBy": "tes0101"
      },
      "modified": [
        {
          "timestamp": 1606252264318,
          "modifiedBy": "tes0101"
        }
      ],
      "type": "varsel",
      "variant": "fag",
      "student": {
        "username": "bra2001",
        "name": "Brage Dahl",
        "firstName": "Brage",
        "lastName": "Dahl",
        "mobile": "",
        "mail": "[email protected]",
        "classId": "TESVS:TEST1"
      },
      "content": {
        // Varies based on type and variant (see examples below)
      },
      "teacher": {
        "username": "tes0101",
        "name": "Testine Testen",
        "firstName": "Testine",
          "lastName": "Testen",
          "mobile": "4798765432",
          "mail": "[email protected]"
      },
      "school": {
        "id": "TESVS",
        "name": "Testen videregående skole",
        "shortName": "Testen vgs"
      },
      "isEncrypted": false,
      "status": [
        {
          "status": "queued",
          "timestamp": 1606252264318
        }
      ],
      "isQueued": true
    },
    "base64": "JVBERi0xLjMKJf////8KOC<pdf-base64>=="
  }
}