Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Implement Endpoint to Retrieve Post Details #11

@enddynayn

Description

@enddynayn

Description
We need to implement a new GET endpoint to allow retrieval of detailed information about a specific post using its unique identifier and content hash

Acceptance Criteria:

  • Add GET /v1/content/{dsnpId}/{contentHash}
  • Ensure dsnpId and contentHash is required.
  • Ensure authentication is required.
  • Update the OpenAPI swagger documentation.

Tech Specs

Endpoint: GET /v1/content/{dsnpId}/{contentHash}
Security Requirement: tokenAuth
Parameters:

  • dsnpId(string, required): The unique identifier of the post.
  • contentHash (string, required): The hash of the post content.

Responses:

  • 200 OK: Returns post details matching the BroadcastExtended schema.
  • 401 Unauthorized: Access attempt without valid authentication.
  • 404 Not Found: No content found matching the provided identifiers.

Open API Snippet

{
  "/v1/content/{dsnpId}/{contentHash}": {
    "get": {
      "operationId": "getContent",
      "summary": "Get details of a specific post",
      "security": [
        {
          "tokenAuth": []
        }
      ],
      "parameters": [
        {
          "name": "dsnpId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "contentHash",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "responses": {
        "200": {
          "description": "Successful response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BroadcastExtended"
              }
            }
          }
        },
        "401": {
          "$ref": "#/components/responses/UnauthorizedError"
        },
        "404": {
          "description": "Content not found"
        }
      }
    }
  }
}
{
  "components": {
    "schemas": {
      "BroadcastExtended": {
        "type": "object",
        "properties": {
          "fromId": {
            "type": "string"
          },
          "contentHash": {
            "type": "string"
          },
          "content": {
            "description": "JSON-encoded Activity Content Note",
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "description": "Timestamp of the post"
          },
          "replies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReplyExtended"
            },
            "description": "Array of ReplyExtended objects"
          }
        },
        "required": [
          "fromId",
          "contentHash",
          "content",
          "timestamp"
        ]
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions