POST
/
v3
/
assets
/
training_dataset

This API provides an S3 pre-signed uploading URL for training images.

Request Headers

Content-Type
string
required

Enum: application/json

Authorization
string
required

Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

file_extension
string
required

Enum: png, webp, jpeg

Response

assets_id
integer

The asset ID.

upload_url
string

The S3 pre-signed uploading URL.

method
string

The method for uploading.
Enum: PUT

headers
object

Example

request

curl --location 'https://api.novita.ai/v3/assets/training_dataset' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
  "file_extension": "png"
}'

response

{
  "assets_id": 100024,
  "upload_url": "https://faas-training-dataset.s3.ap-southeast-1.amazonaws.com/test/743567e210ff505ce5502cfb46659c8e.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASVPYCN6LRCW3SOUV%2F20231102%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20231102T060519Z&X-Amz-Expires=120&X-Amz-SignedHeaders=host&x-id=PutObject&X-Amz-Signature=781d2156b707b7cfa87d94fb2836838e114c3afe4588368b9503c618ac125a67",
  "method": "PUT",
  "headers": {
    "Host": {
      "values": ["faas-training-dataset.s3.ap-southeast-1.amazonaws.com"]
    }
  }
}