Contact - Create
Overview
This documentation describes the API endpoint for creating a new Contact document using the POST
method. The endpoint allows clients to submit a new document to the system, enabling the creation and storage of compliance certificates or other related documentation.
Endpoint
POST /api/v2013/documents
This is the endpoint to which the POST request should be made to create a new document.
Header
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. |
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:
Field | Type | Description |
---|---|---|
schema | String | Defines the schema or format of the document being posted. This field specifies the type of document and the structure it adheres to. The schema value helps the system understand how to interpret and validate the incoming data. It ensures that the document conforms to a predefined format or standard, facilitating consistency and compatibility across different parts of the system. The schema value typically corresponds to a specific schema definition or type that dictates the required fields, data types, and constraints for the document. |
URL Parameters
The following URL parameter is required:
Field | Type | Description |
---|---|---|
uid | String | A unique identifier for the document. This value is case-sensitive and must conform to the regular expression /^[A-Za-z0-9\-_]{11,128}$/ . This pattern allows for a combination of uppercase and lowercase letters, numbers, hyphens, and underscores, with a length ranging from 11 to 128 characters. The uid is crucial for uniquely identifying and retrieving the document within the system, ensuring that each document can be distinctly referenced and managed. It plays a key role in operations such as fetching, updating, or deleting the document, as well as in maintaining the integrity of document management processes. |
Validation Errors
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 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
The table below outlines the structure of the request body, including the fields, their types, and whether they are mandatory. Example values are provided for clarity.
Title | Field | Mandatory | Type | Example |
---|---|---|---|---|
header | Eheader | { "identifier": "068C83BA-995F-08C3-50CE-AD43545B3EB5", "schema": "contact", "languages": [ "en" ] } | ||
Prefix | prefix | lstring | { en:"Mr" } | |
First Name | firstName | True | string | John |
Middle Name | middleName | string | Smith | |
Last Name | lastName | True | string | Doe |
Gender | gender | Eterm | ||
Job Title | designation | lstring | { en:"Software" } | |
Organization | organization | True | lstring | { "en": "Test Organization" } |
Acronym | organizationAcronym | lstring | { "en": "CSBD" } | |
Department / Division / Unit | department | lstring | { "en": "Division" } | |
Type of Organization | organizationType | Eterm | { "identifier": "86D464C3-B5BB-4B02-85E4-1AAD8D64CD27" } | |
Street Address | address | lstring | { "en": "560 Franklin" } | |
City | city | lstring | { "en": "Cambridge" } | |
State or Province | state | lstring | { "en": "Ontario" } | |
Postal Code or Zip | postalCode | lstring | { "en": "N1R 7Z1" } | |
Country of Contact | country | True | Eterm | { "identifier": "ca" } |
Phone Number(s) | phones | string[] | [ "54825578896" ] | |
Fax Number(s) | faxes | string[] | [ "123456" ] | |
Email(s) | emails | True | string[] | [ "pramodjsam@gmail.com" ] |
Website Address(es) | websites | Elink[] | [ { "url": "http://www.google.com" } ] | |
Address Type | addressType | string | organization | |
Relevant Information | relevantInformation | lstring | ||
Relevant Documents | relevantDocuments | Elink[] | ||
Contact Type | type | True | string | person |
Country | government | Eterm | { "identifier": "af" } | |
Organization | contactOrganization | True | Ereference | { "identifier": "SIMP-22D52282-2FB2-AD2A-2965-476DFF6A7F37@1" } |
Playground
Swagger playground is loading, please wait...