dambel

دمبل

shevron
ورود | ثبت نام

API Docs / users / user resource



User Resource

Represents a user in the system.


Schema

FieldTypeDescription
idintegerUser ID
emailstringUser email address
phonestringUser phone number
usernamestringUsername
first_namestringFirst name
last_namestringLast name
created_atstring (date)Account creation timestamp
referral_codestringUser's referral code
referrer_user_idinteger|nullReferring user ID, if any
heightinteger|nullUser's height in CM
birth_datestring (date)null
rolesarrayList of Role Resource
mediaarrayList of Media Resource
current_subscriptionobject|nullUser Premium Subscription Resource

Example

{
  "id": 123,
  "email": "test@example.com",
  "phone": "+12345678",
  "username": "test_username",
  "first_name": "John",
  "last_name": "Doe",
  "created_at": "1970-01-01 00:00:00",
  "referral_code": "XFER543D4...",
  "referrer_user_id": null,
  "height": 180,
  "birth_date": "1990-01-01",
  "referral_score": 5,
  "roles": [<role resource>, ...],
  "media": [<media resource>, ...],
  "current_subscription": <user premium subscription resource>
}

Referral Score

This number is calculated based on the number of people that this user has invited to the platform + half of their score too.

So if we have a tree like this:

  • User 1
    • User 2
      • User 3

These are gonna be the scores:

  • User 1: 1 + 0.5 (half of 1) = 1.5
  • User 2: 1
  • User 3: 0

The depth has no limit.


Related Resources


footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube