Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Latest commit

 

History

History
126 lines (88 loc) · 1.84 KB

README.md

File metadata and controls

126 lines (88 loc) · 1.84 KB

Data Object

Utilisation de l'API

Récupérer un fichier (téléchargement)

GET /v1/objects/{objectName}

Exemple CURL

curl --location --request GET 'http://localhost:8080/v1/objects/main.jpeg'

Créer un objet

POST /v1/objects/{objectName}

Requête Content-Type: multipart/form-data

curl --location --request POST 'http://localhost:8080/v1/objects/test.png' \
--form 'file=@"/test.pdf"'

Réponse

{
    "success": true,
    "message": "Object created"
}

Update an object

PATCH /v1/objects/{objectName}

Requête Content-Type: multipart/form-data

curl --location --request PATCH 'http://localhost:8080/v1/objects/test.png' \
--form 

Réponse

{
    "success": true,
    "message": "Object created"
}

Delete an object

DELETE /v1/objects/{objectName}

Exemple CURL

curl --location --request DELETE 'http://localhost:8080/v1/objects/test.png'

Réponse

{
    "success": true,
    "message": "Object deleted"
}

Get publish link

GET /v1/objects/{objectName}/link

Exemple CURL

curl --location --request GET 'http://localhost:8080/v1/objects/main.jpeg/link' \
--header 'Content-Type: application/json' \
--data-raw '{
    "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/9/9d/NYC_Montage_2014_4_-_Jleon.jpg",
    "maxLabels": 5,
    "minConfidence": 0.99
}'

Réponse

{
  "url": "https://...",
  "expirationDate": "21-12-2022 08:48:10"
}

Create root object

GET /v1/root-objects/{objectName}

Exemple CURL

curl --location --request POST 'http://localhost:8080/v1/root-objects'

Réponse

{
  "success": true,
  "message": "Root object created"
}

ou

{
  "success": false,
  "message": "Root object already exists"
}