Logo carlschroeter header
Claims Online
Schäden online melden

API Documentation - Version 0.3.0

Create document

Creates a document.

The document is to be submitted with all required attributes including its content.

The content must be a base64 encoded string. The maximum content length is 100 MB.

Supported content types are:

  • application/msword
  • application/octet-stream
  • application/pdf
  • application/rtf
  • application/vnd.ms-excel
  • application/vnd.ms-outlook
  • application/vnd.ms-powerpoint
  • application/vnd.openxmlformats-officedocument.presentationml.presentation
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • application/zip
  • audio/mp4
  • image/gif
  • image/jpeg
  • image/png
  • image/tiff
  • message/rfc822
  • text/csv
  • text/html
  • text/plain

Note that the URL (full resource ID) to get the document is returned in the Location header of the response.

POST /api/claims/:claim_id/documents

Parameter

All parameters must be passed under the key document , expect claim_id which is part of the URL.

Name Type Required Description Example
claim_id id Yes The claim ID for which to create the document.
kind string No The kind of document if available. See Document kinds damage_photos
filename string Yes The filename of the document ming-vase.jpg
content string Yes The content of the document as base64 encoded string.
The maximum content length is 100 MB.
title string No A document title Photo damage ming vase
description text No A description of the document The image resolution is not optimal, but the damage is easy to see.

Example of request:

curl -s -X POST -H "CS-API-KEY: <your key>" -H "Content-Type: application/json" -d '-d '{"document":{...}}'' https://api-staging.claims-online.de/api/claims/YHP17T/documents

Example of response:


{
  "data":{
    "id":"XG8U3E",
    "type":"documents",
    "attributes":{
      "claim_id":"C42RT8",
      "filename":"ming-vase.jpg",
      "content_type":"image/jpeg",
      "size":999,
      "title":"Photo damage ming vase",
      "description":"The image resolution is not optimal, but the damage is easy to see."
    },
  "links":{
    "self":
      "https://api-staging.claims-online.de/api/_claims/C42RT8/documents/XG8U3E",
      "content":"https://api-staging.claims-online.de/api/_claims/C42RT8/documents/XG8U3E/content"
    }
  }
}