Witness Chain
  • Introduction to Witness Chain
  • Infinity Watch
    • Proof of Location (Mainnet)
      • Introduction
      • Process flow
      • Architecture
      • Run a watchtower!
        • For Partner node runners
          • Running on Akash Cloud
          • Running on SuperNoderz
        • EigenLayer operators
          • Running a PoL Watchtower
          • Witness Chain AVS opt-in guide
        • At-home watchtowers
        • For DePIN/Validator Node provider
      • Demos
      • PoL Research
    • APIs
      • Campaign APIs
        • Key Terminologies
        • Authentication
        • Create Campaign
        • Edit campaign
        • Get Photo feed from campaign
        • Get Campaigns
      • Challenge APIs
        • Overview
        • Getting Started
  • Resources
    • Blogs
      • How Proof of Location Works
      • Redefining Geolocation Compliance: Witness Chain & Predicate
    • 🗞️Research
    • 🎙️Talks and Podcasts
    • 🤝Community
    • ⚖️Smart Contracts
    • File a bug
  • Archive
    • Introduction
    • Proof of Diligence Watchtower Protocol
      • How it works
      • Diligence Watchtower Roadmap
      • Watchtower Architecture
      • Chains watched
      • Smart Contracts
      • Quick Links
      • FAQs
    • For the node operators
      • Node requirements
      • Watchtower setup
        • [ARCHIVE] Mainnet Setup
          • L2 Archive Node Setup guide
        • Holesky Setup
          • L2 Archive Node Setup guide
        • Migration from archive to full node
      • Monitoring
    • Research
    • Keys Management
    • Proof of Bandwidth
      • Introduction
      • Architecture
      • For the node operators
        • Running a PoB Challenger Client
        • Running a PoB Prover Client
      • Demos
      • Research
    • 🤝Watchtower Protocol (Architecture v1)
      • 🗼How it works
      • 📅Watchtower Roadmap
      • 🏦Watchtower Architecture
      • 🔗Chains supported
Powered by GitBook
On this page
  • Endpoint
  • Response
  • Example Response
  • Example Task-Type Campaign Response
  • Error Codes
  • Response Fields
  1. Infinity Watch
  2. APIs
  3. Campaign APIs

Get Campaigns

Retrieves all campaigns created on Infinity Watch

Endpoint

POST /all-campaigns

Response

{
  "type": "object",
  "properties": {
    "result": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the campaign"
          },
          "banner_url": {
            "type": "string",
            "format": "uri",
            "description": "URL of the banner image shown to users"
          },
          "poster_url": {
            "type": "string",
            "format": "uri",
            "description": "URL of the poster image shown to users"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the campaign was created"
          },
          "created_by": {
            "type": "string",
            "description": "Username of the campaign creator"
          },
          "created_by_publicKey": {
            "type": "string",
            "description": "Public key of the campaign creator"
          },
          "description": {
            "type": "string",
            "description": "Detailed description of the campaign"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the campaign starts"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the campaign ends"
          },
          "fuel_required": {
            "type": "number",
            "description": "Amount of fuel required for participation"
          },
          "is_active": {
            "type": "boolean",
            "description": "Whether the campaign is currently active"
          },
          "latitude": {
            "type": "number",
            "description": "Geographical latitude of the campaign center"
          },
          "longitude": {
            "type": "number",
            "description": "Geographical longitude of the campaign center"
          },
          "radius": {
            "type": "number",
            "description": "Radius in kilometers within which the campaign is valid"
          },
          "location_limit_in_meters": {
            "type": "number",
            "description": "Limit in meters for location verification"
          },
          "max_submissions": {
            "type": "integer",
            "description": "Maximum total submissions allowed for the campaign"
          },
          "max_submissions_per_witness": {
            "type": "integer",
            "description": "Maximum submissions allowed per individual witness"
          },
          "submissions": {
            "type": "integer",
            "description": "Current number of submissions received"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of tags associated with the campaign"
          },
          "type": {
            "type": "string",
            "enum": ["individual", "group", "task"],
            "description": "Type of campaign"
          },
          "currency": {
            "type": "string",
            "description": "Currency type for rewards"
          },
          "reward_per_task": {
            "type": "number",
            "description": "Amount of reward given per completed task"
          },
          "total_rewards": {
            "type": "number",
            "description": "Total rewards available for the campaign"
          },
          "tasks": {
            "type": "object",
            "description": "For task-type campaigns, contains task definitions",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "description": "Description of the task"
                },
                "fuel_required": {
                  "type": "number",
                  "description": "Amount of fuel required for this specific task"
                }
              }
            }
          },
          "whitelist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of public keys allowed to participate in this campaign"
          }
        }
      }
    }
  }
}

Example Response

