# uploadFileToS3

### description

Uploads a file to S3 from a provided URL. This endpoint downloads a file from the specified URL and uploads it to the Buzzy S3 storage associated with a specific resource and field.

### parameters

The `X-Auth-Token` and `X-User-Id` are derived from the values `authToken` and `userId` returned from the login endpoint and are used in the HTTP header.

#### resource

```
{
	"resourceID":"<resource id>",
	"fieldID":"<field id>",
	"url":"<url of file to upload>",
	"filename":"<filename for the upload>"
}
```

### response

Returns the status of the upload operation and the URL of the uploaded file.

### example

```
POST /api/microappchild/uploadFileToS3
X-Auth-Token:<insert token here>
X-User-Id:<insert user id here>

{
	"resourceID":"resource123",
	"fieldID":"field456",
	"url":"https://example.com/document.pdf",
	"filename":"document.pdf"
}
```

You should get back:

```
{
    "status": "success",
    "url": "https://s3.amazonaws.com/bucket/path/to/uploaded-file"
}
```

***
