Hierarchical Value Service API  future
api indexresource index

POST {+table}/data

since: 0.1
Add a single record to the specified table for existing tenants only.

Please note that all the single record updates and deletes are no longer supported for the newly provisioned tenants. Use the Batch Scope APIs i.e SCOPE UPSERT and SCOPE DELETE) for the upsert operations.

Path Elements

+table
0.1required
string
The URI path to a specific table (whether by ID or by name).

Request Headers

pros-hvs-consistency
0.13optional
string
pros-hvs-consistency is an optional HTTP header used to define the data consistency level of the request. There is a trade off between data consistency and service availability and performance: higher data consistency can result in lower availability and slower performance, while lower data consistency can result in higher availability and faster performance.
0.13 valid values:
  • HIGHEST
  • HIGH
  • NORMAL
  • LOW
  • LOWEST
pros-rtpe-cache
0.35optional
string

pros-rtpe-cache is an optional HTTP header used to define the caching strategy used by Hierarchial Value Service for a request. This header helps control which internal caches should be used by the service when processing the request. There is a tradeoff between returning the most recent data and performance. Disabling caches will help ensure that the most recent data available are returned, but will likely increase the time required to process and respond to the request.

When disable.metadata is specified, caches related to table and dimension metadata will be disabled.

When disable.data is specified, caches related to table and dimension data will be disabled.

When disable.all is specified, all caches will be disabled.

When any cache is disabled, those caches will not be updated with values retrieved during a request.

0.35 valid values:
  • enable
  • disable.metadata
  • disable.data
  • disable.all

Resource Information

Request Content
json
Request Object
Response Content
json
Success Statuses
201  CREATED
Error Statuses
400  BAD REQUEST
Other Methods

Example - Create Data Using Table ID

Request:


  {
    "start": "2014-04-14T10:05:43",
    "end": "2014-05-18T20:14:21",
    "key": [
      {
        "nodeName" : "0011491975135",
        "dimName"  : "SAMPLE_PRODUCTS"
      },
      {
        "dimName"  : "LARGE_CITIES",
        "nodeName" : "US-TX"
      }
    ],
    "values" : [
      {
        "name"  : "Forecasted Volume",
        "value" : "17.26172",
        "unit"  : "cubic feet",
        "perQuantity" : 1
      },
      {
        "name"     : "Historic Revenue",
        "value"    : "15.27181",
        "currency" : "USD",
        "perQuantity" : 0
      },
      {
        "name"     : "Product Cost",
        "value"    : "7.97181",
        "unit"     : "Each",
        "currency" : "DKR",
        "perQuantity" : 1
      },
      {
        "name"     : "Competitor Influence",
        "value"    : "High"
      }
    ]
  }

    

Response:
HTTP/1.1  201  CREATED


  {
    "tableID" : "bb18498a-3228-425a-816c-481bac1030ca",
    "start": "2014-04-14T10:05:43",
    "end": "2014-05-18T20:14:21",
    "key": [
      {
        "dimID"    : "28484058-4ffc-329b-94ff-63e1ddbd7189",
        "dimName"  : "SAMPLE_PRODUCTS",
        "nodeID"   : "27de4ae8-61be-3fff-a397-16362cafeba2",
        "nodeName" : "0011491975135"
      },
      {
        "dimID"    : "c689acc7-ee13-3482-aa7b-c6a13419431c",
        "dimName"  : "LARGE_CITIES",
        "nodeID"   : "7baaa4ab-dd43-31a2-9454-ebc60fb910d5",
        "nodeName" : "US-TX"
      }
    ],
    "values" : [
      {
        "name"  : "Forecasted Volume",
        "value" : "17.26172",
        "type"  : "DECIMAL",
        "unit"  : "cubic feet",
        "perQuantity" : 1
      },
      {
        "name"     : "Historic Revenue",
        "value"    : "15.27181",
        "type"     : "DECIMAL",
        "currency" : "USD",
        "perQuantity" : 0
      },
      {
        "name"     : "Product Cost",
        "value"    : "7.97181",
        "type"     : "DECIMAL",
        "unit"     : "Each",
        "currency" : "DKR",
        "perQuantity" : 1
      },
      {
        "name"     : "Competitor Influence",
        "value"    : "High",
        "type"     : "STRING"
      }
    ]
  }

      

