Skip to main content

Get User Info

This endpoint allows you to retrieve information about the user associated with the token.

Endpoint

GET: https://api.smart-mfg.net/user

Example Request (Python)

import requests

token = "YOUR_GENERATED_TOKEN"

headers = {
"Authorization": f"Bearer {token}",
"Accept": "application/json"
}

response = requests.get("https://api.smart-mfg.net/user", headers=headers)
print(response.json())

if 200 <= response.status_code < 300:
print("Token is valid!")
else:
print("Failed to authenticate token.")

Example Response (JSON)

  • Response Code: 200 OK: Successful request
  • See below for a description of these values
{
"data": {
"id": 12345,
"name": "Example User",
"email": "example@smart-mfg.net",
"active_company": {
"id": 1,
"name": "Acme Company 1",
"avatar": "https://api.smart-mfg.net/storage/companies/fake-avatar.png"
},
"companies": [
{
"id": 1,
"name": "Acme Company 1",
"avatar": "https://api.smart-mfg.net/storage/companies/fake-avatar.png"
},
{
"id": 2,
"name": "Acme Company 2",
"avatar": "https://api.smart-mfg.net/storage/companies/fake-avatar.png"
}
]
}
}

Values & Description

KeyTypeDescription
dataobjectContains user data
data.idintegerUnique identifier for the user
data.namestringName of the user
data.emailstringEmail address of the user
data.active_companyobjectThis is the last company that was set, and the one the API will return information amount
data.active_company.idintegerUnique identifier for the active company
data.active_company.namestringName of the active company
data.active_company.avatarstring (URL)URL of the active company's avatar image
data.companiesarrayList of all companies associated with the user
data.companies.*.idintegerUnique identifier for a company
data.companies.*.namestringName of a company
data.companies.*.avatarstring (URL)URL of the company's avatar image