copyright | link | is |
---|---|---|
Copyright IBM Corp. 2018 |
reacting-users |
published |
The reactingUsers query allows the API caller to get all reactors that reacted to a message with a specified reaction. The query accepts a Message ID (targetId) and a reaction as arguments, and optional paging information.
type QueryRoot {
...
reactingUsers(targetId: ID!, reaction: String!, before: String, after: String, first: Int, last: Int): ReactingUserCollection}
type ReactingUser {
reacted: Date
user: Person
}
type ReactingUserCollection {
totalCount: Int
pageInfo: PageInfo!
items: [ReactingUser]!
}
Method: POST
URL: https://api.watsonwork.ibm.com/graphql
Headers: 'Content-Type: application/graphql' , 'x-graphql-view: PUBLIC'
Body:
{
query {
reactingUsers(targetId: "5a9ee86ee4b0cb1ca3dfef33", reaction: ":-)") {
totalCount
items {
user {
email
displayName
id
}
reacted
}
pageInfo {
hasNextPage
hasPreviousPage
endCursor
startCursor
}
}
}
}
{
"data": {
"reactingUsers": {
"totalCount": 1,
"items": [
{
"user": {
"email": "[email protected]",
"displayName": "John Smith",
"id": "557657e7-29f9-4b31-8f08-dd385e230816"
},
"reacted": "2018-03-12T15:14:24.829+0000"
}
],
"pageInfo": {
"hasNextPage": false,
"hasPreviousPage": false,
"endCursor": "1521213264829",
"startCursor": "1521213264829"
}
}
}
}