Diamond Careers
APIExemples

Exemples cURL

Exemples cURL prêts à copier-coller : authentification, gestion d'offres, candidatures, articles, médias.

Cette page rassemble des exemples cURL pour les principaux cas d'usage. Tous supposent que vous avez déjà un jeton API (voir Authentification).

export DIAMOND_BASE="https://api.diamondcareers.fr/diamond/v1"
export DIAMOND_TOKEN="<votre-jeton>"

Authentification

Obtenir un jeton

curl -X POST "$DIAMOND_BASE/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "integration@votre-etablissement.com",
    "password": "VotreMotDePasseTechnique"
  }'

Vérifier le jeton

curl "$DIAMOND_BASE/auth/me" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Établissement

Récupérer votre fiche

curl "$DIAMOND_BASE/maisons/87" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Mettre à jour quelques champs

curl -X PATCH "$DIAMOND_BASE/maisons/87" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "meta": {
      "description": "Notre maison rénove totalement son espace bien-être en 2026.",
      "website": "https://nouveau-site.example.fr"
    }
  }'

Offres

Lister vos offres publiées

curl "$DIAMOND_BASE/offres?status=publish&per_page=100" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Lister les offres modifiées depuis une date

curl "$DIAMOND_BASE/offres?filter[modified_after]=2026-05-01T00:00:00Z&per_page=100" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Créer une offre

curl -X POST "$DIAMOND_BASE/offres" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Chef de partie pâtisserie — restaurant gastronomique",
    "meta": {
      "contract_type": "cdi",
      "city": "Paris",
      "country": "France",
      "salary_min": 32000,
      "salary_max": 38000,
      "salary_display": "32 000 € – 38 000 €",
      "description": "<p>Au sein d une brigade de 18 personnes...</p>",
      "missions": "<ul><li>Encadrer 4 commis</li><li>Élaborer les desserts à l assiette</li></ul>",
      "profile_required": "<p>3 ans d expérience minimum, étoilé idéalement.</p>",
      "start_date": "2026-09-01"
    }
  }'

L'offre est créée au statut pending et passe en validation interne avant publication.

Mettre à jour une offre

curl -X PATCH "$DIAMOND_BASE/offres/4128" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "meta": {
      "salary_min": 34000,
      "salary_max": 40000,
      "salary_display": "34 000 € – 40 000 €"
    }
  }'

Marquer une offre comme pourvue

curl -X PATCH "$DIAMOND_BASE/offres/4128" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "status": "filled" }'

Supprimer une offre

curl -X DELETE "$DIAMOND_BASE/offres/4128" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Candidatures

Lister les candidatures reçues

curl "$DIAMOND_BASE/candidatures?per_page=50" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Filtrer par offre

curl "$DIAMOND_BASE/candidatures?offer_id=4128" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Filtrer par statut

curl "$DIAMOND_BASE/candidatures?status=pending" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Faire évoluer le statut d'une candidature

curl -X PATCH "$DIAMOND_BASE/candidatures/18472/status" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "interview",
    "comment": "Entretien prévu le 18 mai à 14 h."
  }'

Articles

Lister vos articles

curl "$DIAMOND_BASE/articles?per_page=20" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Soumettre un article

curl -X POST "$DIAMOND_BASE/articles" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Coulisses de notre nouvelle cave",
    "content": "<p>Notre chef sommelier...</p>",
    "meta": {
      "excerpt": "Plongée dans la nouvelle cave climatisée de notre maison.",
      "category": "coulisses",
      "reading_time": 4,
      "tags": ["sommellerie", "coulisses"]
    }
  }'

L'article est créé au statut pending et passe en validation éditoriale.

Médias

Téléverser une image publique (logo, visuel d'offre, image d'article)

curl -X POST "$DIAMOND_BASE/upload" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -F "file=@/chemin/vers/photo.jpg"

Téléverser un fichier privé (CV reçu)

curl -X POST "$DIAMOND_BASE/secure-upload" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -F "file=@/chemin/vers/cv.pdf" \
  -F "kind=cv"

Récupérer un fichier privé

curl "$DIAMOND_BASE/secure-file?path=cv/123/uuid.pdf" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  --output ./cv-telecharge.pdf

Équipe

Lister les membres gestionnaires

curl "$DIAMOND_BASE/etablissement/members" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Inviter un membre (rôle owner uniquement)

curl -X POST "$DIAMOND_BASE/etablissement/members" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "recruteur@votre-etablissement.com",
    "role": "editor",
    "first_name": "Camille",
    "last_name": "Durand"
  }'

Modifier le rôle d'un membre

curl -X PATCH "$DIAMOND_BASE/etablissement/members/9281" \
  -H "Authorization: Bearer $DIAMOND_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "role": "owner" }'

Taxonomies

Récupérer les catégories métier

curl "$DIAMOND_BASE/taxonomies/job_category" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Groupe (compte de rôle groupe)

Lister les maisons rattachées

curl "$DIAMOND_BASE/groupes/15/maisons" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Vue agrégée des candidatures

curl "$DIAMOND_BASE/groupes/15/candidatures?per_page=100" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Statistiques agrégées

curl "$DIAMOND_BASE/groupes/15/stats" \
  -H "Authorization: Bearer $DIAMOND_TOKEN"

Session de test rapide

#!/bin/bash
set -e

export DIAMOND_BASE="https://api.diamondcareers.fr/diamond/v1"

# 1. Récupérer un jeton
TOKEN=$(curl -s -X POST "$DIAMOND_BASE/auth/login" \
  -H "Content-Type: application/json" \
  -d "{\"email\":\"$DIAMOND_USER\",\"password\":\"$DIAMOND_PASS\"}" | jq -r .token)

# 2. Vérifier le profil
curl -s "$DIAMOND_BASE/auth/me" \
  -H "Authorization: Bearer $TOKEN" | jq

# 3. Lister vos 5 dernières offres
curl -s "$DIAMOND_BASE/offres?per_page=5&orderby=modified&order=desc" \
  -H "Authorization: Bearer $TOKEN" | jq '.[] | {id, title, status}'

On this page