Développeurs

SpécificationOpen API

Définition API lisible par machine au format OpenAPI 3.1. Utilisez-la pour générer des clients, importer dans Postman ou explorer le schéma.

Télécharger

📄
openapi.yaml
Format YAML — 42 Ko. Lisible par l'humain, idéal pour l'édition.

Télécharger YAML
📋
openapi.json
Format JSON — 48 Ko. Idéal pour l'utilisation programmatique.

Télécharger JSON

Importer dans Postman

  1. Ouvrez Postman et cliquez sur Importer en haut à gauche.
  2. Faites glisser et déposez le fichier openapi.yaml ou collez l'URL : https://api.fs.ax/openapi.yaml
  3. Postman génèrera une collection complète avec tous les endpoints, paramètres et exemples de réponses.
  4. Définissez la variable Authorization sur votre clé API et commencez les tests.

Générer un client

Utilisez OpenAPI Generator pour créer un client typé dans 50+ langages :

# Install the generator
npm install -g @openapitools/openapi-generator-cli

# Generate a TypeScript client
openapi-generator-cli generate \
  -i https://api.fs.ax/openapi.yaml \
  -g typescript-fetch \
  -o ./fsax-client

# Generate a Python client
openapi-generator-cli generate \
  -i https://api.fs.ax/openapi.yaml \
  -g python \
  -o ./fsax-python-client

# Generate a Go client
openapi-generator-cli generate \
  -i https://api.fs.ax/openapi.yaml \
  -g go \
  -o ./fsax-go-client

Aperçu de la spécification

Voici un extrait de la spécification :

openapi: "3.1.0"
info:
  title: fs.ax API
  version: "1.0.0"
  description: URL shortener with built-in monetization
  contact:
    email: api@fs.ax
servers:
  - url: https://api.fs.ax/v1
    description: Production
paths:
  /links:
    post:
      summary: Create a short link
      operationId: createLink
      tags: [Links]
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLinkRequest"
      responses:
        "201":
          description: Link created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Link"
Toujours à jour. La spécification est générée automatiquement à partir de notre code source Rust, donc elle correspond toujours exactement à l'API en production.

Besoin d'aide ? Consultez la documentation API ou contactez-nous à api@fs.ax.