Retrieves the text and metadata for all comments that have been posted to the given form data instance. If the Prefer header was specified with the value "return=representation", the response will include the email address of each comment author, though this may incur additional processing time. If there is an extraordinarily large number of comments, only 50 distinct user email addresses will be retrieved and shown. Regardless of the Prefer header value, the "_links" object associated with each comment will provide a link to additional information about the comment author.
Permissions
To use this endpoint, the user is required to have the Forms View (Forms_ViewAccess
) permission for the iTwin, or for the form's definition if form definition security is specified. (Having any other Forms permission automatically grants the View permission as well.)
Authentication
Requires Authorization
header with valid Bearer token for scope itwin-platform
.
For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.
Request parameters
The ID of the form data instance for which to get comments
Request headers
Sets the level of detail to return. For this endpoint, setting 'return=representation' will add the comment authors' email addresses to the response.
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v1+json
is recommended.
Response 200 OK
OK
{ "comments": [{ "id": "VcVcVcC8sUuVcgeXz1Ih_aqgKUQJ4YZCg5ED6ED6ED6", "text": "Second comment", "authorDisplayName": "Joe User", "createdDateTime": "2020-10-20T16:08:30.2960969Z", "_links": { "author": { "href": "https://api.bentley.com/projects/30273027-1111-2222-3333/members/9e399e39-0000-1111-2222-8d8a8d8a8d8a" } } }, { "id": "VcVcVcC8sUuVcgeXz1Ih_dQVJUOk7VpMmONsENsENsE", "text": "First comment", "authorDisplayName": "Joe User", "createdDateTime": "2020-10-20T16:08:30.3117243Z", "_links": { "author": { "href": "https://api.bentley.com/projects/30273027-1111-2222-3333/members/9e399e39-0000-1111-2222-8d8a8d8a8d8a" } } } ] }
Response 401 Unauthorized
This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.
{ "error": { "code": "HeaderNotFound", "message": "Header Authorization was not found in the request. Access denied." } }
Response 404 Not Found
This response indicates that the specified form data instance does not exist or is inaccessible to the user.
{ "error": { "code": "FormDataNotFound", "message": "Requested form data is not available.", "target": "id" } }
Response 429 Too many requests
This response indicates that the user has sent too many requests in a given amount of time.
{ "error": { "code": "TooManyRequests", "message": "More requests were received than the subscription rate-limit allows." } }
Response headers
The number of requests exceeds the rate-limit for the client subscription.
Comments List (Prefer return=minimal)
{ "type": "object", "title": "Comments List (Prefer return=minimal)", "properties": { "comments": { "type": "array", "items": { "$ref": "#/components/schemas/comment-get-minimal" } } }, "additionalProperties": false }
Comment (get, Prefer return=minimal)
String that uniquely identifies this comment.
The contents of the comment.
Display name (i.e., given name and surname) of the user who posted this comment. (If the comment was posted using this API, it is inferred to be the authorized user making the request.)
Date and time the comment was posted.
Will only be set if the comment is a workflow transition note. This is the name of the status the form was in before the transition.
Will only be set if the comment is a workflow transition note. This is the name of the status the form is in after the transition.
A URL that can be used to retrieve more information about the comment author.
{ "type": "object", "title": "Comment (get, Prefer return=minimal)", "properties": { "id": { "type": "string", "description": "String that uniquely identifies this comment." }, "text": { "type": "string", "description": "The contents of the comment." }, "authorDisplayName": { "type": "string", "description": "Display name (i.e., given name and surname) of the user who posted this comment. (If the comment was posted using this API, it is inferred to be the authorized user making the request.)" }, "createdDateTime": { "type": "string", "format": "date-time", "description": "Date and time the comment was posted." }, "workflowNoteFrom": { "type": "string", "nullable": true, "description": "Will only be set if the comment is a workflow transition note. This is the name of the status the form was in before the transition." }, "workflowNoteTo": { "type": "string", "nullable": true, "description": "Will only be set if the comment is a workflow transition note. This is the name of the status the form is in after the transition." }, "_links": { "type": "object", "nullable": true, "properties": { "author": { "type": "object", "properties": { "href": { "type": "string", "description": "A URL that can be used to retrieve more information about the comment author." } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": false }
Comments List (Prefer return=representation)
{ "type": "object", "title": "Comments List (Prefer return=representation)", "properties": { "comments": { "type": "array", "items": { "$ref": "#/components/schemas/comment-get-representation" } } }, "additionalProperties": false }
Comment (get, Prefer return=representation)
String that uniquely identifies this comment.
The contents of the comment.
Display name (i.e., given name and surname) of the user who posted this comment. (If the comment was posted using this API, it is inferred to be the authorized user making the request.)
Email address of the user who wrote this comment.
Date and time the comment was posted.
Will only be set if the comment is a workflow transition note. This is the name of the status the form was in before the transition.
Will only be set if the comment is a workflow transition note. This is the name of the status the form is in after the transition.
A URL that can be used to retrieve more information about the comment author.
{ "type": "object", "title": "Comment (get, Prefer return=representation)", "properties": { "id": { "type": "string", "description": "String that uniquely identifies this comment." }, "text": { "type": "string", "description": "The contents of the comment." }, "authorDisplayName": { "type": "string", "description": "Display name (i.e., given name and surname) of the user who posted this comment. (If the comment was posted using this API, it is inferred to be the authorized user making the request.)" }, "authorEmail": { "type": "string", "description": "Email address of the user who wrote this comment." }, "createdDateTime": { "type": "string", "format": "date-time", "description": "Date and time the comment was posted." }, "workflowNoteFrom": { "type": "string", "nullable": true, "description": "Will only be set if the comment is a workflow transition note. This is the name of the status the form was in before the transition." }, "workflowNoteTo": { "type": "string", "nullable": true, "description": "Will only be set if the comment is a workflow transition note. This is the name of the status the form is in after the transition." }, "_links": { "type": "object", "properties": { "author": { "type": "object", "properties": { "href": { "type": "string", "description": "A URL that can be used to retrieve more information about the comment author." } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true } }, "required": [ "code", "message" ], "additionalProperties": true }
Error Response
Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.
{ "type": "object", "title": "Error Response", "description": "Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.", "properties": { "error": { "description": "Error information.", "$ref": "#/components/schemas/Error" } }, "required": [ "error" ], "additionalProperties": false }
Was this page helpful?