# Request Vc Document Block Addon (requestVcDocumentBlockAddon)

The purpose of this block is to display an interactive button in the interfaceDocumentsSourceBlock.

## Usage <a href="#usage" id="usage"></a>

As shown in the example below, requestVcDocumentBlockAddon blocks should be placed inside interfaceDocumentsSourceBlock blocks.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FyKGRfPSFUmIIgzppXGmC%2Fimage.png?alt=media&#x26;token=4338820e-dce3-4545-8b3a-2cad850297e4" alt=""><figcaption></figcaption></figure>

## Properties

| Property Name                  | Description                                                      | Example                                                                                                                                      | Status |
| ------------------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| Button Name (*buttonName*)     | The label (name) of the button as displayed to the user.         | Add report                                                                                                                                   |        |
| UI Class (*uiClass*)           | The UI class of the button.                                      | "btn-approve”, “btn-reject”, “btn-link                                                                                                       |        |
| hideWhenDiscotinued            | Check if the button should be hidden when policy is discontinued | Checked/Unchecked                                                                                                                            |        |
| Dialog Title (*dialogTitle*)   | The title of the dialog.                                         | Add report                                                                                                                                   |        |
| Schema (*schema*)              | Schema which will be used for document creation.                 | #de62118a-d746-4c9f-ba1a-2278b13a2137                                                                                                        |        |
| Id Type (*idTypev)*            | Type of identifier in document which will be created.            | “UUID”, “DID”, “OWNER”                                                                                                                       |        |
| Preset (*preset*)              | Will selected document be used as preset.                        | true, false                                                                                                                                  |        |
| Preset Schema (*presetSchema*) | Schema which will be used as a preset schema.                    | #de62118a-d746-4c9f-ba1a-2278b13a2137                                                                                                        |        |
| Preset Fields (*presetFields*) | Preset fields configuration.                                     | <p>\[</p><p>{</p><p>"name": "field0",</p><p>"title": "Project Details",</p><p>"value": "field0",</p><p>"readonly": false</p><p>}</p><p>]</p> |        |

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FYsqUviO3LTStMNHkkzqn%2Fimage.png?alt=media&#x26;token=f65c480d-9c00-4dd4-a41f-9d6c70d2b96f" alt=""><figcaption></figcaption></figure>

## Events <a href="#events" id="events"></a>

Request VC document block addon events will be automatically added to document source.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FLSTmSqEHIhG7mHA7HY8I%2Fimage.png?alt=media&#x26;token=f549e22f-a38b-4322-8876-0f11ce58f430" alt=""><figcaption></figcaption></figure>

## API <a href="#api" id="api"></a>

The API for the dropdownBlockAddon has both GET and POST methods:

1\. Example response to the GET request:

```
{
  "id": "20639b5d-c43d-4aa0-a1d1-d0ac36e867de",
  "blockType": "requestVcDocumentBlockAddon",
  "buttonName": "Add Report",
  "uiClass": "link",
  "dialogTitle": "Add Report",
  "presetFields": [
    {
      "name": "field0",
      "title": "Project Details",
      "value": "field0",
      "readonly": false
    },
	...
  ],
  "schema": {
    ...
  },
  "idType": "UUID",
  "preset": true,
  "presetSchema": "#de62118a-d746-4c9f-ba1a-2278b13a2137",
}
```

A response to the GET request includes all block settings and:

* schema - Schema document

2. Example payload for the POST request:

```
"document": {
    "field0": "Device",
    "field1": "Organization",
    ...
  },
  "ref": "66ba0cad0edaef237a78b44b"
}
```

* document - Credential subject
* ref - Reference document identifier
