Skip to content

User API

KanaX edited this page Jan 11, 2022 · 10 revisions

users

Version 1.0

Path Table

Method Path Description
GET /users Get All Users
POST /users Create New User
DELETE /users/{userId} Delete User
GET /users/{userId} Get User
PUT /users/{userId} Update User

Reference Table

Name Path Description
User #/components/schemas/User
X-Auth-Token #/components/securitySchemes/X-Auth-Token
X-User-Id #/components/securitySchemes/X-User-Id

Path Details


[GET]/users

  • Summary
    Get All Users

  • Description
    Returns list of all user accounts.

Headers

X-Auth-Token: string
X-User-Id: string

Responses

  • 200 OK

application/json

{
  user: {
    _id: string
    createdAt: string
    services: {
      password: {
        bcrypt: string
      }
      email2fa: {
        enabled: boolean
        changedAt: string
      }
      email: {
[]
      }
      resume: {
[]
      }
    }
[]
    type: string
    status: string
    active: boolean
[]
    name: string
    lastLogin: string
    statusConnection: string
    utcOffset: number
    username: string
    canViewAllInfo: boolean
  }
  success: boolean
}[]
  • parameters undefined

[POST]/users

  • Summary
    Create New User

  • Description
    Create a new user.

Headers

X-Auth-Token: string
X-User-Id: string

RequestBody

  • application/json
{
  email: string
  name: string
  password: string
  username: string
  active: boolean
  bio: string
  nickname: string
  statusText: string
  status: string
[]
  joinDefaultChannels: boolean
  requirePasswordChange: boolean
  setRandomPassword: boolean
  sendWelcomeEmail: boolean
  verified: boolean
  customFields: boolean
}
  • application/xml
{
}
  • multipart/form-data
{
  email: string
  name: string
  password: string
  username: string
  active: boolean
  bio: string
  nickname: string
  statusText: string
[]
  joinDefaultChannels: boolean
  requirePasswordChange: boolean
  setRandomPassword: boolean
  sendWelcomeEmail: boolean
  verified: boolean
  customFields: {
  }
}

Responses

  • 200 User Created

application/json

{
  user: {
    email: string
    name: string
    password: string
    username: string
    active: boolean
    bio: string
    nickname: string
    statusText: string
    roles: {
    }[]
    joinDefaultChannels: boolean
    requirePasswordChange: boolean
    setRandomPassword: boolean
    sendWelcomeEmail: boolean
    verified: boolean
    customFields: {
    }
  }
  success: boolean
}
  • Examples

    • New User Bob Fellow
{
  "value": {
    "id": 12,
    "firstName": "Bob",
    "lastName": "Fellow",
    "email": "bob.fellow@gmail.com",
    "dateOfBirth": "1996-08-24",
    "emailVerified": false,
    "createDate": "2020-11-18"
  }
}

[DELETE]/users/{userId}

  • Summary
    Delete User

  • Description
    Deletes user with the specified userId

Headers

X-Auth-Token: string
X-User-Id: string

Responses

  • 200 OK

application/json

{
  success: boolean
}

[GET]/users/{userId}

  • Summary
    Get User

  • Description
    Returns user with specified userId.

Headers

X-Auth-Token: string
X-User-Id: string

Responses

  • 200 OK

application/json

{
  user: {
    _id: string
    createdAt: string
    services: {
      password: {
        bcrypt: string
      }
      email2fa: {
        enabled: boolean
        changedAt: string
      }
      email: {
[]
      }
      resume: {
[]
      }
    }
[]
    type: string
    status: string
    active: boolean
[]
    name: string
    lastLogin: string
    statusConnection: string
    utcOffset: number
    username: string
    canViewAllInfo: boolean
  }
  success: boolean
}
  • Examples

    • Example
{
  "value": {
    "id": 142,
    "firstName": "Alice",
    "lastName": "Smith",
    "email": "alice.smith@gmail.com",
    "dateOfBirth": "1997-10-31",
    "emailVerified": true,
    "signUpDate": "2019-08-24"
  }
}

[PUT]/users/{userId}

  • Summary
    Update User

  • Description
    Updates user with the specified userId

Headers

X-Auth-Token: string
X-User-Id: string

RequestBody

  • application/json
{
  data: {
    user: {
      _id: string
      createdAt: string
      services: {
        password: {
          bcrypt: string
        }
        email2fa: {
          enabled: boolean
          changedAt: string
        }
        email: {
[]
        }
        resume: {
[]
        }
      }
[]
      type: string
      status: string
      active: boolean
[]
      name: string
      lastLogin: string
      statusConnection: string
      utcOffset: number
      username: string
      canViewAllInfo: boolean
    }
    success: boolean
  }
}

Responses

  • 200 OK

application/json

{
  user: {
    user: {
      _id: string
      createdAt: string
      services: {
        password: {
          bcrypt: string
        }
        email2fa: {
          enabled: boolean
          changedAt: string
        }
        email: {
[]
        }
        resume: {
[]
        }
      }
[]
      type: string
      status: string
      active: boolean
[]
      name: string
      lastLogin: string
      statusConnection: string
      utcOffset: number
      username: string
      canViewAllInfo: boolean
    }
    success: boolean
  }
  success: boolean
}

References

#/components/schemas/User

{
  user: {
    _id: string
    createdAt: string
    services: {
      password: {
        bcrypt: string
      }
      email2fa: {
        enabled: boolean
        changedAt: string
      }
      email: {
[]
      }
      resume: {
[]
      }
    }
[]
    type: string
    status: string
    active: boolean
[]
    name: string
    lastLogin: string
    statusConnection: string
    utcOffset: number
    username: string
    canViewAllInfo: boolean
  }
  success: boolean
}

#/components/securitySchemes/X-Auth-Token

#/components/securitySchemes/X-User-Id