Dimension Service API  2.0.0
api indexresource index

POST dimensions

since: 0.6
Creates a new Dimension. A dimension requires an externally-provided name identifier, unique among all other dimensions (belonging to the same tenant or organization, if applicable), for use by external systems to refer to or access the dimension. Additionally, each dimension will be assigned a permanent, system-generated ID at the time of creation; however, it is an error to set the Dimension.id field as a part of this operation.

This is a privileged operation.

Aliasing

In some business cases, it may be common to share exactly the same dimensional structure and data, but under more than one name. Rather than define, load, and, maintain two or more copies of the same information, an alias creates additional, logical dimensions that share the structure and data of the original, or source, dimension. A dimension and its alias may seem to be exact copies of each other, but any change in one will be mirrored immediately in the other. Since the underlying data is shared among all related aliases, there is no chance of introducing errors due to one dimension being out of synchronization with the others.

One example from the airline industry: flights take off from and land at the same general set of airports (location) but it takes a pair of aiports (origin and destination) to properly communicate the starting and ending point for a flight, respectively. Using an alias in this case will eliminate redundancy while ensuring that it is always possible to make a round-trip itinerary between any two airports in the airline's network.

Internationalization Support

Dimensions support international users by providing human-readable, descriptive labels separate from the external name and system-generated id values. Labels are distinguished by an associated locale, represented by an IETF BCP-47 tag, which combines a base language (e.g. en, es, fr, etc.) with an optional region (e.g. US, MX, DE, etc.). Every dimension requires a default locale, as a fallback when a user or request does not indicate any preference, or when the user's preferred locale has no label data. When creating an alias of another, existing dimension, the locale information is inherited from that dimension. Otherwise, the default locale must be specified as a part of this operation when defining a brand new, non-aliased dimension. It is recommended that a dimension's default locale be set to a common base language (e.g. en for English) and not a region-specific locale, so that the default locale applies to the broadest potential user base.

In addition to the default locale, each non-alias dimension may declare full support for other languages or language-region locales. Again, alias dimensions will inherit the settings from the source (aliased) dimension. New, standalone dimensions must set the Dimension.locales array so that it includes all the desired locales. Language-aware features such as label text search will build indexes only for those configured languages/locales. In most cases, supporting one or more base languages is sufficient; it is possible, however, to add support for regional locales where desired or necessary. For instance, supporting the base language en is generally adequate for English-speaking users from the United States (en-US) and from Great Britain (en-GB) even though the two regions prefer different spellings for some words. In this case, the language-aware index knows how to normalize British and American English and support both sets of users from the same index. As long as the base language (en) is configured as one of the dimension's locales, it is possible to store separate label text for the en-US and/or en-GB regional locales when actually necessary, on an item-by-item basis, even though the regional variants were not explicitly configured. (Note: a label for the configured, base language should always be defined.) However, if two regional variants are drastically different in spelling or meaning then it may be justified to configure support for one (or both) variant(s) in addition to the base language — but this will incur additional costs for storing and maintaining the extra index data. Declaring support for additional languages or language-region variants is only useful when appropriate label text exists and can be constistently loaded for those locales.

The labels for the dimension itself can be optionally set when creating a new dimension or alias by populating the Dimension.labels field with labels for zero or more unique languages/locales. Configured locales that do not have a provided label will generally fall back to using the item's configured name; when this occurs, search results may be suboptimal for those affected items and/or locales. Labels for locales whose base languages are not configured in the Dimension.locales field may be ignored. When assigning labels to an new alias, the configured locales are those defined by the source dimension.

Query Parameters

aliasOf
0.6optional
string
The system-generated ID of any existing dimension to be used as a source, causing the newly-created dimension to be an alias of the source dimension. Once an alias is created it acts and can be used like any other dimension, including acting as the source for other aliases.

Dimension aliases have their own name, which must still be unique within the set of all dimensions (and their aliases), and define their own labels. However, all other settings are inherited from the source dimension and cannot be independently set for the alias. The inherited settings include but are not limited to: the set of supported locales; the default locale; and all aspects, nodes, and related structure (including the root node and aspect); as well as the localized label text for all but the dimension alias itself.

