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

Entity Data contract

PreviousEntity Feature FlagNextEntity Authentication Token

Last updated 1 year ago

Terminate Feature Flag For Entity

get

Terminate Feature Flag For Entity

Path parameters
entityIdstringRequired
flagNamestringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
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}/featureFlags/{flagName}/terminate HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "entityId": "entity123",
    "flagName": "Flag Name",
    "description": "Flag description",
    "isActive": true,
    "isEnabled": true,
    "createdAt": "2023-06-27T12:45:00Z",
    "metadata": {
      "key1": "value1",
      "key2": "value2"
    }
  }
}

Get entity level flags of an Entity

post

Get entity level flags of a particular Entity

Path parameters
entityIdstringRequired
forEntityIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
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
post
POST /api/entities/{entityId}/forEntityId/{forEntityId}/featureFlags HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "flags": {
    "entityId": "entity123",
    "flagName": "Flag Name",
    "description": "Flag description",
    "isActive": true,
    "isEnabled": true,
    "createdAt": "2023-06-27T12:45:00Z",
    "metadata": {
      "key1": "value1",
      "key2": "value2"
    }
  }
}

Get All Data Contracts for an Entity

get

Get all Data Contracts for specific entity.

Path parameters
entityIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
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}/dataContracts HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "entityId": "entity123",
    "createdBy": "user123",
    "name": "Data Contract Name",
    "description": "Data Contract Description",
    "tags": [
      [
        "tag1",
        "tag2"
      ]
    ],
    "source": "URL",
    "fields": [
      {
        "name": "FieldName",
        "description": "Field Description",
        "validationRules": {
          "type": "string",
          "required": false,
          "unique": false,
          "nonnull": false,
          "minLength": 0,
          "maxLength": 255,
          "enum": [
            "value1",
            "value2"
          ],
          "regex": "^\\d{3}-\\d{2}-\\d{4}$",
          "min": 0,
          "max": 100
        }
      }
    ],
    "isDeleted": false,
    "createdAt": "2023-06-27T12:45:00Z",
    "updatedAt": "2023-06-27T12:45:00Z"
  }
}

Get specific data contract

get

Get specific data contract of an entity.

Path parameters
entityIdstringRequired
dataContractIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
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}/dataContracts/{dataContractId} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "entityId": "entity123",
    "createdBy": "user123",
    "name": "Data Contract Name",
    "description": "Data Contract Description",
    "tags": [
      [
        "tag1",
        "tag2"
      ]
    ],
    "source": "URL",
    "fields": [
      {
        "name": "FieldName",
        "description": "Field Description",
        "validationRules": {
          "type": "string",
          "required": false,
          "unique": false,
          "nonnull": false,
          "minLength": 0,
          "maxLength": 255,
          "enum": [
            "value1",
            "value2"
          ],
          "regex": "^\\d{3}-\\d{2}-\\d{4}$",
          "min": 0,
          "max": 100
        }
      }
    ],
    "isDeleted": false,
    "createdAt": "2023-06-27T12:45:00Z",
    "updatedAt": "2023-06-27T12:45:00Z"
  }
}

Delete data contracts

post

Delete data contracts of specific entity.

Path parameters
entityIdstringRequired
dataContractIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
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
post
POST /api/entities/{entityId}/dataContracts/{dataContractId}/delete HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true
}
  • GETTerminate Feature Flag For Entity
  • POSTGet entity level flags of an Entity
  • GETGet All Data Contracts for an Entity
  • POSTAdd new data contract
  • GETGet specific data contract
  • POSTUpdate data contract
  • POSTDelete data contracts
  • POSTChat with Data Contract for Entity
  • POSTUpload CSV and Create Data Contract
  • POSTFetch schema fields from Google Sheet
  • POSTAuto Generate the description

Add new data contract

post

Add new data contract info of specific entity.

Path parameters
entityIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
namestringOptionalExample: Data Contract Name
descriptionstringOptionalExample: Data Contract Description
sourcestringOptionalExample: URL
tagsstring[]OptionalExample: ["tag1","tag2"]
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}/dataContracts HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 371

