**Full name**: projects.locations.datasets.consentStores.checkDataAccess

Checks if a particular dataId of a `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.userDataMappings#UserDataMapping` in the specified `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores#ConsentStore` is consented for the specified use.

### HTTP request

`POST https://healthcare.googleapis.com/v1/{consentStore=projects/*/locations/*/datasets/*/consentStores/*}:checkDataAccess`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `consentStore` | `string` Required. Name of the consent store where the requested dataId is stored, of the form `projects/{projectId}/locations/{locationId}/datasets/{datasetId}/consentStores/{consentStoreId}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `consentStore`: - `healthcare.consentStores.checkDataAccess` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "dataId": string, "requestAttributes": { string: string, ... }, "responseView": enum(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores/checkDataAccess#ResponseView`), // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "consentList": { object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/ConsentList`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `dataId` | `string` Required. The unique identifier of the resource to check access for. This identifier must correspond to a User data mapping in the given consent store. |
| `requestAttributes` | `map (key: string, value: string)` The values of request attributes associated with this access request. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `responseView` | ``enum(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores/checkDataAccess#ResponseView`)`` Optional. The view for `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores/checkDataAccess#body.CheckDataAccessResponse`. If unspecified, defaults to `BASIC` and returns `consented` as `TRUE` or `FALSE`. |
| The selection of `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.consents#Consent` to evaluate the access request against. If no selection is specified, the access request is evaluated against all `ACTIVE` unexpired Consents with the same `user_id` as the data to check access for. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `consentList` | ``object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/ConsentList`)`` Optional. Specific `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.consents#Consent` to evaluate the access request against. These Consents must have the same `userId` as the evaluated User data mapping, must exist in the current `consentStore`, and have a `state` of either `ACTIVE` or `DRAFT`. A maximum of 100 Consents can be provided here. If no selection is specified, the access request is evaluated against all `ACTIVE` unexpired Consents with the same `userId` as the evaluated User data mapping. |
| End of mutually exclusive fields. ||

### Response body

Checks if a particular dataId of a `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.userDataMappings#UserDataMapping` in the given `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores#ConsentStore` is consented for a given use.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "consented": boolean, "consentDetails": { string: { object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/ConsentEvaluation`) }, ... } } ``` |

| Fields ||
|---|---|
| `consented` | `boolean` Whether the requested resource is consented for the given use. |
| `consentDetails` | ``map (key: string, value: object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/ConsentEvaluation`))`` The resource names of all evaluated `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores.consents#Consent` mapped to their evaluation. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-healthcare`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## ResponseView

The supported views for `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores/checkDataAccess#body.CheckDataAccessResponse`.

| Enums ||
|---|---|
| `RESPONSE_VIEW_UNSPECIFIED` | No response view specified. The API will default to the BASIC view. |
| `BASIC` | Only the `consented` field is populated in `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores/checkDataAccess#body.CheckDataAccessResponse`. |
| `FULL` | All fields within `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.consentStores/checkDataAccess#body.CheckDataAccessResponse` are populated. When set to `FULL`, all `ACTIVE` Consents are evaluated even if a matching policy is found during evaluation. |