# requestAccess(Object object)

Incrementally grant app access

## Support

App capability | Android | iOS | PC | Harmony | Preview
---|---|---|---|---|---
Gadget | V6.9.0+ | V6.9.0+ | V6.9.0+ | V7.35.0+ | Preview
Web app | V6.9.0+ | V6.9.0+ | V6.9.0+ | V7.35.0+ | Preview

## Input
Inherits [standard object input](https://open.feishu.cn/document/uYjL24iN/ukzNy4SO3IjL5cjM), and has the following extension properties:

Name | Data type | Required | Default value | Description
---|---|---|---|---
scopeList | Array<string\> | Yes | \- | Grant the app [scope list](https://open.feishu.cn/document/ukTMukTMukTM/uYTM5UjL2ETO14iNxkTN/scope-list)<br><md-alert><br>- empty array indicates just granting the permission to [Obtain login user information](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/user_info/get).<br>- When incremental permissions are passed in, the user needs to complete authorization before using the application within the Feishu client.
state | string | No | \- | An additional string used to maintain the status of the request and callback. This parameter will be appended when the authorization is completed for the callback. The application can determine the context based on this string. For details, see [Obtain OAuth code](https://open.feishu.cn/document/common-capabilities/sso/api/obtain-oauth-code)
appID | string | No | \- | Application ID (required for web applications)

## Output
Inherits [standard object output](https://open.feishu.cn/document/uYjL24iN/ukzNy4SO3IjL5cjM#8c92acb8), and has the following extension properties:

Name | Data type | Description
---|---|---
code | string | Temporary login credentials, valid period 3 minutes, can only be used once
state | string | An additional string used to maintain the status of the request and callback. This parameter will be appended when the authorization is completed for the callback. The application can determine the context based on this string. For details, see [Obtain OAuth code](https://open.feishu.cn/document/common-capabilities/sso/api/obtain-oauth-code)

## Sample code
```js
tt.requestAccess({
  scopeList: ["contact:contact.base:readonly", "docs_tool:docs_tool"],
  appID: "cli_xxx", // Please ensure that this parameter is included in the web application.
  success(res) {
    console.log(JSON.stringify(res));
  },
  fail(res) {
    console.log(`requestAccess fail: ${JSON.stringify(res)}`);
  },
});
```

Sample return object for `success`:

```json
{
  "errMsg": "requestAccess:ok",
  "code": "1d34ef4fdfdf12332fffd"
}
```

**errno**

For detailed descriptions of Errno error codes and a list of common error codes, see [Errno](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/errno).