flags/{flagId}/state-history
Retrieve a list containing the history of the risk flag states for a specific flag sorted by most recent events first.
Resource Information
| Method and URI | GET https://developer.api.autodesk.com/construction/tradetapp/v2/flags/{flagId}/state-history |
| Authentication Context | User context required |
| Required OAuth Scopes | data:read |
| Data Format | JSON |
Request
Headers
| Authorization* string | Must be Bearer <token>, where <token> is a three-legged access token obtained via an Authorization Code flow. |
| general-contractor-company-id string | This header is required only for users who belong to a parent enterprise company in TradeTapp.
It specifies the BuildingConnected company ID of the child general contractor company for which the request should be performed.
Otherwise, it is impossible to know for which child general contractor company the user intends to perform the request.
For users who do not belong to a parent enterprise company, this header is not required and should be omitted. If provided for such users, the provided value must match the user’s current general contractor company, otherwise the request will be rejected with a 400 Bad Request error. |
Request
URI Parameters
| flagId int | The unique identifier of the flag. |
Request
Query String Parameters
| cursorState string | An opaque cursor token that identifies where the next page of paginated results should start. It is returned in each paginated response so that it can be provided in the next request to continue paginated results. If a paginated response contains no cursorState value, there are no further pages to return.
Omit this parameter to initiate a paginated request or to restart pagination. |
| limit int | The maximum number of records that the endpoint may return per page.
Note that a returned page may contain fewer records than the limit under either of these conditions:
Default value: |
Response
HTTP Status Code Summary
| 200 OK | OK |
| 400 Bad Request | The parameters of the requested operation are invalid. |
| 401 Unauthorized | The provided bearer token is not valid. |
| 403 Forbidden | The user or service represented by the bearer token does not have permission to perform this operation. |
| 404 Not Found | The requested resource could not be found. |
| 429 Too Many Requests | Rate limit exceeded; wait some time before retrying. The ‘Retry-After’ header might provide the amount of the time to wait. |
| 500 Internal Server Error | An unknown error occurred on the server. |
Response
Body Structure (200)
| results array: object | The list of state changes for the flag. States are returned in chronological order, with the most recent state first. |
| createdAt datetime: ISO 8601 | The date and time when the flag state was created, in ISO 8601 format (YYYY-MM-DDThh:mm:ss.SSSZ). |
| updatedAt datetime: ISO 8601 | The date and time when the flag state was last updated, in ISO 8601 format (YYYY-MM-DDThh:mm:ss.SSSZ). |
| value enum:string | The state of the flag.
Possible values: ACTIVE, RESOLVED |
| summary string | A summary that describes the flag state. |
| createdBy object | The user who created this flag state. |
| id string | Autodesk ID of the user. Returns null if the user has not yet linked their Autodesk account. |
| email string | Email of the user. |
| firstName string | The first name of the user. |
| lastName string | The last name of the user. |
| pagination object | The pagination details for the top-level list of results in the response. |
| limit int | The maximum number of records per page.
Default: A page may contain fewer records than the limit if fewer records exist or if the last page is returned. |
| cursorState string | An opaque token for cursor-based pagination.
Use the value returned in a response to request the next page of results. Omit this parameter to start a new paginated request or restart pagination. If a response contains no |
| totalResults int | The total number of records matching the query across all pages. |
| nextUrl string | The link to the next page of data. If not included, the current page is the last page of results. A page may be empty but still contain a nextUrl. Stop paging only when nextUrl is no longer returned. |
| previousUrl string | The link to the previous page of data. If not included, the current page is the first page of results. |
Example
OK
Request
curl -v 'https://developer.api.autodesk.com/construction/tradetapp/v2/flags/1234/state-history' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a'
Response
{
"results": [
{
"createdAt": "2017-05-04T14:11:35.100929Z",
"updatedAt": "2017-05-04T14:11:35.100929Z",
"value": "ACTIVE",
"summary": "This flag was re-opened due to safety concerns arising once more.",
"createdBy": {
"id": "ABCDEF3XYZABCD1M",
"email": "user@example.com",
"firstName": "Jane",
"lastName": "Doe"
}
}
],
"pagination": {
"limit": 10,
"cursorState": "cD0xMTA4Ng==",
"totalResults": 120,
"nextUrl": "",
"previousUrl": ""
}
}