Skip to main content Skip to complementary content
Close announcements banner

Create a record

Creates a new record in the specified data container. The record will be provided in the request content as XML or JSON. The ID of the record will be returned inside the location response header field.

Information noteNote: Your submitted ID will be used to create the record even if the ID is set to be auto-generated in the data model. An update operation will be performed if a record with the same ID already exists in MDM.
Request
POST /services/rest/data/{containerName}

The body is an XML or JSON representation of the record to be created.

Parameters
  • containerName: This is a String value which specifies the name of the data container in which you want to create a new data record.
  • container: This is a String value which represents the type of the data container. It is either MASTER (default) or STAGING.
  • updateReport: This is a Boolean value which controls whether to generate a journal entry (update report). By default, it is true.
  • beforeSaving: This is a Boolean value which controls whether to invoke a Before Saving process. By default, it is false. If the beforeSaving parameter is set to true, the updateReport parameter must also be set to true, since a journal entry (update report) needs to be generated to invoke the Before Saving process.
Headers
  • Content-Type: application/xml or text/xml or application/json
    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
Response No content.
Status
  • 200 OK: The operation is executed successfully.
  • 400 BAD REQUEST: The request contains invalid parameter, for example, invalid storage name, invalid storage type, or wrong XML document.
  • 401 UNAUTHORIZED: Login fails, invalid username or password.
  • 403 FORBIDDEN: Missing required permission, for example, no required WRITE permission.
  • 404 NOT FOUND: The resource does not exist, for example, invalid service URL.
  • 500 INTERNAL SERVER ERROR: Other errors, for example, the Before Saving process returns error.
Limitation This REST API does not support creating a new record for the Role entity in the PROVISIONING system data container.

Sample request in XML format

<Product>
  <Picture>/imageserver/upload/TalendShop/tshirt.jpg</Picture>
  <Id>231035936</Id>
  <Name>Talend Fitted T-Shirt</Name>
  <Description>Fitted T. ultra-fine combed ring spun cotton</Description>
  <Features>
    <Sizes/>
    <Colors/>
  </Features>
  <Availability>false</Availability>
  <Price>15.99</Price>
  <Family>[1]</Family>
  <OnlineStore>Talend Shop@@http://www.cafepress.com/Talend.231035936</OnlineStore>
  <Stores>
    <Store></Store>
  </Stores>
</Product>

Sample request in JSON format

{
    "Product": {
        "Picture": "/imageserver/upload/TalendShop/tshirt.jpg",
        "Id": "231035936",
        "Name": "Talend Fitted T-Shirt",
        "Description": "Fitted T. ultra-fine combed ring spun cotton",
        "Features": {
            "Sizes": {},
            "Colors": {}
        },
        "Availability": "false",
        "Price": "15.99",
        "Family": "[1]",
        "OnlineStore": "Talend Shop@@http://www.cafepress.com/Talend.231035936",
        "Stores": {}
    }
}

Sample response headers

{
  "pragma": "No-cache",
  "date": "Tue, 18 Dec 2018 02:35:36 GMT",
  "location": "231035936"
}

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!