Lists units.
GET
v1/units
Lists units defined in the system. For more information about the definition of units in the Parameters API, please refer to the Field Guide. For this endpoint, The User (Authorization token) does not need access to a given ACC account.
Resource Information
Method and URI | GET https://developer.api.autodesk.com/parameters/v1/units |
Authentication Context | user context required |
Required OAuth Scopes | data:read |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token>, where <token> is obtained via a three-legged OAuth flow. |
Region string | The region the account’s data is provisioned in. Currently supports US and EMEA . Default is US . |
* Required
Request
Query String Parameters
offset int | Offset from the start of the collection to the first entry in the page. Zero based. |
limit int | Determines the maximum number of objects that MAY be returned. A query MAY return fewer than the value of limit due to filtering or other reasons. |
ids string | The unit IDs split by comma. With this query parameter, you can get the specified units in an array. |
Response
HTTP Status Code Summary
200 OK | Successful retrieval of the units defined in the system. |
400 Bad Request | The request could not be understood by the server due to malformed syntax. |
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 | 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
Body Structure (200)
Expand all
pagination object | The information for paginating records returned by the endpoint. |
offset int | Offset from the start of the collection to the first entry in the page. Zero based. |
limit int | Determines the maximum number of objects that MAY be returned. A query MAY return fewer than the value of limit due to filtering or other reasons. |
totalResults int | The total number of results that match the query irrespective of limit. |
nextUrl string | Link that will return the next page of data. If not included, this is the last page of data. |
results array: object | |
id string | The unit ID. |
name string | The unit name. |
symbolIds array: string | The identifiers of symbols that indicate this unit in a written measurement, such as the “m” indicating “meters” in a written measurement such as “5m”. A unit of measurement may have zero, one, or many symbols available. Symbols may be used when rendering parameters. |
Example
Successful retrieval of the units (200).
Request
curl -v 'https://developer.api.autodesk.com/parameters/v1/units'
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
Response
{
"pagination": {
"totalResults": 311,
"offset": 0,
"limit": 50,
"nextUrl": "https://developer.api.autodesk.com/parameters/v1/units?offset=50&limit=50"
},
"results": [
{
"id": "autodesk.unit.unit:1ToRatio-1.0.1",
"name": "1 : Ratio",
"symbolIds": [
"autodesk.unit.symbol:1Colon-1.0.1"
]
},
{
"id": "autodesk.unit.unit:acres-1.0.1",
"name": "Acres",
"symbolIds": [
"autodesk.unit.symbol:acres-1.0.1"
]
},
{
"id": "autodesk.unit.unit:amperes-1.0.0",
"name": "Amperes",
"symbolIds": [
"autodesk.unit.symbol:ampere-1.0.0"
]
}
]
}
Show More