Skip to main content

User status management

Overview#

This document describes how to check and retrieve the user status from the Android SDK.


Check User Status#

To check the user status, me() from GuardianSdk can be used to call the API.
User status may be one of the following types :
registered user, not registered user, withdrawn user, temporarily suspended user...etc.

Parameter#

  • none

Example#

// Check user statusGuardianSdk.getInstance().me(new GuardianResponseCallback<MeResponse>() {    @Override    public void onSuccess(MeResponse result){        ...    }    @Override    public void onFailed(ErrorResult errorResult) {        Log.e(TAG, "Error code : " + errorResult.getErrorCode());        Log.e(TAG, "Error message : " + errorResult.getErrorMessage());    }});

MeResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message
nameStringname
emailStringemail
uptDtStringUpdate date
phoneNumStringPhone Number

The rtCode will be 0 if the user is properly registered, and the information of that user will come as a data.
However, if that specific user doesn't exist or is a withdrawn user, the result code and message will appear as follows.

ResultCode#

Result CodeDescriptionSolution
2007 or 2008Unregistered user or different mobile device- In case of unregistered user, check sign in status and register if necessary
- If the mobile device has been changed, register new device
5005Unauthorized userContact the person in charge to solve this matter
5006Temporarily suspended userContact the person in charge to solve this matter
5007Permanently suspended userContact the person in charge to solve this matter
5008Withdrawn userUser accounts can be reactivated within a certain period of time

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode