AWS S3
AWS S3 is used to store arbitrary unstructured data like images, files, backups, etc. Aidbox offers integration with S3 to simplify upload and retrieval of data. All examples from this tutorial are executable in Aidbox REST console.

Setup AwsAccount

Create an instance of AwsAccount that contains access credentials and region settings.
1
PUT /AwsAccount
2
3
id: my-account
4
access-key-id: AKIAIOSFODNN7EXAMPLE
5
secret-access-key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
6
region: us-east-1
Copied!

Get signed URL to upload the data

Provide AwsAccount id as well as the bucket name and get back the signed URL that you can use to upload the data. By default, the link is valid for 24 hours.
1
POST /aws/storage/my-account/aidboxtestbucket
2
3
filename: example.txt
4
5
# status: 200
6
# body:
7
# url: <signed-url>
Copied!
You should use PUT request method with signed URL and provide content data in the request body.
1
PUT <signed-url>
2
3
mysimplefilecontent
4
5
# status: 200
Copied!

Get a signed URL to retrieve the data

1
GET /aws/storage/my-account/aidboxtestbucket/example.txt
2
3
# status: 200
4
# body:
5
# url: <signed-url>
6
7
GET <signed-url>
8
9
# status: 200
10
# body:
11
# mysimplefilecontent
Copied!

Configuration options

You can provide an expiration query parameter which sets X-Amz-Expires query param of signed URL. Expiration time is measured in seconds, e.g. for 12 hours expiration you should provide 43200.
1
GET /aws/storage/my-account/aidboxtestbucket/example.txt?expiration=43200
Copied!
If your implementation requires additional configuration parameters, reach out to us through Aidbox Users community or private support chat.
Copy link
Contents