S3 API

For S3 connectors, the API exposes endpoints to read and write files.

Index

Pass a folder path to list the files within.

http request GET https://core.orbitype.com/api/s3/v1?path=blog/posts/

Response:

[
  "blog/posts/alpha.json",
  "blog/posts/bravo.json",
  "blog/posts/charlie.json"
]

Show

Pass a file path to get its body.

http request GET https://core.orbitype.com/api/s3/v1?path=blog/posts/alpha.json

Response:

{
  "title": "Alpha",
  "text": "Lorem ipsum dolor."
}

Store

Create or overwrite a text file by passing a path and body.

Request:

http request PUT https://core.orbitype.com/api/s3/v1

Response:

{
  "path": "blog/posts/neo.json",
  "body": { "title": "Neo", "text": "Another post" }
}

Destroy

Delete a file by passing a path.

http request DELETE https://core.orbitype.com/api/s3/v1
{
"path": "blog/posts/alpha.json"
}

Copy

Copy a file by passing paths for from and to.

http request POST https://core.orbitype.com/api/s3/v1/copy

{
  "from": "blog/posts/alpha.json",
  "to": "blog/posts/alpha-copy.json"
}

Upload

To create a non-text media file, send a multipart/form-data request.

Pass the path as a query param and the file as part of the form request.

http request POST https://core.orbitype.com/api/s3/v1/upload
?path=blog/media/cover.jpg
Content-Type: multipart/form-data
Content-Disposition: form-data; name="file"; filename="cover.jpg"
Content-Type: image/jpeg