Replies
Overview
Section titled “Overview”The Replies API allows querying replies associated with specific contracts and parent IDs, as well as retrieving summaries of reply counts and user participation.
Endpoints
Section titled “Endpoints”Get Reply Summaries
Section titled “Get Reply Summaries”POST /api/v1/reply/summaryDescription: Retrieves a summary of replies for specific target contracts and parent IDs, including the total count and whether the current user has participated in the discussion.
Authentication Required: No
Parameters
Section titled “Parameters”Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
targetContract |
string | Yes | Ethereum address of the target contract |
parentIds |
array | Yes | Array of parent IDs to fetch reply summaries for |
currentUserProfileId |
integer or null | No | Profile ID of the current user to check for participation |
Responses
Section titled “Responses”Success Response
Section titled “Success Response”Code: 200 OK
{ "ok": true, "data": { "0x2820b3aB3543ADB80810f11F2651f0DD9A04E801": { "1": { "count": 0, "participated": false } } }}| Property | Type | Description |
|---|---|---|
ok |
boolean | Success status |
data |
object | Map of target contracts to parent IDs to reply summaries |
data[targetContract] |
object | Map of parent IDs to reply summaries for a specific target contract |
data[targetContract][parentId] |
object | Reply summary for a specific parent ID |
data[targetContract][parentId].count |
integer | Total number of replies |
data[targetContract][parentId].participated |
boolean | Whether the current user has participated in the discussion |
Error Response
Section titled “Error Response”Code: 400 Bad Request
{ "ok": false, "error": { "code": "VALIDATION_ERROR", "message": "Validation error", "fields": [ { "code": "invalid_type", "expected": "number", "message": "Expected number, received nan", "path": ["currentUserProfileId"], "received": "nan" } ] }}Example
Section titled “Example”Request
Section titled “Request”http POST "https://api.ethos.network/api/v1/reply/summary" \ targetContract=0x2820b3aB3543ADB80810f11F2651f0DD9A04E801 \ parentIds:='[1]' \ currentUserProfileId:=null- The reply summary endpoint provides an efficient way to get the total number of replies and participation status without fetching all the individual replies.
- The structure of the response allows querying multiple target contracts and parent IDs in a single request.
- When
currentUserProfileIdisnull, theparticipatedfield will always befalse.