curl -X GET 'https://api.weir.ai/user/profile' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"userId": "user_123456789",
"fullname": "John Doe",
"firstname": "John",
"lastname": "Doe",
"username": "johndoe123",
"email": "[email protected]",
"bio": "Software engineer",
"location": "San Francisco, CA",
"avatar": "https://cdn.weir.ai/avatars/user_123456789.jpg",
"role": "Organization_Admin",
"organizationId": "org_123456789",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-22T15:30:00Z"
},
"message": "Profile retrieved successfully",
"status": "success"
}
Retrieve current user’s profile information
curl -X GET 'https://api.weir.ai/user/profile' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"userId": "user_123456789",
"fullname": "John Doe",
"firstname": "John",
"lastname": "Doe",
"username": "johndoe123",
"email": "[email protected]",
"bio": "Software engineer",
"location": "San Francisco, CA",
"avatar": "https://cdn.weir.ai/avatars/user_123456789.jpg",
"role": "Organization_Admin",
"organizationId": "org_123456789",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-22T15:30:00Z"
},
"message": "Profile retrieved successfully",
"status": "success"
}
curl -X GET 'https://api.weir.ai/user/profile' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"userId": "user_123456789",
"fullname": "John Doe",
"firstname": "John",
"lastname": "Doe",
"username": "johndoe123",
"email": "[email protected]",
"bio": "Software engineer",
"location": "San Francisco, CA",
"avatar": "https://cdn.weir.ai/avatars/user_123456789.jpg",
"role": "Organization_Admin",
"organizationId": "org_123456789",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-22T15:30:00Z"
},
"message": "Profile retrieved successfully",
"status": "success"
}
Show Profile Properties
const getUserProfile = async (accessToken) => {
const response = await fetch('https://api.weir.ai/user/profile', {
headers: {
'Authorization': `Bearer ${accessToken}`,
'x-source': 'console'
}
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
Was this page helpful?