API Documentation


1. Root Endpoint

Endpoint: /

Method: GET

Description: Renders the documentation page.


2. Get Unique Voters

Endpoint: /members/<space>

Method: GET

Description: Fetches unique voters for a given space. Optionally fetches on-chain members and delegates if onchain parameter is provided.

Parameters:

Response:

200 OK

Content-Type: application/json

Description: Returns the list of unique voters, and optionally on-chain members and delegates, with pagination cursors.

{
  "Members": {
    "@context": "http://daostar.org/schemas",
    "type": "DAO",
    "name": "Example DAO",
    "members": {
      "offchain": {
        "members": [
          {"id": "0x123...", "type": "EthereumAddress"},
          {"id": "0x456...", "type": "EthereumAddress"}
        ],
        "offchain_cursor_str": 123456789
      },
      "onchain": {
        "members": [
          {"id": "0xabc...", "role": "member", "type": "EthereumAddress"},
          {"id": "0xdef...", "role": "delegate", "type": "EthereumAddress"}
        ],
        "onchain_cursor_str": 987654321
      }
    }
  }
}

400 Bad Request

Content-Type: application/json

Description: Returns an error message if an invalid cursor is provided.

{
  "error": "Invalid offchain cursor format. Cursor must be an integer."
}

Parameter Combinations

  1. Basic Request (Fetch off-chain voters only)
  2. URL: /members/ens.eth

    Description: Fetches unique off-chain voters for the space "example-space".

  3. Request with Off-chain Pagination
  4. URL: /members/ens.eth?offchain_cursor=12345

    Description: Fetches unique off-chain voters with pagination, starting after cursor 12345.

  5. Request with On-chain Data
  6. URL: /members/ens.eth?onchain=example-slug

    Description: Fetches unique off-chain voters and on-chain members/delegates for the specified space and on-chain organization.

  7. Request with Both Off-chain and On-chain Pagination
  8. URL: /members/ens.eth?offchain_cursor=12345&onchain_cursor=67890&onchain=example-slug

    Description: Fetches unique off-chain voters with pagination and on-chain members/delegates with pagination.

  9. Request with Data Refresh
  10. URL: /members/ens.eth?refresh=true

    Description: Forces a refresh of cached data for the specified space.