Operations that create an alias should not define values for the settings inherited from the source dimension. Specifically, the object provided in the POST paylod should exclude the following fields:

example value

c689acc7-ee13-3482-aa7b-c6a13419431c

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 dimension (not an alias)

Request:

{
  "name"         : "LARGE_CITIES",
  "locales"      : [ "es", "en", "en-GB" ],
  "defaultLocale": "es",
  "labels": [
    { "locale": "en",    "value" : "Large Cities" },
    { "locale": "en-GB", "value" : "Rather Big Townships" },
    { "locale": "es",    "value" : "Ciudades Grandes" }
  ]
}
      

Response:
HTTP/1.1  201  CREATED

{
  "id"           :"c689acc7-ee13-3482-aa7b-c6a13419431c",
  "name"         :"LARGE_CITIES",
  "locales"      :["es","en","en-GB"],
  "defaultLocale":"es",
  "label":{
    "locale" :"en",
    "value"  :"Large Cities"
  },
  "rootAspect": { ... },
  "rootNode": { ... }
}
        

Example - Creating a new alias of an existing dimension

Request:

{
  "name"  : "Major Population Centers",
  "labels": [
    { "locale": "en",    "value" : "Major Population Centers" },
    { "locale": "en-GB", "value" : "Major Population Centres" },
    { "locale": "es",    "value" : "principales centros de población" }
  ]
}
      

Response:
HTTP/1.1  201  CREATED

{
  "id"           :"c689acc7-ee13-3482-aa7b-c24502542a7d",
  "name"         :"Major Population Centers",
  "locales"      :["es","en","en-GB"],
  "defaultLocale":"es",
  "label":{
    "locale" :"en",
    "value"  :"Major Population Centers"
  },
  "rootAspect": { ... },
  "rootNode": { ... }
}
        

Error Example - the 'id' field cannot be assigned

see: DIM-001002

Request:

{
  "id"           : "abcdef00-1234-5678-9012-34567890abcd",
  "name"         : "LARGE_CITIES",
  "locales"      : [ "es", "en", "en-GB" ],
  "defaultLocale": "es",
  "labels": [
    { "locale": "en",    "value" : "Large Cities" },
    { "locale": "en-GB", "value" : "Rather Big Townships" },
    { "locale": "es",    "value" : "Ciudades Grandes" }
  ]
}
      

Response:
HTTP/1.1  400  BAD REQUEST

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

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

see: DIM-001003

Request:

{
  "name"         : " ",
  "locales"      : [ "es", "en", "en-GB" ],
  "defaultLocale": "es",
  "labels": [
    { "locale": "en",    "value" : "Large Cities" },
    { "locale": "en-GB", "value" : "Rather Big Townships" },
    { "locale": "es",    "value" : "Ciudades Grandes" }
  ]
}
      

Response:
HTTP/1.1  400  BAD REQUEST

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

Error Example - if the new 'name' is already in use

see: DIM-001004

Request:

{
  "name"         : "LARGE_CITIES",
  "locales"      : [ "es", "en", "en-GB" ],
  "defaultLocale": "es",
  "labels": [
    { "locale": "en",    "value" : "Large Cities" },
    { "locale": "en-GB", "value" : "Rather Big Townships" },
    { "locale": "es",    "value" : "Ciudades Grandes" }
  ]
}
      

Response:
HTTP/1.1  409  CONFLICT

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

Error Example - missing request payload

Request:

Response:
HTTP/1.1  400  BAD REQUEST

Error Example - creating an alias of an unknown or deleted dimension ID

see: DIM-001006

Request:

{
  "name"  : "Major Population Centers",
  "labels": [
    { "locale": "en",    "value" : "Major Population Centers" },
    { "locale": "en-GB", "value" : "Major Population Centres" },
    { "locale": "es",    "value" : "principales centros de población" }
  ]
}
      

Response:
HTTP/1.1  400  BAD REQUEST

{
  "errorID"     : "DIM-001006",
  "errorMessage": "Could not create a new alias from the specified source dimension
                     because the source does not exist.",
  "requestID"   : "DIM-0800200c9a66",
  "details"     : [
    {
      "fieldID"   : "aliasOf",
      "fieldValue": "abcdef00-1234-5678-9012-34567890abcd"
    }
  ]
}