Bulk attributes by name
POST/attributes/bulk/name
Before setting an attribute value for a specific resource, the attribute definition needs to be created. Usually, multiple attributes need to be created or updated at the same time which is useful to eliminate a lot of API requests. This endpoint is used for bulk processing of attribute definitions based on the name.
The name
field is required and if an attribute with the provided name
and class
is not found it will be created, otherwise the attribute definition will be updated. When updating, although part of the request body, the fields name
, class
and type
are ignored.
Request
- application/json
Body
array
Array [
Array [
]
Array [
]
- MOD1
- MOD2
- MOD3
]
descriptions
object[]
units
object[]
value
object
anyOf
number
string
string
Responses
- 200
- 400
Bulk attributes by name - 200
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Bulk attributes by name - 200
Schema
Array [
]
data
object[]
{
"data": [
{
"action": "update",
"id": 661,
"key": "WEIGHT",
"lookupKey": "name",
"message": "Attribute updated. Fields 'name', 'type' and 'class' are not updated.",
"success": true
},
{
"action": "create",
"id": 671,
"key": "MATERIAAL_FRAME",
"lookupKey": "name",
"message": "Attribute created.",
"success": true
},
{
"action": "update",
"id": 668,
"key": "COLOR",
"lookupKey": "name",
"message": "Attribute updated. Fields 'name', 'type' and 'class' are not updated.",
"success": true
}
],
"messages": [
"Completed"
],
"total": 3
}
{
"data": [
{
"action": "update",
"id": 661,
"key": "WEIGHT",
"lookupKey": "name",
"message": "Attribute updated. Fields 'name', 'type' and 'class' are not updated.",
"success": true
},
{
"action": "create",
"id": 671,
"key": "MATERIAAL_FRAME",
"lookupKey": "name",
"message": "Attribute created.",
"success": true
},
{
"action": "update",
"id": 668,
"key": "COLOR",
"lookupKey": "name",
"message": "Attribute updated. Fields 'name', 'type' and 'class' are not updated.",
"success": true
}
],
"messages": [
"Completed"
],
"total": 3
}
Bulk attributes by name - 400 (invalid date)
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Bulk attributes by name - 400 (invalid date)
Schema
error
object
{
"error": {
"code": 10007,
"messages": [
"#/1/type: date is not a valid enum value",
"#/1/value: string [2022-12-013] does not match pattern [12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
"#/1/type: date is not a valid enum value",
"#/1/value: expected type: JSONArray, found: String",
"#/1/type: date is not a valid enum value",
"#/1/value: expected type: Integer, found: String",
"#/1/type: date is not a valid enum value",
"#/1/value: expected type: Number, found: String",
"#/1/type: date is not a valid enum value",
"#/1/value: string [2022-12-013] does not match pattern ([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])T(0[1-9]|1[\\d]|2[0-3]):(0[\\d]|[1-5][\\d]):(0[\\d]|[1-5][\\d]))$"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}
{
"error": {
"code": 10007,
"messages": [
"#/1/type: date is not a valid enum value",
"#/1/value: string [2022-12-013] does not match pattern [12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
"#/1/type: date is not a valid enum value",
"#/1/value: expected type: JSONArray, found: String",
"#/1/type: date is not a valid enum value",
"#/1/value: expected type: Integer, found: String",
"#/1/type: date is not a valid enum value",
"#/1/value: expected type: Number, found: String",
"#/1/type: date is not a valid enum value",
"#/1/value: string [2022-12-013] does not match pattern ([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])T(0[1-9]|1[\\d]|2[0-3]):(0[\\d]|[1-5][\\d]):(0[\\d]|[1-5][\\d]))$"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}