Document Validations
Overview
The "Document Validations" API endpoint is designed to validate documents. This endpoint allows clients to submit a document for validation based on a specified schema and optional parameters. It performs a series of checks to ensure that the document conforms to the required format and rules defined by the schema.
Endpoint
POST /api/v2013/documents/x/validate
Headers
The request must include the following headers:
| Field | Type | Description |
|---|---|---|
| Content-Type | String | Specifies the media type of the request body. This header indicates the format of the data being sent to the server. The allowed value is application/json, which means the request body is formatted as JSON. This helps the server understand how to parse and process the incoming data. |
| Authorization | String | Provides the token used to authenticate the request. This header is essential for identifying and verifying the client making the request. The token should be included in the header to gain access to protected resources or services. Ensure that the token is kept secure and is valid for the requested operation. |
| Realm | String | Defines the specific context or environment in which the Clearing-House request is being made. The allowed values are abs, chm, and bch, each representing different operational contexts. This helps the server route the request appropriately based on the specified realm. |
| Accept | String | Specifies the format in which the client expects the server to return the response data. The allowed value is application/json, indicating that the client prefers the response in JSON format. This informs the server of the desired response format, ensuring that the client receives data in a readable and expected format. |
Headers required to authenticate and define the context and format of the request and response. The Authorization header must contain a valid token, while the Content-Type and Accept headers specify the format of the document and response, respectively. Here are the steps to get the Authorization token.
Query Parameters
The following query parameters can be used to refine the request:
| Field | Type | Description |
|---|---|---|
| schema | String | Defines the format or schema of the record being posted. This field specifies the type and structure of the record to ensure it conforms to a predefined format or standard. It helps the system interpret and validate the incoming data correctly. The value for schema typically corresponds to a specific schema definition that outlines the required fields, data types, and constraints for the record. This ensures that the record adheres to the expected structure and is compatible with the system's processing rules. |
| metadata | Object | Optional. Contains additional information about the record that can be used to determine security access and other attributes. The metadata object can include various parameters depending on the record type and its requirements. This may encompass information such as access permissions, record classification, or other contextual data that helps manage the record effectively. The structure and content of metadata may vary based on the specific needs and configuration of the record type. |
| government | String | Optional. Specifies the government code associated with the record for national records. The value should adhere to the "ISO 3166-1 alpha-2" standard, which uses two-letter country codes to represent different countries. This field is used to assign or categorize the record under a specific national jurisdiction or government entity. For records that are not tied to a national context, this field may be omitted or left blank. |
Validation Error
The table below provides descriptions for each error type that may appear in the "errors" property. These errors are intended to help identify missing or incorrect fields and values within the record parameter, enabling precise adjustments to meet validation requirements.
| Error Type | Description |
|---|---|
| Error.Mandatory | Indicates a required field is missing. |
| Error.MandatoryAnyOf | Indicates at least one field from a set of mandatory fields is missing. |
| Error.InvalidValue | Indicates the provided value is not valid according to the specified schema. |
| Error.InvalidProperty | Indicates an invalid property or field name. |
| Error.UnspecifiedLocale | Indicates a locale or language code is missing or invalid. |
| Error.UnexpectedTerm | Indicates an unexpected term or parameter. |
| Error.InvalidType | Indicates the provided data type is not valid. |
Request Body
| Title | Field | Mandatory | Type | Example |
|---|---|---|---|---|
| header | Header | { "identifier": "CB51626B-CF45-2AA0-3A24-459669DDCC34" } | ||
| Country | government | True | Term | {"identifier": "af"} |
| The values for the remaining fields are dependent on the specific schema that is selected. Detailed schema definitions for each record type can be found under their respective sections. These definitions provide the necessary structure and guidelines for the fields, ensuring that they align with the selected schema's requirements. | ||||
Playground
Swagger playground is loading, please wait...