Skip to main content
Supports comprehensive filtering, search, and sorting options.

Prerequisites

  • Valid API key with object read permissions

Request

curl -X GET "https://api.g2cplatform.com/v2/objects?limit=20&offset=0&status=active" \
  -H "X-API-Key: your-api-key"

Query Parameters

ParameterTypeRequiredDescription
limitnumberNoMaximum number of objects to return (default: 20, max: 100)
offsetnumberNoNumber of objects to skip for pagination (default: 0)
statusstringNoFilter by status: “active”, “inactive”, “all” (default: “active”)
namestringNoFilter by object name (partial match)
externalIdstringNoFilter by external ID (exact match)
categoryIdstringNoFilter by category ID
subcategoryIdstringNoFilter by subcategory ID
ownerstringNoFilter by owner name (partial match)
sortstringNoSort order: “createdAt:desc”, “createdAt:asc”, “name:asc”, “name:desc” (default: “createdAt:desc”)

Response

{
  "data": [
    {
      "id": "obj_abc123...",
      "externalId": "COFFEE-001",
      "name": "Premium Coffee Beans",
      "description": "High-quality arabica coffee beans from Colombia",
      "summary": "Colombian arabica coffee",
      "owner": "Coffee Corp Ltd",
      "status": "active",
      "categoryId": "cat_food123...",
      "subcategoryId": "sub_beverages456...",
      "metadata": {
        "origin": "Colombia",
        "roast": "Medium",
        "weight": "1kg"
      },
      "createdAt": "2025-01-15T10:30:00Z",
      "updatedAt": "2025-01-15T10:30:00Z",
      "blockchain": {
        "txId": "0xabcdef123456...",
        "lastTxId": "0xfedcba987654...",
        "eventCount": 3
      }
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 1250,
    "hasNext": true,
    "hasPrevious": false
  }
}

Response Fields

FieldTypeDescription
dataarrayArray of object entities
paginationobjectPagination information

Object Entity

FieldTypeDescription
idstringUnique object identifier
externalIdstringExternal identifier for the object
namestringObject name
descriptionstringDetailed description
summarystringBrief summary
ownerstringCurrent owner
statusstringObject status
categoryIdstringCategory identifier
subcategoryIdstringSubcategory identifier
metadataobjectAdditional metadata
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update
blockchainobjectBlockchain information

Pagination Object

FieldTypeDescription
limitnumberCurrent page size
offsetnumberCurrent offset
totalnumberTotal number of objects matching criteria
hasNextbooleanWhether more items are available
hasPreviousbooleanWhether previous items exist

Examples

List All Objects

GET /objects?limit=50&offset=0

List Objects by Category

GET /objects?categoryId=cat_electronics123&limit=20&offset=0

Search Objects by Name

GET /objects?name=smartphone&limit=10&offset=0

List Objects by Owner

GET /objects?owner=TechCorp&limit=25&offset=0

Get Next Page

GET /objects?limit=20&offset=20

Error Responses

Status CodeDescription
400Invalid query parameters
401Unauthorized - invalid API key
403Insufficient permissions
500Internal server error

Pagination Best Practices

  • Use limit to control page size (recommended: 20-50 items)
  • Use offset to navigate through pages
  • Check hasNext before requesting the next page
  • Consider filtering for better performance on large datasets