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

User

User module apis

PreviousQuest SDKs & APIsNextEntity

Last updated 1 year ago

Get user details

get

This endpoint retrieves the details of a specific user.

Path parameters
userIdstringRequired
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/users/{userId} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "userId": "12345",
    "userRecordMappingId": "67890",
    "signatureToken": "abc123",
    "name": "John Doe",
    "username": "johndoe",
    "imageUrl": "https://example.com/profile.jpg",
    "bannerUrl": "https://example.com/banner.jpg",
    "subtitle": "Software Engineer",
    "location": "New York, USA",
    "interests": [
      "Blockchain",
      "AI",
      "Gaming"
    ],
    "expertise": [
      "Web Development",
      "Data Science"
    ],
    "goals": [
      "Learn new technologies",
      "Contribute to open-source projects"
    ],
    "eth_nfts": [
      {
        "nftId": "nft1",
        "nftName": "NFT 1",
        "nftImageUrl": "https://example.com/nft1.jpg",
        "nftContractId": "ethcontract1"
      },
      {
        "nftId": "nft2",
        "nftName": "NFT 2",
        "nftImageUrl": "https://example.com/nft2.jpg",
        "nftContractId": "ethcontract2"
      }
    ],
    "polygon_nfts": [
      {
        "nftId": "nft3",
        "nftName": "NFT 3",
        "nftImageUrl": "https://example.com/nft3.jpg",
        "nftContractId": "polygoncontract1"
      }
    ],
    "sol_nfts": [
      {
        "nftId": "nft4",
        "nftName": "NFT 4",
        "nftImageUrl": "https://example.com/nft4.jpg",
        "nftContractId": "solcontract1"
      }
    ],
    "about": "I'm a passionate developer interested in blockchain and artificial intelligence.",
    "currentWork": "Acme Corporation",
    "role": "Other",
    "funFacts": [
      "I love hiking",
      "I play guitar"
    ],
    "tokenGeneratedAt": "2023-06-27T10:15:00Z",
    "lastHardRefreshAt": "2023-06-26T18:30:00Z",
    "modifiedAt": "2023-06-27T12:45:00Z",
    "createdAt": "2023-06-25T09:00:00Z"
  },
  "isAdmin": false
}

Get user details for email

get

This endpoint retrieves the details of a specific user by their email.

Path parameters
emailstringRequired
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
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/users/email/{email} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Accept: */*
{
  "success": true,
  "data": {
    "userId": "12345",
    "userRecordMappingId": "67890",
    "signatureToken": "abc123",
    "name": "John Doe",
    "username": "johndoe",
    "imageUrl": "https://example.com/profile.jpg",
    "bannerUrl": "https://example.com/banner.jpg",
    "subtitle": "Software Engineer",
    "location": "New York, USA",
    "interests": [
      "Blockchain",
      "AI",
      "Gaming"
    ],
    "expertise": [
      "Web Development",
      "Data Science"
    ],
    "goals": [
      "Learn new technologies",
      "Contribute to open-source projects"
    ],
    "eth_nfts": [
      {
        "nftId": "nft1",
        "nftName": "NFT 1",
        "nftImageUrl": "https://example.com/nft1.jpg",
        "nftContractId": "ethcontract1"
      },
      {
        "nftId": "nft2",
        "nftName": "NFT 2",
        "nftImageUrl": "https://example.com/nft2.jpg",
        "nftContractId": "ethcontract2"
      }
    ],
    "polygon_nfts": [
      {
        "nftId": "nft3",
        "nftName": "NFT 3",
        "nftImageUrl": "https://example.com/nft3.jpg",
        "nftContractId": "polygoncontract1"
      }
    ],
    "sol_nfts": [
      {
        "nftId": "nft4",
        "nftName": "NFT 4",
        "nftImageUrl": "https://example.com/nft4.jpg",
        "nftContractId": "solcontract1"
      }
    ],
    "about": "I'm a passionate developer interested in blockchain and artificial intelligence.",
    "currentWork": "Acme Corporation",
    "role": "Other",
    "funFacts": [
      "I love hiking",
      "I play guitar"
    ],
    "tokenGeneratedAt": "2023-06-27T10:15:00Z",
    "lastHardRefreshAt": "2023-06-26T18:30:00Z",
    "modifiedAt": "2023-06-27T12:45:00Z",
    "createdAt": "2023-06-25T09:00:00Z"
  },
  "isAdmin": false
}

Get user details for wallet address

get

This endpoint retrieves the details of a specific user by their wallet address.

Path parameters
walletAddressstringRequired
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
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/users/address/{walletAddress} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Accept: */*
{
  "success": true,
  "data": {
    "userId": "12345",
    "userRecordMappingId": "67890",
    "signatureToken": "abc123",
    "name": "John Doe",
    "username": "johndoe",
    "imageUrl": "https://example.com/profile.jpg",
    "bannerUrl": "https://example.com/banner.jpg",
    "subtitle": "Software Engineer",
    "location": "New York, USA",
    "interests": [
      "Blockchain",
      "AI",
      "Gaming"
    ],
    "expertise": [
      "Web Development",
      "Data Science"
    ],
    "goals": [
      "Learn new technologies",
      "Contribute to open-source projects"
    ],
    "eth_nfts": [
      {
        "nftId": "nft1",
        "nftName": "NFT 1",
        "nftImageUrl": "https://example.com/nft1.jpg",
        "nftContractId": "ethcontract1"
      },
      {
        "nftId": "nft2",
        "nftName": "NFT 2",
        "nftImageUrl": "https://example.com/nft2.jpg",
        "nftContractId": "ethcontract2"
      }
    ],
    "polygon_nfts": [
      {
        "nftId": "nft3",
        "nftName": "NFT 3",
        "nftImageUrl": "https://example.com/nft3.jpg",
        "nftContractId": "polygoncontract1"
      }
    ],
    "sol_nfts": [
      {
        "nftId": "nft4",
        "nftName": "NFT 4",
        "nftImageUrl": "https://example.com/nft4.jpg",
        "nftContractId": "solcontract1"
      }
    ],
    "about": "I'm a passionate developer interested in blockchain and artificial intelligence.",
    "currentWork": "Acme Corporation",
    "role": "Other",
    "funFacts": [
      "I love hiking",
      "I play guitar"
    ],
    "tokenGeneratedAt": "2023-06-27T10:15:00Z",
    "lastHardRefreshAt": "2023-06-26T18:30:00Z",
    "modifiedAt": "2023-06-27T12:45:00Z",
    "createdAt": "2023-06-25T09:00:00Z"
  },
  "isAdmin": false
}

