Cloud Storage

Amazon S3

To allow our servers to save files on an Amazon S3 storage, follow these instructions:

  • This is a list of permissions required:
    • s3:GetObject
    • s3:PutObject
      • Used to store a file
    • s3:PutObjectAcl
      • Used to grant different Access Control List (ACL) values when storing a file

Below you can find a list with the fields that are accepted in this output target:

FieldDescriptionRequiredDefault
output_target.typeSpecifies the type of the output target, in this case amazons3.YesN/A
output_target.parameters.bucketDetermines to which bucket our servers upload the file.YesN/A
output_target.parameters.regionIndicates the region configured for your bucket. A list of Amazon S3 region names can be found here. If you don't specify this field and your bucket is configured to use another region than the default, any download will fail.Noeu-central-1
output_target.parameters.fileAmazon S3 key of the object that will be stored. Usually looks like a normal file path, e.g. pictures/mountains.jpg.YesN/A
output_target.credentials.accesskeyidThe Amazon S3 access key ID.YesN/A
output_target.credentials.secretaccesskeyThe Amazon S3 secret access key.YesN/A
output_target.credentials.sessiontokenTogether with secretaccesskey and accesskeyid, this is used to authenticate using temporary credentials. For more information on how to generate temporary credentials please check how to install AWS CLI tool and how to do a call to AWS STS get-session-token.NoN/A

Once the needed permission to store files into an Amazon S3 bucket have been set up, the request can be issued.

POST /jobs HTTP/1.1
Host: api2.online-convert.com
x-oc-api-key: <your API key here>
Content-Type: application/json
Cache-Control: no-cache

{
    "input": [{
        "type": "remote",
        "source": "https://static.online-convert.com/example-file/raster%20image/jpg/example_small.jpg"
    }],
    "conversion": [{
        "category": "image",
        "target": "png",
        "output_target": [{
            "type": "amazons3",
            "parameters": {
                "bucket": "oc-bucket",
                "file": "test.png"
            },
            "credentials": {
                "accesskeyid": "your access key id",
                "secretaccesskey": "your secret access key"
            }
        }]
    }]
}
curl -X POST \
  https://api2.online-convert.com/jobs \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'x-oc-api-key: <your API key here>' \
  -d '{
    "input": [{
      "type": "remote",
      "source": "https://static.online-convert.com/example-file/raster%20image/jpg/example_small.jpg"
    }],
    "conversion": [{
      "category": "image",
      "target": "png",
      "output_target": [{
          "type": "amazons3",
          "parameters": {
              "bucket": "oc-bucket",
              "file": "test.png"
          },
          "credentials": {
              "accesskeyid": "your access key id",
              "secretaccesskey": "your secret access key"
          }
      }]
    }]
}'

results matching ""

    No results matching ""