Skip to main content Skip to complementary content

Get records by query

Availability-noteDeprecated

Gets data records from the specified data container. Query is provided in the request content as JSON.

You can also retrieve a snapshot of a specific MDM record and navigate through the record history. For more information, see MDM Time Machine.

Request
PUT /services/rest/data/{containerName}/query

The body is a query language in JSON format. The parameter content type is application/json.

Parameters
  • containerName: This is a String value which specifies the name of the data container from which you want to read data records.
  • container: This is a String value which represents the type of the data container. It is either MASTER (default) or STAGING.
  • ignoreCase: This is a Boolean value which controls whether to ignore the case of the entity and attribute names in JSON response. By default, it is true, which means all entity and attributes names in JSON response will be in lowercase.
Headers
  • Content-Type: application/json
  • Authorization: Basic Authentication scheme
  • Accept: application/xml or application/json
Response The documents of the records in the specified container.
Status
  • 200 OK: The operation is executed successfully.
  • 400 BAD REQUEST: The request contains invalid parameter, for example, invalid storage name or invalid storage type.
  • 401 UNAUTHORIZED: Login fails, invalid username or password.
  • 404 NOT FOUND: The resource does not exist, for example, invalid service URL.
  • 500 INTERNAL SERVER ERROR: Other errors.
Limitation This REST API does not support getting records by query for the Role entity in the PROVISIONING system data container.

Sample request

{
    "select": { 
        "from": ["Product"],
        "where": {
            "gt":[
                {"field": "Product/Price"},
                {"value": "16"}
            ]   
        }
    }
}

Sample response in XML format

<results>
   <Product>
      <Picture>/imageserver/upload/TalendShop/dog.jpg</Picture>
      <Id>231035933</Id>
      <Name>partialNameUpdate1</Name>
      <Description>partialDescriptionUpdate1</Description>
      <Features>
         <Sizes>
            <Size>Small</Size>
            <Size>Medium</Size>
            <Size>Large</Size>
            <Size>X-Large</Size>
         </Sizes>
         <Colors>
            <Color>White</Color>
         </Colors>
      </Features>
      <Availability>true</Availability>
      <Price>111.00</Price>
      <Family>[14]</Family>
      <OnlineStore>Talend Shop@@http://www.cafepress.com/Talend.231035933</OnlineStore>
      <Stores/>
   </Product>
   <Product>
      <Picture>/imageserver/upload/TalendShop/tshirt.jpg?width=150&amp;amp;height=90&amp;amp;preserveAspectRatio=true</Picture>
      <Id>231035935</Id>
      <Name>partialNameUpdate3</Name>
      <Description>partialDescriptionUpdate3</Description>
      <Features>
         <Sizes>
            <Size>Medium</Size>
         </Sizes>
         <Colors>
            <Color>White</Color>
         </Colors>
      </Features>
      <Availability>false</Availability>
      <Price>333.00</Price>
      <Family>[1]</Family>
      <OnlineStore>Talend Shop@@http://www.cafepress.com/Talend.231035936</OnlineStore>
      <Stores/>
   </Product>
</results>

Sample response in JSON format

[
  {
    "product": {
      "picture": "/imageserver/upload/TalendShop/dog.jpg",
      "id": "1",
      "name": "New Name",
      "description": "Doggie t-shirt from American Apparel",
      "features": {
        "sizes": {
          "size": [
            "Small",
            "Medium",
            "Large",
            "X-Large"
          ]
        },
        "colors": {
          "color": [
            "White"
          ]
        }
      },
      "availability": "true",
      "price": "16.99",
      "family": "[14]",
      "onlinestore": "Talend Shop@@http://www.cafepress.com/Talend.231035933",
      "stores": {}
    }
  },
  {
    "product": {
      "picture": "/imageserver/upload/TalendShop/dog.jpg",
      "id": "231035933",
      "name": "Talend Dog T-Shirt",
      "description": "Doggie t-shirt from American Apparel",
      "features": {
        "sizes": {
          "size": [
            "Small",
            "Medium",
            "Large",
            "X-Large"
          ]
        },
        "colors": {
          "color": [
            "White"
          ]
        }
      },
      "availability": "true",
      "price": "16.99",
      "family": "[14]",
      "onlinestore": "Talend Shop@@http://www.cafepress.com/Talend.231035933",
      "stores": {}
    }
  },
  {
    "product": {
      "picture": "/imageserver/upload/TalendShop/spaghetti.jpg",
      "id": "231035934",
      "name": "Talend Jr. Spaghetti Tank",
      "description": "Spaghetti tank from American Apparel",
      "features": {
        "sizes": {
          "size": [
            "Small",
            "Medium",
            "Large",
            "X-Large"
          ]
        },
        "colors": {
          "color": [
            "White",
            "Light Blue",
            "Light Pink",
            "Lemon"
          ]
        }
      },
      "availability": "true",
      "price": "16.99",
      "family": "[8]",
      "onlinestore": "Talend Shop@@http://www.cafepress.com/Talend.231035934",
      "stores": {}
    }
  }
]

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 – please let us know!