Users API Doc

Users API

@Authentication

@PostNewUser

POST http://users-api.xiot.cloud/v1/auth/signup

Create a new user

Request Body

Name
Type
Description

email

string

firstName

string

min:3,max:50, Arabic or English chars only.

lastName

string

min:3,max50, Arabic or English chars only

password

string

min:8

passwordConfirmation

string

Must be same as password

{
  "statusCode": 200,
  "message": "[email protected] account created successfully",
  "id": "9b65fbdd-b71c-492f-b285-d95e2a83ffc6"
}

Request Example.

@PostLogin

POST http://users-api.xiot.cloud/v1/auth/login

Request Body

Name
Type
Description

email

string

password

string

@VerifyTOTP

POST http://users-api.xiot.cloud/v1/auth/verify-totp

Only if the two factor authenticated is enabled

Request Body

Name
Type
Description

loginCode

string

code sent back from login api

code

string

code comes form two factor authentication APP ex: google authenticator

@Profile

@GetUserProfile

GET http://users-api.xiot.cloud/v1/profile

Headers

Name
Type
Description

authorization

string

send bearer access token

@UpdateProfile

PUT http://users-api.xiot.cloud/v1/profile

Headers

Name
Type
Description

authorization

string

Request Body

Name
Type
Description

phone

string

valid egp phone number

lastName

string

min:3,max:50,valid english and arabic letters

firstName

string

min:3,max:50,vaild english and arabic letters

@Security

@ChangePassword

PUT http://users-api.xiot.cloud/v1/security/change-password

Change logged in user's password

Headers

Name
Type
Description

authorization

string

Bearer Token

Request Body

Name
Type
Description

oldPassword

string

password

string

passwordConfirmation

string

@ForgetPassword

POST http://users-api.xiot.cloud/v1/security/forget-password

Request Body

Name
Type
Description

email

string

Valid Email Format - Required - Exists

@EnableTwoFactorAuth

POST http://users-api.xiot.cloud/v1/security/twofactor-enable

Headers

Name
Type
Description

authorization

string

Bearer Token

@DisableTwoFactorAuth

POST http://users-api.xiot.cloud/v1/security/twofactor-disable

Headers

Name
Type
Description

authorization

string

Bearer Token

@Account

@ChangeEmail

PUT http://users-api.xiot.cloud/v1/account/change-email

Headers

Name
Type
Description

authorization

string

Bearer Token

Request Body

Name
Type
Description

email

string

Unique - valid email format

Last updated

Was this helpful?