Create an index attribute
post
/gsadmin/v1/{appName}/attributes/{owner}/{attributeName}
Creates a new attribute in the specified config owner attributes list.
Request
Supported Media Types
- application/json
- application/zip
Path Parameters
- appName
-
Type:
stringRequired:trueSpecifies the name of your application, for example, Discover.- attributeName
Type:stringRequired:trueSpecifies the attribute name in the owner's index attributes, for example, "product.name"- owner
Type:stringRequired:trueSpecifies the owner of the index attributes, for example, system.Body ParameterThe attribute to create.Root Schema : AttributeType:objectRepresents an index attribute. The object conforms to one of the following ecr-types:- dimension
- property
- derived-property
- context
-
Type:
arraycontextAdditional Properties Allowed: - derivedPropertyFunction
-
Type:
string - derivedPropertySource
-
Type:
string - displayConfig
-
Type:
objectDisplayConfigAdditional Properties Allowed:Contains configuration on how to display an attribute and its values. - displayOrder
-
Type:
integer - ecr:createDate
-
Type:
string - ecr:lastModified
-
Type:
string - ecr:lastModifiedBy
-
Type:
string - ecr:type
-
Type:
stringAllowed Values:[ "dimension", "property", "derived-property" ] - isAutogen
-
Type:
boolean - isRecordSearchEnabled
-
Type:
boolean - isWildcardEnabledInRecordSearch
-
Type:
boolean - propertyDataType
-
Type:
string - sourcePropertyNames
-
Type:
arraysourcePropertyNamesAdditional Properties Allowed:
Nested Schema : contextType:array-
Type:
string
Nested Schema : DisplayConfigType:objectContains configuration on how to display an attribute and its values.- sort
-
Type:
stringThis defines a list of sort options for sorting the values of this dimension. Each sort option is specified by a sort function, comma, sort order. Multiple sort options are separated by semicolons and any number of sort options may be specified. Possible sort functions are 'alpha', 'freq', and 'rank' and sort orders are 'asc' and 'desc'. For example, to sort by rank ascending and break ties by frequency descending use 'rank,asc;freq,desc'.
Nested Schema : sourcePropertyNamesType:array-
Type:
string
Security- basicAuth
-
Type:
basicDescription:Basic username/password authentication.
Response
Supported Media Types
- application/json
201 Response
Index attribute successfully created.
Body
Root Schema : Response
Type:
object- message
-
Type:
string - status
-
Type:
integer(int32)
Examples
Request Body Example
The following shows a sample request body to create an attribute with ecr-type: ???property??? in the specified owner index attributes list.
:content = {
ecr:lastModifiedBy: "admin",
propertyDataType: "ALPHA",
ecr:lastModified: "2017-10-15T15:50:27.062Z",
sourcePropertyNames: [
"camera.Aperture range"
],
ecr:createDate: "2017-10-15T15:50:26.839Z",
ecr:type: "property"
}
The following shows a sample request body to create an attribute with ecr-type: ???dimension??? in the specified owner index attributes list. The displayConfig parameter specifies that dimension values in this dimension are sorted in descending order of frequency; ties are sorted in ascending alphabetical order.
{
"camera.color": {
"isWildcardEnabledInRecordSearch": true,
"displayOrder": 4,
"displayConfig": {
"sort": "freq,desc;alpha,asc"
},
"sourcePropertyNames": ["camera.Color of product"],
"isAutogen": true,
"isRecordSearchEnabled": true,
"ecr:type": "dimension",
"mergeAction" : "update"
}
}