{
  "name": "Data Contract Name",
  "description": "Data Contract Description",
  "source": "URL",
  "fields": [
    {
      "name": "FieldName",
      "description": "Field Description",
      "validationRules": {
        "type": "string",
        "required": false,
        "unique": false,
        "nonnull": false,
        "minLength": 0,
        "maxLength": 255,
        "enum": [
          [
            "value1",
            "value2"
          ]
        ],
        "regex": "^\\d{3}-\\d{2}-\\d{4}$",
        "min": 0,
        "max": 100
      }
    }
  ],
  "tags": [
    [
      "tag1",
      "tag2"
    ]
  ]
}
{
  "success": true,
  "datasetId": "id-123"
}

Update data contract

post

Update data contract of specific entity.

Path parameters
entityIdstringRequired
dataContractIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
namestringOptionalExample: Data Contract Name
descriptionstringOptionalExample: Data Contract Description
sourcestringOptionalExample: URL
tagsstring[]OptionalExample: ["tag1","tag2"]
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}/dataContracts/{dataContractId}/update HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 371

{
  "name": "Data Contract Name",
  "description": "Data Contract Description",
  "source": "URL",
  "fields": [
    {
      "name": "FieldName",
      "description": "Field Description",
      "validationRules": {
        "type": "string",
        "required": false,
        "unique": false,
        "nonnull": false,
        "minLength": 0,
        "maxLength": 255,
        "enum": [
          [
            "value1",
            "value2"
          ]
        ],
        "regex": "^\\d{3}-\\d{2}-\\d{4}$",
        "min": 0,
        "max": 100
      }
    }
  ],
  "tags": [
    [
      "tag1",
      "tag2"
    ]
  ]
}
{
  "success": true
}

Chat with Data Contract for Entity

post

Chat with the specified Data Contract for a specific entity.

Path parameters
entityIdstringRequired
dataContractIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
userInputstringOptional

User input for the chat conversation.

isInternalbooleanOptional

Flag indicating whether the request is internal (true/false).

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}/dataContracts/{dataContractId}/chat HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "userInput": "text",
  "isInternal": true
}
{
  "success": true,
  "data": "Generated chat response",
  "queryCount": 42
}

Upload CSV and Create Data Contract

post

Upload a CSV file to create a new data contract for a specific entity.

Path parameters
entityIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
uploaded_filestring ยท binaryOptional
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}/uploadcsv HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: multipart/form-data
Accept: */*
Content-Length: 26

{
  "uploaded_file": "binary"
}
{
  "success": true,
  "data": {
    "entityId": "entity123",
    "createdBy": "user123",
    "name": "Data Contract Name",
    "description": "Data Contract Description",
    "tags": [
      [
        "tag1",
        "tag2"
      ]
    ],
    "source": "URL",
    "fields": [
      {
        "name": "FieldName",
        "description": "Field Description",
        "validationRules": {
          "type": "string",
          "required": false,
          "unique": false,
          "nonnull": false,
          "minLength": 0,
          "maxLength": 255,
          "enum": [
            "value1",
            "value2"
          ],
          "regex": "^\\d{3}-\\d{2}-\\d{4}$",
          "min": 0,
          "max": 100
        }
      }
    ],
    "isDeleted": false,
    "createdAt": "2023-06-27T12:45:00Z",
    "updatedAt": "2023-06-27T12:45:00Z"
  }
}

Fetch schema fields from Google Sheet

post

Fetch only the fields in schema from Google Sheets & add new data contract

Path parameters
entityIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
googleSheetLinkstringOptionalExample: https://docs.google.com/spreadsheets/d/18L1234555555/
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}/googlesheet HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "googleSheetLink": "https://docs.google.com/spreadsheets/d/18L1234555555/"
}
{
  "success": true,
  "datasetId": "u-123"
}

Auto Generate the description

post

Auto Generate the description using AI

Path parameters
entityIdstringRequired
dataContractIdstringRequired
Query parameters
entityIdstringRequired

The Id of the entity.

Example: dummy-entityid
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
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}/dataContracts/{dataContractId}/autoGenerate HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 261

{
  "fields": [
    {
      "name": "FieldName",
      "description": "Field Description",
      "validationRules": {
        "type": "string",
        "required": false,
        "unique": false,
        "nonnull": false,
        "minLength": 0,
        "maxLength": 255,
        "enum": [
          [
            "value1",
            "value2"
          ]
        ],
        "regex": "^\\d{3}-\\d{2}-\\d{4}$",
        "min": 0,
        "max": 100
      }
    }
  ]
}
{
  "success": true,
  "res": "Generated description message"
}