---
id: S3
sidebar_class_name: S3
---

<img src={require('../../static/img/APIs/S3.png').default} width='64px' />

# AWS S3 (MinIO)

This section covers the library for working with AWS S3 API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.

:::important

**S3** - is a standard used by different software products. This means that the availability of methods, as well as their parameters, may differ depending on what software you are using. MinIO-based object storage is used to develop and test this library

:::

## Getting started

1. Obtain the following authorization data to work with S3:

    + Access key
    + Secret key
    + Region
    + Storage URL
    + Type of service (by default - S3)

2. Pass the received data to the `GetDataStructure` function and get the structure of the basic data

```bsl title="1С:Enterprise/OneScript"

    URL       = "storage-155.s3hoster.by";
    AccessKey = "BRN5RKJE67...";
    SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
    Region    = "BTC";

    BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);

```

```bash title="CLI"

    oint s3 GetBasicDataStructure 
        --url "storage-155.s3hoster.by"
        --access "BRN5RKJE67..."
        --secret "NNhv+i9PrytpT8Tu0C1N..."
        --region "BTC"

```

The obtained structure (or JSON file) should be used to call other methods of work with S3 API (parameter `MainData`) - authorization data and additional settings of requests will be based on it

## Response format

This library uses its own response format to provide data received from the server. It looks as follows:

```json

{
    "status": 200,
    "response": {},
    "headers": {}
}

```

+ The **status** field contains the HTTP response status code 
+ The **response** field contains the body of the original S3 response, previously converted from XML to JSON
+ The **headers** field contains the headers from the original response


The response was modified to JSON to simplify its usage, as the original XML format was more complex to work with
