⚙️
API Docs
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Plaque Lookup API
      • Plaques Prepare API
      • Owner Username API
      • Featured Plaques API
      • Latest contract API
      • Plaques List API
      • Buy Plaque API
      • Stage Wallet Authentication API
      • Email Verification API
      • Request For Private Key API
      • Private Key API
      • Orders Statistics API
      • User Profile API
    • Blockchain Smart-Contract
      • Plaque Price Method
      • Check mintTranfer Method
      • MintTransfer method
      • Token Owners Method
Powered by GitBook
On this page
  • GET Profile data
  • HTTP Request
  • Example Request
  • Post Profile data
  • HTTP Post Request
  • Example Requests
  1. Reference
  2. API Reference

User Profile API

GET Profile data

This endpoint is used to retrieve user profile details. It requires a valid access token in the authorization header to retrieve the profile.

HTTP Request

GET https://api.stagemeta.dev/auth/profile

Headers

Name
Type
Description

Authorization:*

string

The user's access token in the format Bearer <token>.

{
  "id": 22,
  "createdAt": "2022-09-20T12:21:48.995Z",
  "updatedAt": "2023-04-18T16:09:29.327Z",
  "deletedAt": null,
  "email": "email@gmail.com",
  "username": "my-username",
  "image": "https://cdn.stagetry.dev/images/a6bbff20-3.....",
  "walletAddress": "0xf5ad068.....cc05c44c91",
  "receiveEmail": true,
  "canGetDeltaEnergy": false,
  "emailVerify": true,
  "emailVerificationCodeExpireTime": "2023-04-14T11:24:16.008Z",
  "access": [],
  "stripeCustomerId": "cus_...51V4..YyH",
  "totalEnergyReceived": 0,
  "totalPings": 0,
  "isStageWallet": false
}

Example Request

curl -X 'GET' \
  'https://api.stagemeta.dev/auth/profile' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <access_token>'
fetch('https://api.stagemeta.dev/auth/profile', {
  headers: {
    'Authorization': 'Bearer <access_token>',
    'Accept': 'application/json'
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Post Profile data

This endpoint allows users to update their profile information.

HTTP Post Request

POST https://api.stagemeta.dev/auth/profile

Headers

Name
Type
Description

Authorization*

string

The user's access token in the format Bearer <token>.

Request Body

Name
Type
Description

image

file

The user's profile image.

username

string

The user's username

password

string

The user's password.

phoneNumber

string

The user's phone number.

{
  "user": {
    "id": 22,
    "createdAt": "2022-09-20T12:21:48.995Z",
    "updatedAt": "2023-04-18T16:09:29.327Z",
    "deletedAt": null,
    "email": "...@gmail.com",
    "username": "...",
    "image": "https://cdn.stagetry.dev/images/....png",
    "walletAddress": "0xf5ad068d....f37965cc05c44c91",
    "receiveEmail": true,
    "canGetDeltaEnergy": false,
    "emailVerify": true,
    "emailVerificationCodeExpireTime": "2023-04-14T11:24:16.008Z",
    "access": [],
    "stripeCustomerId": "cus_ND...V4cmYyH",
    "totalEnergyReceived": 0,
    "totalPings": 0,
    "isStageWallet": false
  },
  "token": "user-token"
}

Example Requests

curl -X 'POST' \
  'https://api.stagemeta.dev/auth/profile' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer <access_token>' \
  -H 'Content-Type: multipart/form-data' \
  -F 'username=newName' \
  -F 'password=password' \
  -F 'phoneNumber=1234567890' \
  -F 'image=base64 encoded image'
fetch('https://api.stagemeta.dev/auth/profile', {
  method: 'POST',
  headers: {
    'accept': '*/*',
    'Authorization': 'Bearer <access_token>',
    'Content-Type': 'multipart/form-data'
  },
  body: JSON.stringify({
    username: 'newName',
    password: 'password',
    phoneNumber: '1234567890',
    image: 'base64 encoded image'
  })
})
.then(response => {
  console.log(response.json());
})
.catch(err => {
  console.error(err);
});
PreviousOrders Statistics APINextBlockchain Smart-Contract

Last updated 2 years ago