GetCommentReactions
Returns information about reactions to a specified comment ID. Reactions from users who have been deleted will not be included in the count.
Request Syntax
{
"commentId": "string
",
"maxResults": number
,
"nextToken": "string
",
"reactionUserArn": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- commentId
-
The ID of the comment for which you want to get reactions information.
Type: String
Required: Yes
- maxResults
-
A non-zero, non-negative integer used to limit the number of returned results. The default is the same as the allowed maximum, 1,000.
Type: Integer
Required: No
- nextToken
-
An enumeration token that, when provided in a request, returns the next batch of the results.
Type: String
Required: No
- reactionUserArn
-
Optional. The Amazon Resource Name (ARN) of the user or identity for which you want to get reaction information.
Type: String
Required: No
Response Syntax
{
"nextToken": "string",
"reactionsForComment": [
{
"reaction": {
"emoji": "string",
"shortCode": "string",
"unicode": "string"
},
"reactionsFromDeletedUsersCount": number,
"reactionUsers": [ "string" ]
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- nextToken
-
An enumeration token that can be used in a request to return the next batch of the results.
Type: String
- reactionsForComment
-
An array of reactions to the specified comment.
Type: Array of ReactionForComment objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- CommentDeletedException
-
This comment has already been deleted. You cannot edit or delete a deleted comment.
HTTP Status Code: 400
- CommentDoesNotExistException
-
No comment exists with the provided ID. Verify that you have used the correct ID, and then try again.
HTTP Status Code: 400
- CommentIdRequiredException
-
The comment ID is missing or null. A comment ID is required.
HTTP Status Code: 400
- InvalidCommentIdException
-
The comment ID is not in a valid format. Make sure that you have provided the full comment ID.
HTTP Status Code: 400
- InvalidContinuationTokenException
-
The specified continuation token is not valid.
HTTP Status Code: 400
- InvalidMaxResultsException
-
The specified number of maximum results is not valid.
HTTP Status Code: 400
- InvalidReactionUserArnException
-
The Amazon Resource Name (ARN) of the user or identity is not valid.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of GetCommentReactions.
Sample Request
POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 124
X-Amz-Target: CodeCommit_20150413.GetCommentReactions
X-Amz-Date: 20200406T223055Z
User-Agent: aws-cli/1.18.36 Python/3.6.10 Linux/4.9.184-0.1.ac.235.83.329.metal1.x86_64 botocore/1.15.36
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAEXAMPLE/20180914/us-east-1/codecommit/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature==8d9b5998EXAMPLE
{
"commentId": "ff30b348EXAMPLE1EXAMPLE"
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: d8ad1d21-EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 2267
Date: Mon, 6 Apr 2020 22:30:56 GMT
Connection: keep-alive
{
"reactionsForComment": {
[
{
"reaction": {
"emoji:"👍",
"shortCode": "thumbsup",
"unicode": "U+1F44D"
},
"users": [
"arn:aws:iam::123456789012:user/Li_Juan",
"arn:aws:iam::123456789012:user/Mary_Major",
"arn:aws:iam::123456789012:user/Jorge_Souza"
]
},
{
"reaction": {
"emoji": "👎",
"shortCode": "thumbsdown",
"unicode": "U+1F44E"
},
"users": [
"arn:aws:iam::123456789012:user/Nikhil_Jayashankar"
]
},
{
"reaction": {
"emoji": "😕",
"shortCode": "confused",
"unicode": "U+1F615"
},
"users": [
"arn:aws:iam::123456789012:user/Saanvi_Sarkar"
]
}
]
}
}
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: