Digital Inbox API

Authentication

In order to send data to Digital-Inbox endpoints the access_token is required. This token can be obtained from the Authentication Endpoint. Please refer to the documentation about details of authentication process.

API caller should request digital-inbox scope from Authentication Endpoint.

Endpoints

File Inbox Item

This endpoint is designed for insurance company Scanning Department and allows to integrate files to digital inbox.

Endpoint URL has the following format:

https://<hostname>/<tenant>/plugins/digitalinbox/file

Examples of the endpoint URL for production environment:

https://www.scalepoint.com/api/integration/dk/<tenant>/v1/digital-inbox/file

File Inbox Integration Request

POST request should contain authorization header, file item metadata in predefined request header and file content(s) sent as part(s) of multipart request body.

Authorization header has name is Authorization. It's value is built from access_token in following format:

Bearer access_token

Note the important space character between Bearer and access_token value.

File item metadata should be passed in request as set of custom HTTP headers. File item fields and corresponding header names are described in Appendix A

File content(s) must be sent as parts of standard HTTP multipart request. Content-Type header should define type of multipart request and boundary (some string that is not contained in any of requests parts. It is used to separate parts in request body).

For example:

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDy8XPIpFKI1ISUWo

More details about multipart requests can be found in rfc2388.

For each part the following standard headers must be specified: Content-Type and Content-Disposition with filename parameter.

Content-Type header is used to detect inbox item type. File item type is used by default. Supported custom mime types are listed in Appendix B

Plain HTTP request example:

POST http://testserver/plugins/digitalinbox/file HTTP/1.1
Metadata-DepartmentId: dep1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh0UlkyRldBbmlHSFJsWU9Gd01ob1JYV3ZOYyIsImtpZCI6Ikh0UlkyRldBbmlHSFJsWU9Gd01ob1JYV3ZOYyJ9.eyJpc3MiOiJodHRwczovL3Rlc3QtYWNjb3VudHMuc2NhbGVwb2ludC5jb20iLCJhdWQiOiJodHRwczovL3Rlc3QtYWNjb3VudHMuc2NhbGVwb2ludC5jb20vcmVzb3VyY2VzIiwiZXhwIjoxNDc5Mjk4MzM4LCJuYmYiOjE0NzkyOTQ3MzgsImNsaWVudF9pZCI6InRlc3RfaW50ZWdyYXRpb25fYWxsX3RlbmFudHMiLCJhbGxUZW5hbnRzIjoidHJ1ZSIsInNjb3BlIjoiZGlnaXRhbC1pbmJveCJ9.TymfBj9KwA9phJENDHNQOjRcN274RzWVl-z8PjLy41HZI07FUNP3abDXYPS5kyArhoU0C0I8hNoI3-6gzHmuXM9CzzZchNV1NgNca8OEOdv04CImQzapKYcEtcY1O-sz4aqMwDnFdtmArcEao4GXSdH0odigNRPepg4_msDc5e-B1kYK1Rg6E0TX_gwoiACxgl2_DbpFCYvGlB7S7nuv1tjhotRsLgPY35FNf5AIgC8K1fkFH764gBsa5W2uJCOQYrpvvvLFNO3hQDg2VJDPvwwBRshbNeB5zxo0WPnRSOhMeghqkFEBu8vbxGnljNFVTJ2DtQgmOXZQ3z3Oz5UTTA
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDy8XPIpFKI1ISUWo

------WebKitFormBoundaryDy8XPIpFKI1ISUWo
Content-Disposition: form-data; name=""; filename="file1.txt"
Content-Type: text/plain

file1 content
------WebKitFormBoundaryDy8XPIpFKI1ISUWo
Content-Disposition: form-data; name=""; filename="file2.txt"
Content-Type: text/plain

file2 content
------WebKitFormBoundaryDy8XPIpFKI1ISUWo--

C# HttpClient example:

var bearerToken = "eyJ0eXAiOiJ.....";
var url = "http://<testserver>/plugins/digitalinbox/file";
using (var httpClient = new HttpClient())
using (var content = new MultipartFormDataContent())
{
    content.Headers.Add("Metadata-DepartmentId", "dep1");
    foreach (var filename in new[] {"file1.pdf", "file2.pdf"})
    {
        var fileToUpload = File.Open($@"c:\temp\{filename}", FileMode.Open, FileAccess.Read);
        var fileContent = new StreamContent(fileToUpload);
        fileContent.Headers.Add("Content-Type", "application/pdf");
        content.Add(fileContent, Guid.NewGuid().ToString(), filename);
    }
    using (var httpPost = new HttpRequestMessage(HttpMethod.Post, url))
    {
        httpPost.Headers.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
        httpPost.Content = content;
        var result = await httpClient.SendAsync(httpPost);
        // Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.OK));
    }
}

File Inbox Integration Response

In case of success HTTP status code is 200. Response body contains file inbox itemId JSON format. If Metadata-ItemId is not specified in the request id will be automatically generated and assigned.

JSON example:

{
    "success": true,
    "payload":  {
        "itemId": "C6B8A606-AE2A-4503-B8E3-CE79436AC909"
    }
}

In case of error response JSON can be ignored - instead HTTP status code should be used to determine error type. If some error occurred the response may look like this:

{
  "success": false,
  "errors": [
    {
      "type": "unauthorizedRequest",
      "message": "Request is not authorized for digital-inbox scope"
    }
  ]
}
Error Type Description
missingHeader Some required header is missing
invalidFormat Request could not be parsed
organizationUnitNotFound The specified Organization unit could not be resolved
userNotFound The specified User could not be resolved
departmentNotFound The specified Department could not be resolved
applicationError Undefined error occurred in the system

Appendix A - File Item metadata HTTP request headers

Root

HTTP header Description Required Fix versions
Metadata-ItemId Inbox file item unique identifier No
Metadata-CaseNumber Case number No
Metadata-Responsible-UserId Responsible user login name No
Metadata-Responsible-DepartmentId Responsible department Id No
Metadata-Responsible-PoolId Pool external Id No 17.614.0
Metadata-Responsible-Tag Assign to random responsible having specified tag assigned No 17.621.0
Metadata-DocumentType File document type No
Metadata-RegistrationNumber Registration number No
Metadata-PolicyNumber Policy number No
Metadata-Primary-FileName Name of the file to be used as primary No

Appendix B - Custom mime types supported

Custom mime type Description Item type Fix versions
application/vnd.oioubl+xml XML expense document in OIOUBL format. The Invoice and CreditNote documents are supported Expense 17.830.0
application/x-autotaks-rapportdata

Format for car repair calculations. Repair offers that have been approved (GK report) are supported.

Autotaks documentation that describes existing mime type for report.

Calculation
17.802.0

application/x-forsi-report-json

New format for car repair calculations (Forsi RESTful). Calculation 23.809.0

application/vnd.meps.inspection+xml

MEPS2.0 assignment, contains inspection report Calculation 18.307.0

application/vnd.meps.calculation+xml

MEPS2.0 assignment, contains repair offer Calculation 18.307.0

application/vnd.meps.finalcalculation+xml

MEPS2.0 assignment, contains final repair offer Calculation 18.307.0

application/vnd.casecreation+json

First notice of loss, format matching unified case creation json FNoL 21.324.0