# Request Vc Document Block Addon (requestVcDocumentBlockAddon)

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

## Usage

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

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-53236da452058da0c0821e49563ea7e82d8c6f45%2Fimage%20(683).png?alt=media" 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                                                                                                       |        |
| hideWhenDiscontinued           | 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://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-1ffe44045634ee1d6bedb16c535cb0c799ea3d78%2Fimage%20(684).png?alt=media" alt=""><figcaption></figcaption></figure>

## Events

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

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-633049cb239b56af58108a8033ce6c1b8e08775a%2Fimage%20(685).png?alt=media" alt=""><figcaption></figcaption></figure>

## API

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
