# Lean - uploadAwsId method

If there is a video identification process that stores the evidence on aws, you can use this method to add the awsId reference to the issued disposable.

**For the full technical reference, see the  [OpenAPI specification](/products/leandisposable/openapi/document/uploadawsid)**.

REST API
#### Endpoint


```
POST /api/document/{lraId}/uploadAwsId
```

#### Headers

| Name | Required | Description |
|  --- | --- | --- |
| `Content-Type` | Yes | Must be `application/json`. |
| `Authorization` | Yes | Basic Auth credentials. |


#### Path parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `lraId` | integer | Yes | LRA identifier. |


#### Body parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `deviceCode` | string | Yes | The device code of the issued certificate. |
| `idOtp` | string | Yes | The OTP identification associated to the disposable. |
| `awsId` | string | Yes | AWS identification reference. |
| `externalKey` | string | No | An external key. |


#### Request example


```json
{
    "awsId": "HgI1MM8VuxpoXh6xozcd0gU8rPCvUN6c9HJRY27-K9A2hRm9ZVFFsVx2whuohH63ZQ1jvxZwVG0YaKLwU9ta0B641ReHvfC-eDUz3en_YLwm-2bxnX3cI8RqF96_YVwuJ39VZKB38g",
    "deviceCode": "RHIDP2412063503288",
    "idOtp": "2587763",
    "externalKey": "external_key_sample"
}
```

#### Response examples

**200 — Success**


```
Empty body
```

SOAP API
The SOAP interface is deprecated. Use the REST API instead.

**Method:** uploadAwsId

| **Parameter** | **Description** | **Mandatory** |
|  --- | --- | --- |
| lraid | The LRA identification code | YES |
| deviceCode | The device code of the issued certificate | YES |
| idOtp | The identification of the otp associate to the disposable | YES |
| awsId | aws identification reference | YES |
| extenalKey | an external key | NO |


The main errors that can be found within this method are:

* [Error 242: Input parameter invalid](https://namirial.atlassian.net/wiki/display/TT/How+to+handle+errors#Howtohandleerrors-Error242:Inputparameterinvalid): if the pair deviceCode/idOtp is invalid


#### Request example


```xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.nam/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:uploadAwsId>      
      <lraid>111</lraid>
      <awsId>HgI1MM8VuxpoXh6xozcd0gU8rPCvUN6c9HJRY27-K9A2hRm9ZVFFsVx2whuohH63ZQ1jvxZwVG0YaKLwU9ta0B641ReHvfC-eDUz3en_YLwm-2bxnX3cI8RqF96_YVwuJ39VZKB38g</awsId>
      <deviceCode>RHIDP2311109617618</deviceCode>
      <idOtp>1894746</idOtp>
      <externalKey>external_key_sample</externalKey>
      </ser:uploadAwsId>
   </soapenv:Body>
</soapenv:Envelope>
```

#### Response example


```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <ns2:uploadAwsIdResponse xmlns:ns2="http://service.ws.nam/"/>
    </soap:Body>
</soap:Envelope>
```

#### Error codes

All errors below return HTTP `500`.

| Error code | Description |
|  --- | --- |
| [242](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-242-input-parameter-invalid) | Missing or empty required fields (`awsId`, `deviceCode`) |
| [85](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-85-device-type-missing-or-not-allowed) | The `deviceCode`/`idOtp` pair is invalid or not associated to an issued disposable |


For authentication errors, see [Authentication](/products/leandisposable/enterprise-documentation/developer-documentation/authentication).