Skip to main content Skip to complementary content

Validate records in a container

Availability-noteDeprecated

Validates records in the specified container. The records will be provided in the request content as XML.

You can also validate MDM data records through the REST API using a Job. For more information, see How to validate MDM data records against the master storage through the REST API.

Request
POST /services/rest/data/{containerName}/validate

The body is an XML representation of one or more records to be validated, which are enclosed by a root tag with an arbitrary name, records for an example.

Parameters
  • containerName: This is a String value that represents the name of the container in which the records will be validated.

  • container: This is a String value which represents the type of the data container. It is either MASTER (default) or STAGING.
  • beforeSaving: This is a Boolean value which controls whether to invoke a Before Saving process associated to the record(s) during validation. By default, it is true. The validation operation should be an immutable action, thus it allows to disable the Before Saving process which in some cases can modify the data.

  • returnSource: This is a Boolean value which indicates whether to include the input records in the response. By default, it is false.

Headers
  • Content-Type: application/xml or text/xml
    Information noteNote: If the XML declaration is included in the XML request content and the encoding attribute is used, you must set its value to UTF-8.
  • Authorization: Basic Authentication scheme
  • Accept: application/xml or application/json
Response The list of the validation result for each record in JSON format, including the validity status, a message from the validation rule or the Before Saving process or empty, and optionally the input record as an echo.
Status
  • 200 OK: The validation operation is executed successfully, no matter what the validation result is.
  • 400 BAD REQUEST: The request contains invalid parameter, for example, invalid storage name or wrong XML document.
  • 403 FORBIDDEN: Missing required permission, for example, no required WRITE permission.
  • 404 NOT FOUND: The resource does not exist, for example, invalid storage type.
  • 500 INTERNAL SERVER ERROR: Other errors.
Limitation This REST API does not support validating records for the following entity:
  • the User entity in the PROVISIONING system data container,
  • the Role entity in the PROVISIONING system data container,
  • the Conf entity in the CONF system data container,
  • the AutoIncrement entity in the CONF system data container,
  • the BrowseItem entity in the SearchTemplate system data container, and
  • the HierarchySearchItem entity in the SearchTemplate system data container.

Sample request

<records> 
    <ProductFamily> 
        <Name>Literature</Name> 
        <Status>Approved</Status> 
    </ProductFamily> 
    <ProductFamily> 
        <Name>Comics</Name> 
        <Status>Unknown</Status> 
    </ProductFamily> 
</records>

Sample response in XML format

<results>
   <result>
      <isValid>false</isValid>
      <message>&lt;msg>[EN:Validation faild]&lt;/msg></message>
      <sourceXml>
         <ProductFamily>
            <Name>Literature</Name>
            <Status>Approved</Status>
         </ProductFamily>
      </sourceXml>
   </result>
   <result>
      <isValid>false</isValid>
      <message></message>
      <sourceXml>
         <ProductFamily>
            <Name>Comics</Name>
            <Status>Unknown</Status>
         </ProductFamily>
      </sourceXml>
   </result>
</results>

Sample response in JSON format

[
  {
    "isValid": false,
    "message": "<msg>[EN:Validation faild]</msg>\n",
    "sourceXml": "<ProductFamily><Name>Literature</Name><Status>Approved</Status></ProductFamily>"
  },
  {
    "isValid": true,
    "message": "",
    "sourceXml": "<ProductFamily><Name>Comics</Name><Status>Unknown</Status></ProductFamily>"
  }
]

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!