Bulk attributes by Id
POST/attributes/bulk/id
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 an Id.
The id
field is required and when it is 0 a new attribute 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
- MOD4
Array [
]
]
descriptions
object[]
units
object[]
value
object
anyOf
number
string
string
Responses
- 200
- 400
Bulk attributes by Id - 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 Id - 200
Schema
Array [
]
data
object[]
{
"data": [
{
"action": "update",
"error": "Invalid value provided. Attribute type is [text].",
"key": 644,
"lookupKey": "id",
"success": false
},
{
"action": "create",
"id": 670,
"key": 0,
"lookupKey": "id",
"message": "Attribute created.",
"success": true
},
{
"action": "update",
"id": 668,
"key": 668,
"lookupKey": "id",
"message": "Attribute updated. Fields 'name', 'type' and 'class' are not updated.",
"success": true
},
{
"action": "update",
"error": "Attribute with id [800] not found.",
"key": 800,
"lookupKey": "id",
"success": false
}
],
"messages": [
"Completed"
],
"total": 4
}
{
"data": [
{
"action": "update",
"error": "Invalid value provided. Attribute type is [text].",
"key": 644,
"lookupKey": "id",
"success": false
},
{
"action": "create",
"id": 670,
"key": 0,
"lookupKey": "id",
"message": "Attribute created.",
"success": true
},
{
"action": "update",
"id": 668,
"key": 668,
"lookupKey": "id",
"message": "Attribute updated. Fields 'name', 'type' and 'class' are not updated.",
"success": true
},
{
"action": "update",
"error": "Attribute with id [800] not found.",
"key": 800,
"lookupKey": "id",
"success": false
}
],
"messages": [
"Completed"
],
"total": 4
}
Bulk attributes by Id - 400 (missing name)
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 Id - 400 (missing name)
Schema
error
object
{
"error": {
"code": 10007,
"messages": [
"#/0: required key [name] not found",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: JSONArray, found: Integer",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: String, found: Integer",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: String, found: Integer",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: String, found: Integer"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}
{
"error": {
"code": 10007,
"messages": [
"#/0: required key [name] not found",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: JSONArray, found: Integer",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: String, found: Integer",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: String, found: Integer",
"#/0: required key [name] not found",
"#/0/type: decimal is not a valid enum value",
"#/0/value: expected type: String, found: Integer"
],
"moreInfo": "https://www.propel.us/docs/errors/10007",
"status": 400,
"type": "SchemaValidationException"
}
}