All Smithereen actors have sm:collectionSimpleQuery endpoint under endpoints. This is useful for when, for example, you've received a wall post, but you don't know whether the owner of the wall accepted that post. It supports these collections:
sm:wallsm:wallCommentssm:friends(for user actors)sm:groups(for user actors)sm:members(for group actors)sm:tentativeMembers(for event actors)- Photo albums owned by groups
sm:commentsin photo albums
The collection query endpoint accepts POST requests with form-data fields: collection for the collection ID (like https://friends.grishka.me/users/1/wall) and one or more item with the object IDs that you wish to test for presence in the collection. The result is a sm:CollectionQueryResult (which extends CollectionPage) containing only the object IDs that are actually present in the collection.
Request and response example
POST /users/1/collectionQuery HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Host: smithereen.local:8080
Connection: close
User-Agent: Paw/3.3.6 (Macintosh; OS X/12.5.0) GCDHTTPRequest
Content-Length: 177
collection=http%3A%2F%2Fsmithereen.local%3A8080%2Fusers%2F1%2Ffriends&item=http%3A%2F%2Fsmithereen.local%3A8080%2Fusers%2F2&item=https%3A%2F%2Ffriends.grishka.me%2Fposts%2F85372
{
"type": "CollectionQueryResult",
"items": [
"http://smithereen.local:8080/users/2"
],
"partOf": "http://smithereen.local:8080/users/1/friends",
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"sm": "http://smithereen.software/ns#",
"CollectionQueryResult": "sm:CollectionQueryResult"
}
]
}