Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt

Use this file to discover all available pages before exploring further.

Request access to the user’s basic profile information. This API must be triggered by a button tap — it cannot be called directly on page load.
This API requires the user to tap a <button> component with open-type="getAuthorize" and scope="userInfo". Calling it outside of that interaction will fail. To obtain the userId specifically, use my.getAuthCode instead.

Parameters

PropertyTypeRequiredDescription
successFunctionNoCallback with user info
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Success Callback

All fields return an empty string if the value is unavailable.
PropertyTypeDescription
codeStringResult code
msgStringResult message
avatarStringProfile image URL (max 2048 bytes)
nickNameStringDisplay name (max 128 bytes)
genderStringm for male, f for female
countryCodeStringISO 3166-1 alpha-2 country code (e.g. IT)
provinceStringUser’s province
cityStringUser’s city

Result Codes

CodeMeaning
10000Success
40006Insufficient permissions

Code Example

// In your AXML template:
// <button open-type="getAuthorize" scope="userInfo" onGetAuthorize="onGetAuthorize">Get User Info</button>

onGetAuthorize(res) {
  my.getOpenUserInfo({
    success: (res) => {
      const userInfo = JSON.parse(res.response).response;
      console.log('Nickname:', userInfo.nickName);
      console.log('Avatar:', userInfo.avatar);
    },
    fail: (err) => {
      console.error('Failed to get user info:', err);
    }
  });
}