Skip to content

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:

FieldTypeDescription
Content-TypeStringSpecifies 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.
AuthorizationStringProvides 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.
RealmStringDefines 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.
AcceptStringSpecifies 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.

Realm Values for Development:

  • abs-dev: Represents the development environment for ABS (Access and Benefit-sharing Clearing-House). Use this value when testing or developing features related to ABS in a non-production setting.
  • bch-dev: Indicates the development environment for BCH (Biosafety Clearing-House). This value is used for testing or development purposes related to BCH functionalities.
  • chm-dev: Specifies the development environment for CHM (Central Clearing-House Mechanism). This realm is used when working on features or testing in the CHM context within a development environment.

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:

FieldTypeDescription
schemaStringDefines the format or schema of the document being posted. This field specifies the type and structure of the document 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 document. This ensures that the document adheres to the expected structure and is compatible with the system's processing rules.
metadataObjectOptional. Contains additional information about the document that can be used to determine security access and other attributes. The metadata object can include various parameters depending on the document type and its requirements. This may encompass information such as access permissions, document classification, or other contextual data that helps manage the document effectively. The structure and content of metadata may vary based on the specific needs and configuration of the document type.
governmentStringOptional. 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 document parameter, enabling precise adjustments to meet validation requirements.

Error TypeDescription
Error.MandatoryIndicates a required field is missing.
Error.MandatoryAnyOfIndicates at least one field from a set of mandatory fields is missing.
Error.InvalidValueIndicates the provided value is not valid according to the specified
schema.
Error.InvalidPropertyIndicates an invalid property or field name.
Error.UnspecifiedLocaleIndicates a locale or language code is missing or invalid.
Error.UnexpectedTermIndicates an unexpected term or parameter.
Error.InvalidTypeIndicates the provided data type is not valid.

Request Body

TitleFieldMandatoryTypeExample
headerEheader { "identifier": "CB51626B-CF45-2AA0-3A24-459669DDCC34" }
CountrygovernmentTrueEterm{"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...