Page last modified 09:09, 13 Jul 2016 by kari_admin

Validation Reports

    API Reports

    Queue resource can list ongoing validations and fetch information about invidual validation.

    Reports resource lists available validation reports and retrieve validation report in Json format.

    Reports -resource return always 200 OK when successful.

    HTTP Methods

    GET /v1/reports

    Returns list of available validatoin reports. Reports -resource lists last 10 available reports.

    Possible status texts are

    • completed = Validation report is available
    • error = Validation report is available but validation has ended with an error.

     

    Example Request

    curl -k -H "Authorization: Bearer Token" https://<service_or_demo>.xmldation.com/api/v1/reports
    

     

    Example Response

    HTTP/1.1 200 OK

    {
      "reports" : {
        "report" : [ {
          "status" : "completed",
          "created_at" : "2014-02-26 09:38:08",
          "id" : "accf6520-cdf2-4f67-8cf0-595c50c8d72b"
        }, {
          "status" : "completed",
          "created_at" : "2014-02-26 09:08:03",
          "id" : "243479fd-5f59-461c-9f33-831334c457ad"
        }, {
          "status" : "completed",
          "created_at" : "2014-02-26 09:08:02",
          "id" : "bdf3cbdc-5b56-4233-a40c-ec3e01275f55"
        }, {
          "status" : "error",
          "created_at" : "2014-02-26 09:08:02",
          "id" : "38d85414-578b-41b6-a6ec-5fb701ff6b86"
        } ]
      }
    }

     

    GET /v1/reports/{id}

    Get specific validation report object.

     

    Example request

    curl -k -H "Authorization: Bearer Token" https://<service_or_demo>.xmldation.com/api/v1/reports/69f4e0c2-16c6-4c91-97b0-16be708ec082
    

     


    Example Response


    HTTP/1.1 200 OK

    {
      "validationResult" : {
        "xmlfile" : {
          "id" : "54e54f19-51e5-43d0-931f-acce3278443b",
          "pcode" : "1234placeholder2",
          "result" : false,
          "encodingErrors" : null,
          "unexpectedExceptions" : null,
          "schemaValidation" : null,
          "businessValidation" : {
            "result" : false,
            "errors" : {
              "rule" : [ {
                "ruleName" : "R_35a_E_CdtrAgt_mand",
                "ruleDescription" : "<![CDATA[Beneficiary's bank (CdtrAgt) is mandatory.]]>",
                "level" : 3,
                "levelText" : "ERROR",
                "rulesetname" : "Crossborder_CT_Business_Rules",
                "wikilink" : null,
                "linesRulesFailedOn" : {
                  "line" : 40
                }
              }, {
                "ruleName" : "R_38a_Dbtr_PstlAdr_noQuery",
                "ruleDescription" : "<![CDATA[Dbtr/PstlAdr/Ctry and AdrLine are mandatory in crossborder payments.]]>",
                "level" : 3,
                "levelText" : "ERROR",
                "rulesetname" : "Crossborder_CT_Business_Rules",
                "wikilink" : null,
                "linesRulesFailedOn" : {
                  "line" : 17
                }
              } ]
            },
            "notices" : {
              "rule" : [ {
                "ruleName" : "R_38_N_Cdtr_PstlAdr_StrtNm",
                "ruleDescription" : "<![CDATA[Postal Address' street name usage is recommended.]]>",
                "level" : 2,
                "levelText" : "NOTICE",
                "rulesetname" : "Crossborder_CT_Business_Rules",
                "wikilink" : null,
                "linesRulesFailedOn" : {
                  "line" : 49
                }
              }, {
                "ruleName" : "R_39_N_Cdtr_PstlAdr_BldgNb",
                "ruleDescription" : "<![CDATA[Postal Address' building number usage is recommended.]]>",
                "level" : 2,
                "levelText" : "NOTICE",
                "rulesetname" : "Crossborder_CT_Business_Rules",
                "wikilink" : null,
                "linesRulesFailedOn" : {
                  "line" : 49
                }
              }, {
                "ruleName" : "R_40_N_Cdtr_PstlAdr_PstCd",
                "ruleDescription" : "<![CDATA[Postal Address' post code usage is recommended in creditor.]]>",
                "level" : 2,
                "levelText" : "NOTICE",
                "rulesetname" : "Crossborder_CT_Business_Rules",
                "wikilink" : null,
                "linesRulesFailedOn" : {
                  "line" : 49
                }
              }, {
                "ruleName" : "R_41_N_Cdtr_PstlAdr_TwnNm",
                "ruleDescription" : "<![CDATA[Postal Address' town name usage is recommended in creditor.]]>",
                "level" : 2,
                "levelText" : "NOTICE",
                "rulesetname" : "Crossborder_CT_Business_Rules",
                "wikilink" : null,
                "linesRulesFailedOn" : {
                  "line" : 49
                }
              } ]
            },
            "infos" : null
          }
        }
      }
    }

    Validation Report response fields

    This chapter includes some additional details how different fields in validation report should be intepreted.

    Field Type Description
    validationResult Object Results envelope
    xmlfile Object field containing validation results per file
    id String Original ID
    pcode String Original pcode
    result Boolean

    true|false.

    Global value if validation of file is passed or failed. This includes schemavalidation result and business validation results.

    Additionally if any other error occurs, validation result  is marked as false.

    encodingErrors String Error String if encoding errors are detected in the validated file.
    unexpectedExceptions String

    Error string if unexpected errors has occurred during the validation.

    This is usually caused by technical problem and XMLdation support should be informed.

    schemaValidation null or Object Null if no schema errors. Otherwise contains Array of Schemaerrors
    schemaValidation -> result Boolean

    true|false

    Schema validation result

    schemaValidation -> errors Array Contains Array of possible SchemaValidation Error objects
    schemaValidation -> errors -> rule Object

    Rule object contains details about invidual Schema validation  Error.

    businessValidation null or Object Null if no Business validation rules (Errors, notices, infos). Otherwise contains Array of Schemaerrors
    businessValidation -> result Boolean

    true|false

    Result if Business validation is considered passed or failed. Any error level rule marks Business validation as failed. If there's only Notices and/or Infos. Business validation is passed.

     

    businessValidation -> errors|notices|infos Array

    Array of businessValidation error, notice or Info rule objects.

     

    businessValidation -> errors|notices|infos -> rule Object

    Rule object contains details about invidual businessValidation error, notice or info.

    Structure for these 3 objects are the same.

    Business Error marks the whole validation  result as false (failed).

    Notices are possible recommendations. Infos are other suggestions or extra information.

         

    Possible error messages

    401 Unauthorized

    HTTP/1.1 Status 401 will be returned in case invalid credentials are provided. See additional information from Authentication

    404 Not Found

    HTTP/1.1 Status 404 will be returned if the requested report item does not exists.

    {
      "error" : {
        "status" : 404,
        "message" : "report not found",
        "extraInfo" : "https://wiki.xmldation.com/XMLdation_API_Service_Guide/v1/API_Resources/Validation_Reports"
      }
    }
    
    Menu