Get user's entities

get

This endpoint retrieves all the entities the user is part of.

Path parameters
userIdstringRequired
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
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/users/{userId}/entities HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Accept: */*
{
  "success": true,
  "data": [
    {
      "id": "e-0000001",
      "name": "some entity",
      "openseaSlug": "dummy-slug",
      "description": "this is the entity description",
      "twitter": "twitterusername",
      "discord": "discordusername",
      "telegram": "telegramusername",
      "instagram": "telegramusername",
      "website": "https://www.entitywebsite.com",
      "contracts": [
        "contractid"
      ],
      "ownerIDs": [
        "u-dummy-user"
      ],
      "imageUrl": "dummy-image-url",
      "bannerUrl": "dummy-banner-url"
    }
  ]
}

Get user's admin entities

get

This endpoint retrieves all the entities the user is an admin of.

Path parameters
userIdstringRequired
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
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/users/{userId}/admin-entities HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Accept: */*
{
  "success": true,
  "data": [
    {
      "name": "entity-name",
      "description": "entity-name",
      "id": "entity-id",
      "imageUrl": "dummy-image-url"
    }
  ]
}

Get user's connected socials

get

This endpoint retrieves all the socials the user is connected to.

Path parameters
entityIdstringRequired
userIdstringRequired
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}/connected-socials HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "ethAddresses": [
      "eth-address"
    ],
    "emails": [
      "[email protected]"
    ],
    "twitter": {
      "name": "your name",
      "username": "twitter user name",
      "userId": "userId"
    },
    "discord": {
      "name": "your name",
      "username": "discord user name",
      "userId": "userId"
    }
  }
}
  • POSTWallet login
  • POSTSend login OTP
  • POSTVerify login OTP
  • POSTGoogle login
  • POSTlogin using external source
  • POSTCreate new custom user.
  • POSTRefresh user token
  • POSTUpdate user details
  • GETGet user details
  • GETGet user details for email
  • GETGet user details for wallet address
  • GETGet user's entities
  • GETGet user's admin entities
  • POSTSelect current admin entity
  • GETGet user's connected socials

Wallet login

post

This endpoint allows user to login through any crypto wallet.

Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Body
entityIdstringRequiredExample: e-123
walletAddressstringRequiredExample: e-x012121212
signaturestringRequiredExample: e-x012121212-121212
tokenstringRequiredExample: token-used-for-signature
refreshTokenstringOptionalExample: dumy-refresh-token
Responses
200
User already exists
application/json
201
New user created
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/users/wallet/login HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Content-Type: application/json
Accept: */*
Content-Length: 156

{
  "entityId": "e-123",
  "walletAddress": "e-x012121212",
  "signature": "e-x012121212-121212",
  "token": "token-used-for-signature",
  "refreshToken": "dumy-refresh-token"
}
{
  "success": true,
  "userId": "u-123user",
  "newUser": false,
  "token": "dumy-token",
  "refreshToken": "dumy-refresh-token"
}

Send login OTP

post

This endpoint sends a login OTP to the given email address.

Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Body
emailstringRequiredExample: [email protected]
Responses
200
Successful response
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/users/email-login/send-otp HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "email": "[email protected]"
}
{
  "success": true,
  "data": "OTP sent successfully"
}

Verify login OTP

post

This endpoint verifies the login OTP sent via email.

Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Body
emailstringRequiredExample: dummy-email
otpnumberRequiredExample: 123456
entityIdstringOptionalExample: dummt-entityid
Responses
200
User already exists
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/users/email-login/verify-otp HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Content-Type: application/json
Accept: */*
Content-Length: 64

