Quest Protocol
  • Introduction
    • Welcome to Quest Protocol
    • Integrate & Partner with Quest
    • Use Cases
      • Creator Platforms
      • Gaming
      • NFT Marketplaces
      • Social Media DApps
      • DeFi
  • QUEST PLATFORM
    • Creating a Campaign
    • Audience Overview
    • User Profile
    • Discover Page
    • Perk Store
    • Integrations
    • Memberships
    • Segmentation & Targetting
    • AI Insights
  • QUEST PROTOCOL - SDKs & APIs
    • UI SDK Components
      • Embedded XP Points
      • Embedded in-dApp Guides
      • Embedded Web3 Search
      • Embedded Quests
    • Quest SDKs & APIs
      • User
      • Entity
      • Badge
      • Campaign
      • App Metric
      • Membership Card
      • Entity Tag
      • Membership Tier
      • Skill
      • Entity Credit Tier
      • Gem
      • Custom Reward
      • Entity Gem
      • Entity Alert
      • Entity Feature Flag
      • Entity Data contract
      • Entity Authentication Token
      • Event Metric Mapping
    • Data Engine
  • Website
  • Quest Thesis
Powered by GitBook
On this page
  1. QUEST PROTOCOL - SDKs & APIs
  2. Quest SDKs & APIs

App Metric

PreviousCampaignNextMembership Card

Last updated 1 year ago

Get app metrics info of a user

get

This endpoint retrieves the app metrics info for a user.

Path parameters
entityIdstringRequired
userIdstringRequired
metricstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/users/{userId}/metrics/{metric} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "metric": "metric-1",
    "counter": 10
  }
}

Get all app metrics of a user

get

This endpoint retrieves all the app metrics for a user.

Path parameters
entityIdstringRequired
userIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/users/{userId}/metrics HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "id": "id-1",
    "name": "app-metric-name"
  }
}

Delete an app metric

post

This endpoint allows deleting an app metric.

Path parameters
entityIdstringRequired
metricstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/metrics/{metric}/delete HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true
}

Get metric claim summary

get

This endpoint retrieves a summary of metric claims for an entity.

Path parameters
entityIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/metrics/claims HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": [
    {
      "metric": "metric-1",
      "count": 10
    }
  ]
}

Get Dapp metric value for entity

get

This endpoint retrieves the value of a Dapp metric for an entity.

Path parameters
entityIdstringRequired
userIdstringRequired
metricstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/users/{userId}/getmetrics/{metric} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": 10
}

Get metric summary for a quest

get

This endpoint retrieves the metric summary for a quest in a specified entity.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/metric-summary HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": [
    {
      "metric": "quest-metric-1",
      "date": "2023-12-31",
      "count": 10,
      "metricDetails": {
        "metric": "quest-metric-1",
        "entityId": "entity-id-1",
        "type": "metric-type",
        "name": "metric-name",
        "description": "metric-description",
        "thresholdTime": 60000,
        "isEnabled": true,
        "createdAt": "2023-01-01T00:00:00Z",
        "platform": "segment",
        "eventName": "metric-event"
      }
    }
  ]
}
  • GETGet all app metrics
  • POSTCreate a new app metric
  • GETGet app metrics info of a user
  • POSTIncrement app metrics for a user
  • GETGet all app metrics of a user
  • POSTIncrement multiple app metrics for a user
  • POSTDelete an app metric
  • POSTUpdate an app metric
  • GETGet metric claim summary
  • GETGet Dapp metric value for entity
  • GETGet metric summary for a quest

Get all app metrics

get

This endpoint retrieves all the app metrics.

Path parameters
entityIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/metrics HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "id": "id-1",
    "name": "app-metric-name"
  }
}

Create a new app metric

post

This endpoint allows creating a new app metric.

Path parameters
entityIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
metricstringRequiredExample: metric-1
namestringOptionalExample: Metric Name
descriptionstringOptionalExample: Metric description
typestringOptionalExample: metric_type
thresholdTimenumberOptionalExample: 10
platformstringOptionalExample: segment
eventNamestringOptionalExample: metric_event
Responses
200
Successful response
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/metrics HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 165

{
  "metric": "metric-1",
  "name": "Metric Name",
  "description": "Metric description",
  "type": "metric_type",
  "thresholdTime": 10,
  "platform": "segment",
  "eventName": "metric_event"
}
{
  "success": true,
  "data": {
    "metric": "metric-1",
    "entityId": "entityId-1",
    "type": "metric_type",
    "name": "Metric Name",
    "description": "Metric description",
    "thresholdTime": 10,
    "isEnabled": true,
    "createdAt": "2023-01-01T00:00:00Z",
    "platform": "segment",
    "eventName": "metric_event"
  }
}

Increment app metrics for a user

post

This endpoint allows to increment app metrics of a user.

Path parameters
entityIdstringRequired
userIdstringRequired
metricstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
countnumberOptionalExample: 10
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/users/{userId}/metrics/{metric} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 12

{
  "count": 10
}
{
  "success": true
}

Increment multiple app metrics for a user

post

This endpoint allows to increment multiple app metrics of a user.

Path parameters
entityIdstringRequired
userIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/users/{userId}/metrics HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "metrics": [
    {
      "metricId": "dummy-id",
      "count": 10
    }
  ]
}
{
  "success": true
}

Update an app metric

post

This endpoint allows updating an app metric.

Path parameters
entityIdstringRequired
metricstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
namestringOptional
descriptionstringOptional
typestringOptional
thresholdTimenumberOptional
platformstringOptional
eventNamestringOptional
Responses
200
Successful response
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/metrics/{metric}/update HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "name": "Updated Metric Name",
  "description": "Updated metric description.",
  "type": "counter",
  "thresholdTime": 3600,
  "platform": "segment",
  "eventName": "updated_event"
}
{
  "success": true
}