User

Login

Login to the service, if the user is login for the first time, the system will automatically register the account.

Path:

/api/v1/user/login

Method:

Post

Content-type:

Json

Parameters:

  • application <json object> application information

    • id <string> app id

    • secret <string> app secret

  • device <json object> device information used by user

    • type <string> device type. eg: iPhone, android, web, windows

    • id <string> device unique identity string

  • email (optional) <json object> login option - email

    • address <string> email address

    • code <string> login verification code

  • phone (optional) <json object> login option - phone

    • number <string> phone number

    • code <string> login verification code

  • oauth (optional) <json object> login option - third-party login

    • platform <string> which platform user selected, eg: google

    • username <string> username in selected platform

    • token <string> access token given by the selected platform

Response:

  • code <int> response code

  • message <string> response message

  • data <json object> response data

    • user_id <string> user id

    • access_key <string> EDDSA private key, used to sign user's request

Logout

Logout from the service

Path:

/api/v1/user/logout

Method:

Post

Content-type:

Json

Parameters:

  • user_id <string> user id

  • device <json object> login device

    • type <string> device type. eg: iPhone, android, web, windows

    • id <string> device unique identity string

  • access_key <string> key returned by login api

Response:

  • code <int> response code, 0 means success

  • message <string> response message

Last updated