flags/{flagId}
Retrieve data for a specific flag.
Resource Information
| Method and URI | GET https://developer.api.autodesk.com/construction/tradetapp/v2/flags/{flagId} |
| 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
| include string | A sub-resource to include in the response. Currently only stateHistory is supported. If include=stateHistory is provided, the response includes a history of the flag states. If not included, the state history is omitted. |
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. |
| 409 Conflict | Multiple objects were found when only one was expected. |
| 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)
| stateHistory all of | |
| Flag state history object | |
| 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 all of | |
| User object | A TradeTapp user. |
| 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. |
| 1 | The user who created this flag state. |
| 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. |
| 1 object | |
| id int | The internal unique ID of a flag. This is a unique identifier for the company’s flag data object. |
| company object | A subcontractor company. |
| id string | Subcontractor’s BC company ID. This is a unique identifier for the company in BuildingConnected. |
| uniqueId string | The internal unique ID that is set by the GC for the subcontractor. This may be populated from an external system via a subcontractor backlog upload or other. |
| name string | Name of the subcontractor company. |
| taxId string | The Tax ID of the subcontractor company with which this resource is associated. If the provided the tax ID contains hyphens, the hyphens will be removed before searching for the company associated with this tax ID since tax IDs are stored without hypens in the database. |
| taxType enum:string | The Tax ID type of the subcontractor company. Use this field in conjunction with the taxId to uniquely identify the subcontractor company.
Possible values: US_FEIN, US_SSN, CAN_BN, OTHER |
| name string | Name of the flag.
Max length: 100 |
| type enum:string | The type of the flag.
Possible values: GENERAL, INSURANCE, SAFETY, FINANCIAL, PROJECT, COMMUNICATION, OTHER |
| priority enum:string | The priority of the flag.
Possible values: HIGH, MEDIUM, LOW |
| eventDate string | The date of the event for which this flag was created in ISO-8601 full-date format (YYYY-MM-DD). |
| summary string | The summary note for this flag.
Max length: 500 |
| triggerAlert boolean | Indicates whether this flag should display an alert when opening the invite associated with this flag in the TradeTapp app. |
| isVisibleInPlatform boolean | Indicates whether this flag is visible to TradeTapp users only, or to users who belong to the associated company in BuildingConnected but do not have a TradeTapp account.
|
| flagProposalId int | Not currently supported. |
| updatedAt datetime: ISO 8601 | The date / time that the flag was last updated. ISO-8601 date-time format (YYYY-MM-DDTHH:mm:ss.sssZ). |
| createdAt datetime: ISO 8601 | The date / time that the flag was originally created. ISO-8601 date-time format (YYYY-MM-DDTHH:mm:ss.sssZ). |
| createdBy object | A TradeTapp user. |
| 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. |
| state object | The current state of the flag. |
| 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. |
Example
OK
Request
curl -v 'https://developer.api.autodesk.com/construction/tradetapp/v2/flags/1234?include=stateHistory' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a'
Response
{
"stateHistory": {
"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": ""
}
},
"id": 1234,
"company": {
"id": "59d2b8660675250927442cbf",
"uniqueId": "98h2fbd84k9s322chr",
"name": "Gr8 Builders",
"taxId": 321654876,
"taxType": "US_FEIN"
},
"name": "Safety Concern",
"type": "GENERAL",
"priority": "HIGH",
"eventDate": "2017-05-21",
"summary": "This application has a high safety concern due to a high number of injuries.",
"triggerAlert": true,
"isVisibleInPlatform": false,
"flagProposalId": 1234,
"updatedAt": "2017-05-04T14:11:35.100929Z",
"createdAt": "2017-05-04T14:11:35.100929Z",
"createdBy": {
"id": "ABCDEF3XYZABCD1M",
"email": "user@example.com",
"firstName": "Jane",
"lastName": "Doe"
},
"state": {
"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"
}
}
}