v1/enumerations:batch-update
Updates a list of enumerations (maximum amount per request is 50) with the given properties, including content.
The edits you make to an enumeration will automatically increment the version number, based on semantic versioning.
Patch edits (e.g. 1.0.0 -> 1.0.1) include changing the order in which values are listed or changing the enumeration name recorded in the schema title.
Minor edits (e.g. 1.0.0 -> 1.1.0) include adding a new value to the enumeration.
Major edits (e.g. 1.0.0 -> 2.0.0) include removing a value from the enumeration, renaming the symbolic identifier for a value, or changing the numeric value associated with a certain symbol.
Resource Information
| Method and URI | PATCH https://developer.api.autodesk.com/parameters/v1/enumerations:batch-update |
| Authentication Context | user context required |
| Required OAuth Scopes | data:write or data:create |
| Data Format | JSON |
Note: Data will be updated according to the JSON Merge Patch protocol.
Request
Headers
| Authorization* string | Must be Bearer <token>, where <token> is obtained via a three-legged OAuth flow. |
| Content-Type* string | Must be application/json |
| Region string | The region the hub’s data is provisioned in.
Currently supports US, EMEA, AUS, IND, DEU, JPN, CAN, and GBR. Default is US. |
Request
Query String Parameters
| accountId* string: UUID or string: b.UUID | The Autodesk Forma hub ID. |
Request
Body Structure
Object
| enumerations* array: object | The list of enumerations to update. |
| id string | The enumeration ID. Must be full type id. |
| name* string | The enumeration name. |
| content* object | The enumeration content. Must be non empty map with keys of type string and values of type number. |
Response
HTTP Status Code Summary
| 200 OK | Successfully updated the given enumerations. |
| 207 Partial Success | Successfully updated some enumerations, with errors for some enumerations in the batch. |
| 400 Bad Request | The request could not be understood by the server due to malformed syntax. This may occur when enumerations validation fails, such as when the enumerations name is too long or contains prohibited symbols. The response should include what validation rule was violated. |
| 401 Unauthorized | Request has not been applied because it lacks valid authentication credentials for the target resource. |
| 403 Forbidden | The server understood the request but refuses to authorize it. |
| 404 Not Found | The resource cannot be found. |
| 406 Not Acceptable | The server cannot produce a response matching the list of acceptable values defined in the request. |
| 410 Gone | Access to the target resource is no longer available. |
| 429 Too Many Requests | User has sent too many requests in a given amount of time. |
| 500 Internal Server Error | An unexpected error occurred on the server. |
| 503 Service Unavailable | Server is not ready to handle the request. |
Response
Successfully Updated Enumerations (200)
Body Structure (200)
| results array: object | |
| id string | The enumeration ID with new version number. |
| previousRevisionId string | The previous ID of the enumeration before it was updated. |
| name string | The enumeration name. |
| content array: object | The enumeration content. A map with keys of type string and values of type number. |
| createdBy string | User that created the enumeration. |
| createdAt string | A Time ISO 8601 Timestamp in UTC Timezone indicating when the enumeration was created. |
Partial Success Updating Enumerations (207)
Body Structure (207)
| results array: object | |
| id string | The enumeration ID with new version number. |
| previousRevisionId string | The previous ID of the enumeration before it was updated. |
| name string | The enumeration name. |
| content array: object | The enumeration content. Must be non empty map with keys of type string and values of type number. |
| createdBy string | User that created the enumeration. |
| createdAt string | A Time ISO 8601 Timestamp in UTC Timezone indicating when the enumeration was created. |
| errors array: object | |
| id string | The resource ID. |
| title string | The error title. |
| detail string | The error detail. |
| code string | The error code. |
Example
Successfully Updated Enumerations (200).
Request
curl -v 'https://developer.api.autodesk.com/parameters/v1/enumerations:batch-update?accountId=b3aef626-f535-4c7a-a032-c1048416f5ea' \
-X 'PATCH' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"enumerations": [
{
"name": "Stoplight Color",
"id": "parameters.b3aef626f5354c7aa032c1048416f5ea:a644eb8695914628a259fd5a3b37f622-2.0.0",
"content": [
{
"id": "Red",
"value": 0
},
{
"id": "Yellow",
"value": 1
},
{
"id": "Green",
"value": 2
},
{
"id": "Turn Arrow",
"value": 3
}
]
},
{
"name": "Installation Complete",
"id": "parameters.d05ec054ef8046ad9c80fc742f29027c:b3aef626f5354c7aa032c1048416f5ea-1.0.0",
"content": [
{
"id": "Yes",
"value": 21
},
{
"id": "No",
"value": 22
},
{
"id": "Back-ordered",
"value": 23
}
]
}
]
}'
Response
{
"results": [
{
"name": "Stoplight Color",
"id": "parameters.b3aef626f5354c7aa032c1048416f5ea:a644eb8695914628a259fd5a3b37f622-2.0.1",
"previousRevisionId": "parameters.b3aef626f5354c7aa032c1048416f5ea:a644eb8695914628a259fd5a3b37f622-2.0.0",
"content": [
{
"id": "Red",
"value": 0
},
{
"id": "Yellow",
"value": 1
},
{
"id": "Green",
"value": 2
},
{
"id": "Turn Arrow",
"value": 3
}
],
"createdBy": "FXA2K4JGR5BECGSR",
"createdAt": "2024-11-19T19:31:46+0000"
},
{
"name": "Installation Complete",
"id": "parameters.d05ec054ef8046ad9c80fc742f29027c:b3aef626f5354c7aa032c1048416f5ea-1.0.1",
"previousRevisionId": "parameters.d05ec054ef8046ad9c80fc742f29027c:b3aef626f5354c7aa032c1048416f5ea-1.0.0",
"content": [
{
"id": "Yes",
"value": 21
},
{
"id": "No",
"value": 22
},
{
"id": "Back-ordered",
"value": 23
}
],
"createdBy": "DWFAK4JGR5BECGSR",
"createdAt": "2024-12-19T19:31:46+0000"
}
]
}
Partial Success Updating Enumerations (207).
Request
curl -v 'https://developer.api.autodesk.com/parameters/v1/enumerations:batch-update?accountId=b3aef626-f535-4c7a-a032-c1048416f5ea' \
-X 'PATCH' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"enumerations": [
{
"name": "Stoplight Color",
"id": "parameters.b3aef626f5354c7aa032c1048416f5ea:a644eb8695914628a259fd5a3b37f622-2.0.0",
"content": [
{
"id": "Red",
"value": 0
},
{
"id": "Yellow",
"value": 1
},
{
"id": "Green",
"value": 2
},
{
"id": "Turn Arrow",
"value": 3
}
]
},
{
"name": "Installation Complete",
"id": "parameters.d05ec054ef8046ad9c80fc742f29027c:b3aef626f5354c7aa032c1048416f5ea-1.0.0",
"content": [
{
"id": "Yes",
"value": 21
},
{
"id": "No",
"value": 22
},
{
"id": "Back-ordered",
"value": -2
}
]
}
]
}'
Response
{
"results": [
{
"id": "parameters.b3aef626f5354c7aa032c1048416f5ea:a644eb8695914628a259fd5a3b37f622-2.0.1",
"previousRevisionId": "parameters.b3aef626f5354c7aa032c1048416f5ea:a644eb8695914628a259fd5a3b37f622-2.0.0",
"version": "2.0.1",
"type": "enumeration",
"description": "Enumeration of stoplight colors.",
"isDeprecated": false,
"isRequired": true,
"name": "Stoplight Color",
"content": [
{
"id": "Red",
"value": 0
},
{
"id": "Yellow",
"value": 1
},
{
"id": "Green",
"value": 2
},
{
"id": "Turn Arrow",
"value": 3
}
],
"createdBy": "FXA2K4JGR5BECGSR",
"createdAt": "2024-11-19T19:31:46+0000"
}
],
"errors": [
{
"id": "parameters.b3aef626f5354c7aa032c1048416f5ea:95d502d557524f45a1bdad92f8b73fcf-1.0.0",
"title": "Bad request",
"detail": "The enumeration content value is invalid, it must be a positive integer number"
}
]
}