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

Example Request

Curl
NodeJS
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

Example Requests

Curl
NodeJS
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);
});