{
  "result": [
    {
      "banner_url": "https://truesnap.s3.us-east-1.amazonaws.com/horizontal_artistics_eye_for_ai.png",
      "created_at": "2025-01-31T14:53:25.800Z",
      "created_by": "@witnesschain",
      "description": "Get started with the first artistic eye for AI campaign",
      "ends_at": "2025-05-11T14:53:25.800Z",
      "fuel_required": 1,
      "id": "ArtisticEyeForAI",
      "is_active": true,
      "latitude": 40,
      "longitude": -73,
      "max_submissions": 500000,
      "max_submissions_per_witness": 10,
      "poster_url": "https://truesnap.s3.us-east-1.amazonaws.com/2.png",
      "radius": 20000,
      "starts_at": "2025-01-31T14:53:25.800Z",
      "submissions": 110,
      "tags": ["AI", "Art"],
      "type": "individual"
    },
    {
      "banner_url": "https://truesnap.s3.us-east-1.amazonaws.com/6176690776340284330.jpg",
      "created_at": "2025-02-21T06:46:56.833Z",
      "created_by": "@witnesschain",
      "created_by_publicKey": "0x701441ee7150744fb01b7cb8aa5366617451f9f6",
      "currency": "POINTS",
      "description": "Prove your gains",
      "ends_at": "2025-06-01T06:43:37.751Z",
      "fuel_required": 1,
      "id": "ProveYourGains",
      "is_active": true,
      "latitude": 40,
      "location_limit_in_meters": 22000000,
      "longitude": -73,
      "max_submissions": 500000,
      "max_submissions_per_witness": 10,
      "poster_url": "https://truesnap.s3.us-east-1.amazonaws.com/6176690776340284331.jpg",
      "radius": 22000,
      "reward_per_task": 2,
      "starts_at": "2025-02-21T06:40:28.230Z",
      "submissions": 6,
      "tags": ["loss", "gains"],  
      "total_rewards": 10000,
      "type": "individual"
    }
  ]
}  

Example Task-Type Campaign Response

{
  "result": [
    {
      "banner_url": "https://images.wallpapersden.com/image/download/serene-nature-hd-pixel-art-sunset_bmhlZ22UmZqaraWkpJRnamtlrWZpaGo.jpg",
      "created_at": "2025-02-21T13:07:15.584Z",
      "created_by": "@witnesschain",
      "created_by_publicKey": "0xae3c67152ee393082f85e9d59a471b375f3ce406",
      "currency": "POINTS",
      "description": "This is a test campaign for the type \"task\"",
      "ends_at": "2025-03-06T11:33:07.423Z",
      "fuel_required": 1,
      "id": "my-task-campaign",
      "is_active": true,
      "latitude": 13.03,
      "location_limit_in_meters": 1000,
      "longitude": 77.5,
      "max_submissions": 10000,
      "poster_url": "https://placehold.co/180x320",
      "radius": 100,
      "reward_per_task": 1,
      "starts_at": "2025-02-24T11:33:07.423Z",
      "submissions": 7,
      "tags": [],
      "tasks": {
        "task0": {
          "description": "Test task 0. Upload a random picture to test multi-task campaigns",
          "fuel_required": 1
        },
        "task1": {
          "description": "Test task 1. Upload a random picture to test multi-task campaigns",
          "fuel_required": 1
        },
        "task2": {
          "description": "Test task 2. Upload a random picture to test multi-task campaigns",
          "fuel_required": 1
        }
      },
      "total_rewards": 10,
      "type": "task",
      "whitelist": [
        "0x...",
        "0x..."
      ]
    }
  ]
}

Error Codes

Status Code
Error Code
Description

400

INVALID_REQUEST

Request is malformed or missing required fields

400

INVALID_CAMPAIGN_TYPE

Campaign type must be one of: individual, group, task

400

INVALID_COORDINATES

Invalid latitude or longitude values

400

INVALID_DATE_RANGE

End date must be after start date

401

UNAUTHORIZED

Authentication token is missing or invalid

403

FORBIDDEN

User does not have permission to perform this action

403

CAMPAIGN_LIMIT_REACHED

User has reached maximum allowed campaigns

404

CAMPAIGN_NOT_FOUND

The requested campaign does not exist

409

DUPLICATE_CAMPAIGN_ID

A campaign with this ID already exists

429

RATE_LIMIT_EXCEEDED

Too many requests, please try again later

500

INTERNAL_SERVER_ERROR

An unexpected error occurred

503

SERVICE_UNAVAILABLE

Service is temporarily unavailable

Response Fields

Common Campaign Fields

Field
Type
Description

id

string

Unique identifier for the campaign

banner_url

string

Banner image URL

poster_url

string

Poster image URL

created_at

string

Creation timestamp (ISO 8601)

created_by

string

Username of campaign creator

created_by_publicKey

string

Public key of campaign creator

description

string

Campaign description

starts_at

string

Start timestamp (ISO 8601)

ends_at

string

End timestamp (ISO 8601)

is_active

boolean

Active status

type

string

Campaign type (individual, group, task)

tags

array

Array of campaign tags

submissions

integer

Current submission count

Location Fields

Field
Type
Description

latitude

number

Center latitude

longitude

number

Center longitude

radius

number

Campaign radius in kilometers

location_limit_in_meters

number

Location verification limit

Reward Fields

Field
Type
Description

currency

string

Reward currency type

total_rewards

number

Total available rewards

reward_per_task

number

Reward per completed task

fuel_required

number

Required fuel for participation

Task-Type Campaign Fields

Field
Type
Description

tasks

object

Map of task IDs to task definitions

whitelist

array

List of authorized public keys

PreviousGet Photo feed from campaignNextChallenge APIs

Last updated 2 months ago