Dimension Service API  2.0.0
api indexresource index

POST {+dimension}/node-attributes

since: 0.6
Creates a new attribute whose values are stored in nodes of the same dimension. Attributes require a name identifier and a constraint. The AttributeConstraint describes the attribute's data type and any other boundary conditions. The attribute's name must be unique among all other attributes in the same dimension, for use by external systems to refer to or access the attribute. Additionally, each attribute will be assigned a permanent, system-generated ID at the time of creation; however, it is an error to set the id field as a part of this operation.

Path Elements

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

Request Headers

pros-dimension-consistency
0.13optional
string
pros-dimension-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

Resource Information

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

Example - creating a new attribute

Request:

{
  "name"  : "POPULATION",
  "labels": [
    {
      "locale" :"en",
      "value"  :"Population"
    },
    {
      "locale" :"es",
      "value"  :"poblaciĆ³n"
    }
  ],
  "constraints": {
    "type": "integer-constraints",
    "min": 0
  }
}
      

Response:
HTTP/1.1  201  CREATED

{
  "id"   : "c689acc7-ee13-3482-aa7b-c6a13419431c",
  "name" : "POPULATION",
  "label": {
    "locale" :"en",
    "value"  :"Population"
  },
  "constraints": {
    "type": "integer-constraints",
    "min": 0
  }
}
      

Example - missing constraint and data type

Request:

{
  "name"  : "MY_ATTRIBUTE",
  "labels": [
    {
      "locale" :"en",
      "value"  :"My Attribute"
    }
  ]
}
      

Response:
HTTP/1.1  201  CREATED

{
  "id"   : "7f4731f0-36c6-4718-87b4-ce87ecd47a26",
  "name" : "MY_ATTRIBUTE",
  "label": {
    "locale" :"en",
    "value"  :"My Attribute"
  },
  "constraints": {
    "type": "text-constraints"
  }
}
      

Error Example - the 'id' field cannot be assigned

see: DIM-001402

Request:

{
  "id"    : "c689acc7-ee13-3482-aa7b-c6a13419431c",
  "name"  : "POPULATION",
  "labels": [
    {
      "locale" :"en",
      "value"  :"Population"
    }
  ],
  "constraints": { "type": "integer-constraints" }
}
      

Response:
HTTP/1.1  400  BAD REQUEST

  {
    "errorID"     : "DIM-001402",
    "errorMessage": "Sorry, the 'id' field value cannot be pre-assigned when creating an attribute.",
    "requestID"   : "DIM-b7780800200c9a66",
    "details": [ {"fieldID": "id"} ]
  }      

Error Example - the 'name' field is missing, empty, or contains only whitespace

see: DIM-001413

Request:

{
  "name"  : " ",
  "labels": [
    {
      "locale" :"en",
      "value"  :"Population"
    }
  ],
  "constraints": { "type": "integer-constraints" }
}
      

Response:
HTTP/1.1  400  BAD REQUEST

  {
    "errorID"     : "DIM-001403",
    "errorMessage": "Sorry, when creating an attribute the 'name' field must not be missing or blank.",
    "requestID"   : "DIM-b7780800200c9a66",
    "details": [ {"fieldID": "name"} ]
  }      

Error Example - new attribute name is already in use

see: DIM-001404

Request:

{
  "name"  : "POPULATION",
  "labels": [
    {
      "locale" :"en",
      "value"  :"Population"
    }
  ],
  "constraints": { "type": "integer-constraints" }
}
      

Response:
HTTP/1.1  409  CONFLICT

{
  "errorID"     : "DIM-001404",
  "errorMessage": "Sorry, the name 'POPULATION' is already used by an existing attribute in the dimension.",
  "requestID"   : "DIM-b7780800200c9a66",
  "details": [ {"fieldID": "name"} ]
}       

Error Example - missing request payload

Request:

Response:
HTTP/1.1  400  BAD REQUEST