Error logs API

For security reason, only API users, with the role API errors can access error log. All error logs can contain private information that was submitted to the Minddistrict platform and should be used with care.

Listing errors in the Minddistrict API

Information about errors that occurred in the Minddistrict API is transferred as json objects containing the following information:

Example request:

GET /api/2/configuration/apiusers/errorlog/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtSn_EDZUhMvU-PnFgqgpwOy3Bc0k-CFQROZ0jXwhKv2pQQ7KxByhVCzonhFmoJlhMgQeSW4NMxrocj6dP7rX3Wix4uaCu0qZx-75zLEeNHfnmQEggtIPx2ZSJcLzpIfdVPWAPGJhfSe_t_2RSe1WyJgzw7rJMeHShBrXKVGyfnu2u5hdk0LrBThLHUWl1JXl7c

The response will be a list of API error objects:

HTTP/1.0 200 Ok
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 1698
Content-Type: application/json;charset=UTF-8

{
    "@items": [
        {
            "@type": "http://ns.minddistrict.com/error/api",
            "@url": "https://customer.minddistrict.com/api/2/configuration/apiusers/errorlog/1617173334257247",
            "code": 400,
            "datetime": "2021-03-31T06:48:54",
            "extra": [
                {
                    "message": "Required input is missing.",
                    "name": "emotion"
                },
                {
                    "message": "Required input is missing.",
                    "name": "intensity"
                }
            ],
            "message": "Invalid JSON input",
            "payload": "{\n  \"@type\": \"http://ns.minddistrict.com/diary/schema/entry#emotion:6\",\n  \"dt\": \"2014-04-12T11:41:09.817177\"\n}",
            "uri": "/api/2/c/c4a1446b21674c82b9cde931b5be1b3e/diary/entries",
            "user_id": "c4a1446b21674c82b9cde931b5be1b3e"
        },
        {
            "@type": "http://ns.minddistrict.com/error/api",
            "@url": "https://customer.minddistrict.com/api/2/configuration/apiusers/errorlog/1617173333373136",
            "code": 400,
            "datetime": "2021-03-31T06:48:53",
            "extra": null,
            "message": "Invalid new relation.",
            "payload": "{\n  \"@type\": \"http://ns.minddistrict.com/relation\",\n  \"predicate\": \"attends\",\n  \"professional\": {\n    \"id\": \"p1234\"\n  }\n}",
            "uri": "/api/2/c/c4a1446b21674c82b9cde931b5be1b3e/relations",
            "user_id": "3db8f91e6bf34ea3987997051ad08dc4"
        }
    ],
    "@links": [],
    "@paging": {
        "found": 2,
        "limit": null,
        "start": null,
        "total": 2
    }
}

API Errors have the following properties:

Name

Value

Explanation

Value type

Notes

datetime

When this error happened

-

Date with time

Required
user_id

Internal user ID who triggered this error

-

String

Required
message

Error message

-

String

Required
extra

Extra information

-

List of mapping

uri

URI where this error occurred

-

String

Required
code

HTTP error code

-

Integer

Required
payload

Original payload

-

String

The @type meta information for this object is: http://ns.minddistrict.com/error/api.

Listing errors from a Koppeltaal integration

Note

The Koppeltaal errors log is only available in platforms that have Koppeltaal enabled.

Information about errors that occurred in an Koppeltaal integration is transferred as json objects containing the following information:

Example request:

GET /api/2/configuration/koppeltaal/errorlog/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtSn_EDZUhMvU-PnFgqgpwOy3Bc0k-CFQROZ0jXwhKv2pQQ7KxByhVCzonhFmoJlhMgQeSW4NMxrocj6dP7rX3Wix4uaCu0qZx-75zLEeNHfnmQEggtIPx2ZSJcLzpIfdVPWAPGJhfSe_t_2RSe1WyJgzw7rJMeHShBrXKVGyfnu2u5hdk0LrBThLHUWl1JXl7c

The response will be a list of koppeltaal error objects:

HTTP/1.0 200 Ok
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 987
Content-Type: application/json;charset=UTF-8

{
    "@items": [
        {
            "@type": "http://ns.minddistrict.com/error/koppeltaal",
            "@url": "https://customer.minddistrict.com/api/2/configuration/koppeltaal/errorlog/1617173330983274",
            "datetime": "2021-03-31T06:48:50",
            "event_id": "8a9a401e-80ba-4f97-910a-b6d88363074e",
            "event_type": "CreateOrUpdateCarePlan",
            "extra": [
                {
                    "message": "The email address is already in use.",
                    "name": "email"
                }
            ],
            "message": "Cannot process participant https://fhir.example.com/Practitioner/40: Cannot create professional",
            "patient_link": "https://fhir.example.com/Patient/31",
            "resource_link": "https://fhir.example.com/CarePlan/203",
            "was_fatal": true
        }
    ],
    "@links": [],
    "@paging": {
        "found": 1,
        "limit": null,
        "start": null,
        "total": 1
    }
}

Koppeltaal errors have the following properties:

Name

Value

Explanation

Value type

Notes

datetime

When this error happened

-

Date with time

Required
was_fatal

Did the error prevent the message being processed altogether

-

Boolean

Required
event_id

Event ID

-

String

Required
event_type

Event type

-

String

Required
resource_link

Resource FHIR Link

-

String

Required
patient_link

Patient FHIR Link

-

String

Required
message

Error message

-

String

Required
extra

Extra information

-

List of mapping

The @type meta information for this object is: http://ns.minddistrict.com/error/koppeltaal.

Listing errors from an HL7 integration

Note

The HL7 errors log is only available in platforms that have HL7 enabled.

Information about errors that occurred in an HL7 integration is transferred as json objects containing the following information:

Example request:

GET /api/2/configuration/hl7/errorlog/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtSn_EDZUhMvU-PnFgqgpwOy3Bc0k-CFQROZ0jXwhKv2pQQ7KxByhVCzonhFmoJlhMgQeSW4NMxrocj6dP7rX3Wix4uaCu0qZx-75zLEeNHfnmQEggtIPx2ZSJcLzpIfdVPWAPGJhfSe_t_2RSe1WyJgzw7rJMeHShBrXKVGyfnu2u5hdk0LrBThLHUWl1JXl7c

The response will be a list of HL7 error objects:

HTTP/1.0 200 Ok
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 1059
Content-Type: application/json;charset=UTF-8

{
    "@items": [
        {
            "@type": "http://ns.minddistrict.com/error/hl7",
            "@url": "https://customer.minddistrict.com/api/2/configuration/hl7/errorlog/1617173330983350",
            "code": 400,
            "datetime": "2021-03-31T06:48:50",
            "extra": null,
            "message": "Error in A04 message \"42\" (\"email: Email address cannot contain uppercase characters.\")",
            "payload": "{\n            \"active\": true,\n            \"date_of_birth\": \"1980-07-24\",\n            \"email\": \"CLINT@EXAMPLE.COM\",\n            \"first_name\": \"Clint\",\n            \"gender\": \"m\",\n            \"id\": \"cliff123\",\n            \"last_name\": \"Clifford\",\n            \"message_control_id\": \"42\",\n            \"message_event_type\": \"A04\"\n        }",
            "uri": "/api/hl7/c/create",
            "user_id": "cb0f6e6c09f1478599b7e6737d1a4bf7"
        }
    ],
    "@links": [],
    "@paging": {
        "found": 1,
        "limit": null,
        "start": null,
        "total": 1
    }
}

HL7 errors have the following properties.

Name

Value

Explanation

Value type

Notes

datetime

When this error happened

-

Date with time

Required
user_id

Internal user ID who triggered this error

-

String

Required
message

Error message

-

String

Required
extra

Extra information

-

List of mapping

uri

URI where this error occurred

-

String

Required
code

HTTP error code

-

Integer

Required
payload

Original payload

-

String

The @type meta information for this object is: http://ns.minddistrict.com/error/hl7.