Référence API

Téléverser une image de référence

POST/v1/image-assets

La première et seule partie multipart est file, avec nom de fichier ; JPEG/PNG/WebP non animé, au plus 10 MiB avant et après réencodage.

Authentification et autorisations

Utilisez votre clé GloopAPI actuelle. Les modèles, capacités et autorisations disponibles dépendent de son catalogue et de la documentation du point de terminaison.

Authorization: Bearer $GLOOP_API_KEY

Schémas d'authentification : BearerAuth

Requête

En-têtes de requête

  • Idempotency-KeystringObligatoire

    Conserve l'intention initiale sous la même Key. Après interruption réseau, consultez d'abord la récupération ; aucune répétition aveugle pour un état inconnu.

    Longueur minimale
    1
    Longueur maximale
    191

Corps de requête · multipart/form-data

Type
object
Champs obligatoires
file
Propriétés supplémentaires
false

Corps de requête obligatoire

  • filestringObligatoire

    Unique partie image avec filename ; JPEG/PNG/WebP <=10MiB, non animée.

    Format
    "binary"

Réponses et erreurs

HTTP 200

Image de référence téléversée

application/json

Type
object
Champs obligatoires
idmime_typesize_byteswidthheightexpires_at
  • file_idstringFacultatif

    ID public du fichier hébergé du même compte et de la même Key.

  • idstringObligatoire

    Identifiant public de l'objet, utilisé dans son chemin de détails.

  • mime_typestringObligatoire

    Type MIME du fichier vérifié.

  • size_bytesintegerObligatoire

    Taille du fichier en octets.

  • widthintegerObligatoire

    Largeur de l'image en pixels.

  • heightintegerObligatoire

    Hauteur de l'image en pixels.

  • expires_atintegerObligatoire

    Secondes Unix ; 0 signifie sans expiration fixe. Le téléversement est lié à un fichier hébergé ; lecture avec le même compte et la même Key.

HTTP 400

Champs ou paramètres de requête invalides.

application/json

Type
object
Champs obligatoires
error

HTTP 401

Key absente, invalide, expirée ou révoquée.

application/json

Type
object
Champs obligatoires
error

HTTP 403

Autorisations IP, compte, modèle ou outil insuffisantes.

application/json

Type
object
Champs obligatoires
error

HTTP 404

Objet/capacité indisponible ou fonctionnalité désactivée.

application/json

Type
object
Champs obligatoires
error

HTTP 409

Conflit d'idempotence/devis, objet non prêt ou encore référencé.

application/json

Type
object
Champs obligatoires
error

HTTP 429

Limitation de débit des requêtes/de la file.

application/json

Type
object
Champs obligatoires
error

HTTP 500

Défaillance interne d'authentification ou de stockage des données.

application/json

Type
object
Champs obligatoires
error

HTTP 503

Service, tarification ou stockage indisponible.

application/json

Type
object
Champs obligatoires
error