{
  "email": "dummy-email",
  "otp": 123456,
  "entityId": "dummt-entityid"
}
{
  "success": true,
  "userId": "u-123user",
  "token": "dumy-token",
  "refreshToken": "dumy-refresh-token"
}

Google login

post

This endpoint allows user to login through google.

Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Body
codestringRequiredExample: dummy-code
redirectUristringRequiredExample: https://redirect.com/google
entityIdstringOptionalExample: dummt-entityid
Responses
200
User already exists
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/users/google/login HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "code": "dummy-code",
  "redirectUri": "https://redirect.com/google",
  "entityId": "dummt-entityid"
}
{
  "success": true,
  "userId": "u-123user",
  "token": "dumy-token",
  "refreshToken": "dumy-refresh-token"
}

login using external source

post

This endpoint allows user to login through any external source.

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
entity-authentication-tokenstringOptional

The authentication token to authorize requests on behalf of an entity.

Example: dummy-token
user-agentstringRequired
Body
entityIdstringOptionalExample: e-123
externalUserIdstringOptionalExample: example-x012121212
walletAddressstringOptionalExample: abc@
emailstringOptional
Responses
200
User created
application/json
201
User created
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/users/external/login HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
user-agent: text
Content-Type: application/json
Accept: */*
Content-Length: 96

{
  "entityId": "e-123",
  "externalUserId": "example-x012121212",
  "walletAddress": "abc@",
  "email": "text"
}
{
  "success": true,
  "userId": "u-000001",
  "token": "text",
  "refreshToken": "dumy-refresh-token"
}

Create new custom user.

post

This endpoint allows to create a custom user with custom userId and a platform name.

Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Body
customUserIdstringRequiredExample: dummy-userid
customPlatformstringRequiredExample: instagram
entityIdstringRequiredExample: dummt-entityid
Responses
200
User already exists
application/json
201
User created
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/users/custom-ids HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "customUserId": "dummy-userid",
  "customPlatform": "instagram",
  "entityId": "dummt-entityid"
}
{
  "success": false,
  "userId": "dummy-userid",
  "newUser": false,
  "error": "User already exists"
}

Refresh user token

post

This endpoint refreshes the user token for a specified entity and 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
refreshTokenstringOptionalExample: refresh-token-value
Responses
200
Successful response
application/json
400
Client error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/users/{userId}/refresh-token HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "refreshToken": "refresh-token-value"
}
{
  "success": true,
  "data": {
    "token": "new-access-token"
  }
}

Update user details

post

This endpoint allows the user to update their details.

Path parameters
userIdstringRequired
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
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Body
namestringOptionalExample: Jon Doe
imageUrlstringOptionalExample: https://www.myimage.com
bannerUrlstringOptionalExample: https://www.mybanner.com
locationstringOptionalExample: India
expertisestring[]OptionalExample: ["Java","CPP","JavaScript"]
goalsstring[]OptionalExample: ["To become a senior software engineer","contribute to open-source projects"]
interestsstring[]OptionalExample: ["Photography","traveling","reading"]
aboutstringOptionalExample: Jon is a passionate software developer with several years of experience in building web applications.
currentWorkstringOptionalExample: Software engineer at XYZ Tech
funFactsstringOptionalExample: Once climbed Mount Kilimanjaro and has performed at local music festivals with my band.
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/users/{userId} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Content-Type: application/json
Accept: */*
Content-Length: 548

{
  "name": "Jon Doe",
  "imageUrl": "https://www.myimage.com",
  "bannerUrl": "https://www.mybanner.com",
  "location": "India",
  "expertise": [
    "Java",
    "CPP",
    "JavaScript"
  ],
  "goals": [
    "To become a senior software engineer",
    "contribute to open-source projects"
  ],
  "interests": [
    "Photography",
    "traveling",
    "reading"
  ],
  "about": "Jon is a passionate software developer with several years of experience in building web applications.",
  "currentWork": "Software engineer at XYZ Tech",
  "funFacts": "Once climbed Mount Kilimanjaro and has performed at local music festivals with my band."
}
{
  "success": true
}

Select current admin entity

post

This endpoint updates the current admin entity of the user.

Path parameters
userIdstringRequired
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
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Body
entityIdstringOptionalExample: e-exampleEnittyId
Responses
200
Successful response
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/users/{userId}/admin-entities HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "entityId": "e-exampleEnittyId"
}
{
  "success": true
}