Example - Create Dynamic Data

Request:

      
      {
        "start": "2014-04-01T10:13:05",
        "end": "2014-12-31T11:15:18",
        "key": [
          {
            "dimName"  : "Location",
            "nodeName" : "US-TX"
          }
        ],
        "values" : [
          {
            "name" : "Price",
            "type" : "DECIMAL",
            "value": "10",
            "unit" : "each",
            "currency" : "USD",
            "perQuantity" : 1
          },
          {
            "name" : "Description",
            "type" : "STRING",
            "value": "Base price."
          }
        ]
      }
      
    

Response:
HTTP/1.1  201  CREATED

        
        {
          "tableID" : "cb18498a-3228-425a-816c-481bac1030ca",
          "start": "2014-04-01T10:13:05",
          "end": "2014-12-31T11:15:18",
          "key": [
            {
              "dimID"    : "a689acc7-ee13-3482-aa7b-c6a13419431c",
              "dimName"  : "Location",
              "nodeID"   : "8baaa4ab-dd43-31a2-9454-ebc60fb910d5",
              "nodeName" : "US-TX"
            }
          ],
          "values" : [
            {
              "name" : "Price",
              "type" : "DECIMAL",
              "value": "10",
              "unit" : "each",
              "currency" : "USD",
              "perQuantity" : 1
            },
            {
              "name" : "Description",
              "type" : "STRING",
              "value": "Base price."
            }
          ]
      }
      
      

Error Example - Create Dynamic Data Without Column Data Type Causing Error

see: HVS-004029

Request:

      
      {
        "start": "2014-04-01T10:13:05",
        "end": "2014-12-31T11:15:18",
        "key": [
          {
            "dimName"  : "Location",
            "nodeName" : "US-TX"
          }
        ],
        "values" : [
          {
            "name" : "Description",
            "value": "Base price."
          }
        ]
      }
      
    

Response:
HTTP/1.1  400  BAD REQUEST

        
        {
          "requestID"   : "db18498a-456-123a-816c-481bac1030ce",
          "errorID"     : "HVS-004029",
          "errorMessage": "The column type must be specified.",
          "resourceType": "record"
        }
        
      

Error Example - Create Dynamic Data With Unknown Column Data Type Causing Error

see: HVS-004004

Request:

      
      {
        "start": "2014-04-01T10:13:05",
        "end": "2014-12-31T11:15:18",
        "key": [
          {
            "dimName"  : "Location",
            "nodeName" : "US-TX"
          }
        ],
        "values" : [
          {
            "name" : "Description",
            "type" : "Not-Supported",
            "value": "Base price."
          }
        ]
      }
      
    

Response:
HTTP/1.1  400  BAD REQUEST

        
        {
          "requestID"   : "db18498a-456-123a-816c-481bac1030ce",
          "errorID"     : "HVS-004004",
          "errorMessage": "Invalid type Not-Supported for the record column.",
          "resourceType": "record"
        }
        
      

Error Example - Error response when creating data in the new schema

Request:

      
  {
    "start": "2014-04-14T10:05:43",
    "end": "2014-05-18T20:14:21",
    "key": [
      {
        "nodeName" : "0011491975135",
        "dimName"  : "SAMPLE_PRODUCTS"
      },
      {
        "dimName"  : "LARGE_CITIES",
        "nodeName" : "US-TX"
      }
    ],
    "values" : [
      {
        "name"  : "Forecasted Volume",
        "value" : "17.26172",
        "unit"  : "cubic feet",
        "perQuantity" : 1
      },
      {
        "name"     : "Historic Revenue",
        "value"    : "15.27181",
        "currency" : "USD",
        "perQuantity" : 0
      },
      {
        "name"     : "Product Cost",
        "value"    : "7.97181",
        "unit"     : "Each",
        "currency" : "DKR",
        "perQuantity" : 1
      },
      {
        "name"     : "Competitor Influence",
        "value"    : "High"
      }
    ]
  }

    

Response:
HTTP/1.1  400  BAD REQUEST

{
    "errorID": "HVS-004046",
    "errorMessage": "Single record updates have been disabled for this tenant. Please use Batch Scope APIs.",
    "resourceType": "record",
    "requestID": "HVS-5ba77a6d6efb37b8"
}