# Attach signature on annotation

`POST /omni/attach-signature-on-annotation`

Base URL: `https://demo-api.incodesmile.com` — Incode demo environment

Attach signature from interview to previously uploaded PDF contracts at all places annotated with text from request,
with desired height on pdf. Annotations must contain text with either preselected values, or alternative can be supplied.
If user wishes to use signature supplied during onboarding, DEFAULT signature type should be used.

Preselected values are: DEFAULT, INITIALS, PATIENTS_SIGNATURE, NON_MEDICAL_SIGNATURE_1, NON_MEDICAL_SIGNATURE_2,
MEDICAL_SIGNATURE_1, MEDICAL_SIGNATURE_2

Endpoint is intended to be used as fluent api. One call to the api gives in responses id of the signed document which
can then be used in the subsequent call to continuously add another signature on a different annotation.

## Path & query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `interviewId` | query | string |  |  |
| `api-version` | header | string | yes |  |

## Request body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contractId` | string | yes | IDs of previously added contract (ID is returned on /add/document?imageType=contract) |
| `signedContractId` | string |  | IDs of previously signed contract (ID is returned as response from the previous /attach/signature/on/annotation) |
| `signatureType` | string |  | One of the preselected values for annotation text Enum: `DEFAULT`, `INITIALS`, `PATIENTS_SIGNATURE`, `NON_MEDICAL_SIGNATURE_1`, `NON_MEDICAL_SIGNATURE_2`, `MEDICAL_SIGNATURE_1`, `MEDICAL_SIGNATURE_2`, `MEDICAL_SIGNATURE_3`, `PATIENTS_SIGNATURE_NAME`, `NON_MEDICAL_SIGNATURE_1_NAME`, `NON_MEDICAL_SIGNATURE_2_NAME`, `MEDICAL_SIGNATURE_1_NAME`, `MEDICAL_SIGNATURE_2_NAME` |
| `alternativeSignatureType` | string |  | If annotation text is none of the preselected values, pass in here the alternative value (signature must be inserted with the alternative value into database as it's signature type) |

## Responses

### 200

OK

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean |  | Flag indicating request passed successfully. |
| `sessionStatus` | string |  | Session status Enum: `Alive`, `Closed`, `Deleted` |
| `additionalInformation` | object |  |  |

```json
{
  "success": true,
  "signedDocumentId": "new signed document ID",
  "signedDocumentURL": "temporary URL to new signed document"
}
```

### 400

Bad Request

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `timestamp` | integer (int64) |  | UTC timestamp in milliseconds |
| `status` | integer (int32) |  | Custom error code or HTTP status code |
| `error` | string |  | HTTP status error |
| `message` | string |  | Custom error message |
| `path` | string |  | Endpoint path |
| `details` | object |  | Custom error details |
