/turtles (POST)
POST
/turtles
const url = 'https://example.com/api/turtles';const form = new FormData();form.append('image', 'file');form.append('gallery', 'front.png');form.append('gallery', 'back.png');form.append('name', 'example');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/turtles \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form image=@file \ --form gallery=@front.png \ --form gallery=@back.png \ --form name=exampleCreates a new turtle
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Turtle to add
object
image
required
string format: binary
gallery
Array<string>
Example
[ "front.png", "back.png"]name
string
object
id
required
integer format: int64
name
required
Name of the animal
A friendly name for the animal.
string
tag
string
Example
{ "id": 1, "name": "dog", "tag": "pet"}Responses
Section titled “Responses”Animal response
Media typeapplication/json
object
id
required
integer format: int64
name
required
Name of the animal
A friendly name for the animal.
string
tag
string
Example
{ "id": 1, "name": "dog", "tag": "pet"}default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
required
integer format: int32
message
required
string
Examplegenerated
{ "code": 1, "message": "example"}