Aller au contenu
CADCAMFUN
Docs

Documentation

Utilisateurs

Profils, ressources de compte, clés API, enregistrements de jetons, mots de passe et suppression de compte.

Traduit automatiquement de l'anglais. Voir l'original en anglais

Playground

Envoyez ces demandes à votre propre sidecar en cours d’exécution. Les valeurs restent dans ce navigateur.

Non connecté
Comment ça marche

Le sidecar écoute sur un port de bouclage choisi au démarrage et l'imprime dans son ready doubler; utilisez cette URL et le CADCAMFUN_TOKEN ça a commencé avec. Les demandes vont directement de cette page à cette adresse.

Le sidecar envoie les en-têtes CORS uniquement aux origines Tauri et à http://localhost ou http://127.0.0.1 sur n'importe quel port. À partir des documents hébergés, le navigateur bloque la réponse, exécutez donc les documents localement (bun run dev dans packages/web) pour utiliser le terrain de jeu, ou copiez la requête sous forme curl. Pour expérimenter sans toucher aux données réelles, démarrez le sidecar avec CADCAMFUN_DATA_DIR pointé vers un répertoire jetable — voir la procédure pas à pas de l'API.

Opérations

18 endpoints dans le user groupe, généré à partir du propre sidecar Document OpenAPI. Les opérations protégées prennent Authorization: Bearer $CADCAMFUN_TOKEN; voir authentification. Le comportement et les limites sont en place le guide du sous-système.

obtenir /api/user/profile user.profile
mettre /api/user/profile user.updateProfile
obtenir /api/user/stats user.stats
obtenir /api/user/components user.components
obtenir /api/user/projects user.projects
obtenir /api/user/toolpaths user.toolpaths
obtenir /api/user/organizations user.organizations
obtenir /api/user/api-keys user.apiKeys
poste /api/user/api-keys user.createApiKey
supprimer /api/user/api-keys user.revokeApiKey
supprimer /api/user/delete-account user.deleteAccount
mettre /api/user/password user.password
obtenir /api/user/tokens user.tokens
poste /api/user/tokens user.createToken
obtenir /api/user/verify-change user.verifyChange
obtenir /api/user/git-profile user.gitProfile
mettre /api/user/git-profile user.updateGitProfile
obtenir /api/user/{id} user.byId
Opérations des utilisateurs en 3D Faites glisser vers l'orbite · faites défiler pour zoomer · faites glisser vers la droite pour effectuer un panoramique
Un bloc par opération (18), empilé par section de ressources de cette page et coloré par méthode : vert GET, orange POST, bleu PUT, violet PATCH, rouge DELETE. Généré à partir du document OpenAPI au moment de la construction.

/api/user/profile

obtenir /api/user/profile # user.profile

Nécessite Authorization: Bearer <token>.

Réponses
200 objet application/json
{
  id: string
  name: string | null
  email: string | null
  image: string | null
  bio: string | null
  location: string | null
  website: string | null
  company: string | null
  title: string | null
  publicProfile: boolean
  showEmail: boolean
  createdAt: string
  _count: {
    projects: number | "Infinity" | "-Infinity" | "NaN"
  }
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 200
OBTENIR /api/utilisateur/profil
{
  "id": "c942817d-0162-4291-84ff-77321d387acc",
  "name": "Local user",
  "email": "local@cadcamfun.local",
  "image": null,
  "bio": null,
  "location": null,
  "website": null,
  "company": null,
  "title": null,
  "publicProfile": true,
  "showEmail": false,
  "createdAt": "2026-10-15T04:52:06.538Z",
  "_count": {
    "projects": 0
  }
}
Exemple de SDK
user.profile
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.profile()
curl
OBTENIR /api/utilisateur/profil
curl --request GET "${CADCAMFUN_URL}/api/user/profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le
mettre /api/user/profile # user.updateProfile

Nécessite Authorization: Bearer <token>.

Corps de la demande · requis · multipart/form-data
{
  name?: string | null
  bio?: string | null
  location?: string | null
  website?: string | null
  company?: string | null
  title?: string | null
  publicProfile?: string | null
  showEmail?: string | null
  profileImage?: string[] | null
}
Réponses
200 objet application/json
{
  message: string
  user: {
    id: string
    name: string | null
    email: string | null
    image: string | null
    bio: string | null
    location: string | null
    website: string | null
    company: string | null
    title: string | null
    publicProfile: boolean
    showEmail: boolean
    updatedAt: string
  }
  name: string | null
  email: string | null
  image: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
récupérer un exemple
user.updateProfile
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/profile`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
METTRE /api/utilisateur/profil
curl --request PUT "${CADCAMFUN_URL}/api/user/profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: multipart/form-data" \
  --data-binary @request-body
Essayez-le

Cette opération prend des données multipart/form-data ; utilisez l'exemple curl ou fetch.

/api/user/stats

obtenir /api/user/stats # user.stats

Nécessite Authorization: Bearer <token>.

Réponses
200 objet application/json
{
  projectsCount: number | "Infinity" | "-Infinity" | "NaN"
  drawingsCount: number | "Infinity" | "-Infinity" | "NaN"
  toolpathsCount: number | "Infinity" | "-Infinity" | "NaN"
  componentsCount: number | "Infinity" | "-Infinity" | "NaN"
  totalDesigns: number | "Infinity" | "-Infinity" | "NaN"
  memberSince: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
Exemple de réponse capturé · 200
OBTENIR /api/user/stats
{
  "projectsCount": 0,
  "drawingsCount": 0,
  "toolpathsCount": 0,
  "componentsCount": 0,
  "totalDesigns": 0,
  "memberSince": "2026-10-15T04:52:06.538Z"
}
Exemple de SDK
user.stats
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.stats()
curl
OBTENIR /api/user/stats
curl --request GET "${CADCAMFUN_URL}/api/user/stats" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/components

obtenir /api/user/components # user.components

Nécessite Authorization: Bearer <token>.

Réponses
200 Tableau<objet> application/json
Array<{
  id: string
  name: string
  description: string | null
  createdAt: string
  updatedAt: string
  thumbnail: string | null
  projectId: string | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 200
OBTENIR /api/user/composants
[]
Exemple de SDK
user.components
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.components()
curl
OBTENIR /api/user/composants
curl --request GET "${CADCAMFUN_URL}/api/user/components" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/projects

obtenir /api/user/projects # user.projects

Nécessite Authorization: Bearer <token>.

Réponses
200 Tableau<objet> application/json
Array<{
  id: string
  name: string
  description: string | null
  createdAt: string
  updatedAt: string
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 200
GET /api/user/projets
[]
Exemple de SDK
user.projects
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.projects()
curl
GET /api/user/projets
curl --request GET "${CADCAMFUN_URL}/api/user/projects" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/toolpaths

obtenir /api/user/toolpaths # user.toolpaths

Nécessite Authorization: Bearer <token>.

Réponses
200 Tableau<objet> application/json
Array<{
  id: string
  name: string
  description: string | null
  createdAt: string
  updatedAt: string
  thumbnail: string | null
  projectId: string | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 200
GET /api/user/toolpaths
[]
Exemple de SDK
user.toolpaths
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.toolpaths()
curl
GET /api/user/toolpaths
curl --request GET "${CADCAMFUN_URL}/api/user/toolpaths" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/organizations

obtenir /api/user/organizations # user.organizations

Nécessite Authorization: Bearer <token>.

Réponses
200 Tableau<objet> application/json
Array<{
  id: string
  name: string
  description: string | null
  createdAt: string
  updatedAt: string
  role: string
  userCount: number | "Infinity" | "-Infinity" | "NaN"
  projectCount: number | "Infinity" | "-Infinity" | "NaN"
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 200
GET /api/user/organisations
[]
Exemple de SDK
user.organizations
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.organizations()
curl
GET /api/user/organisations
curl --request GET "${CADCAMFUN_URL}/api/user/organizations" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/api-keys

obtenir /api/user/api-keys # user.apiKeys

Nécessite Authorization: Bearer <token>.

Réponses
200 Tableau<objet> application/json
Array<{
  id: string
  name: string
  createdAt: string
  lastUsed: string | null
  expiresAt: string | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 200
OBTENIR /api/user/api-keys
[]
Exemple de SDK
user.apiKeys
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.apiKeys()
curl
OBTENIR /api/user/api-keys
curl --request GET "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le
poste /api/user/api-keys # user.createApiKey

Nécessite Authorization: Bearer <token>.

Corps de la requête · requis · application/json
{
  name?: unknown | null
}
Réponses
201 objet application/json
{
  message: string
  apiKey: string
  name: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de SDK
user.createApiKey
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// UserCreateApiKeyInput
const result = await client.user.createApiKey({
  name: null
})
curl
POST /api/user/api-keys
curl --request POST "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Essayez-le
supprimer /api/user/api-keys # user.revokeApiKey

Nécessite Authorization: Bearer <token>.

Paramètres
NomDansTaperRequis
keyId requête chaîne | null facultatif
Réponses
200 objet application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de SDK
user.revokeApiKey
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// UserRevokeApiKeyInput
const result = await client.user.revokeApiKey({})
curl
SUPPRIMER /api/user/api-keys
curl --request DELETE "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/delete-account

supprimer /api/user/delete-account # user.deleteAccount

Nécessite Authorization: Bearer <token>.

Réponses
200 objet application/json
{
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de SDK
user.deleteAccount
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.deleteAccount()
curl
SUPPRIMER /api/user/delete-compte
curl --request DELETE "${CADCAMFUN_URL}/api/user/delete-account" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/password

mettre /api/user/password # user.password

Nécessite Authorization: Bearer <token>.

Corps de la requête · requis · application/json
{
  currentPassword?: string | null
  newPassword?: string | null
}
Réponses
200 objet application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de SDK
user.password
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// UserPasswordInput
const result = await client.user.password({
  currentPassword: "",
  newPassword: ""
})
curl
METTRE /api/utilisateur/mot de passe
curl --request PUT "${CADCAMFUN_URL}/api/user/password" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Essayez-le

/api/user/tokens

obtenir /api/user/tokens # user.tokens

Nécessite Authorization: Bearer <token>.

Réponses
200 objet application/json
{
  tokens: Array<{
    id: string
    name: string
    prefix: string
    permissions: string[]
    createdAt: string
    lastUsed?: string | null
    expiresAt?: string | null
    isActive: boolean
  }>
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
Exemple de réponse capturé · 200
OBTENIR /api/user/jetons
{
  "tokens": [
    {
      "id": "token-1",
      "name": "Development Token",
      "prefix": "cad_dev_abc123",
      "permissions": [
        "read:projects",
        "write:drawings",
        "read:toolpaths"
      ],
      "createdAt": "2026-10-08T04:52:23.364Z",
      "lastUsed": "2026-10-15T03:52:23.364Z",
      "isActive": true
    },
    {
      "id": "token-2",
      "name": "Mobile App Token",
      "prefix": "cad_mobile_xyz789",
      "permissions": [
        "read:projects",
        "write:toolpaths"
      ],
      "createdAt": "2026-10-01T04:52:23.364Z",
      "lastUsed": "2026-10-15T01:52:23.364Z",
      "expiresAt": "2026-11-14T04:52:23.364Z",
      "isActive": true
    },
    {
      "id": "token-3",
      "name": "Analytics Integration",
      "prefix": "cad_analytics_def456",
      "permissions": [
        "read:analytics",
        "read:usage"
      ],
      "createdAt": "2026-09-24T04:52:23.364Z",
      "expiresAt": "2026-10-14T04:52:23.364Z",
      "isActive": false
    }
  ]
}
Exemple de SDK
user.tokens
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// no input
const result = await client.user.tokens()
curl
OBTENIR /api/user/jetons
curl --request GET "${CADCAMFUN_URL}/api/user/tokens" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le
poste /api/user/tokens # user.createToken

Nécessite Authorization: Bearer <token>.

Corps de la requête · requis · application/json
{
  name?: string | null
  permissions?: unknown | null
  expiresIn?: number | "Infinity" | "-Infinity" | "NaN" | null
}
Réponses
201 objet application/json
{
  token: {
    id: string
    name: string
    prefix: string
    permissions: string[]
    createdAt: string
    lastUsed?: string | null
    expiresAt?: string | null
    isActive: boolean
  }
  fullToken: string
}
400 TokenBadRequestEncoded application/json
TokenBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
Exemple de SDK
user.createToken
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// UserCreateTokenInput
const result = await client.user.createToken({
  name: "",
  permissions: null,
  expiresIn: 0
})
curl
POST /api/utilisateur/jetons
curl --request POST "${CADCAMFUN_URL}/api/user/tokens" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Essayez-le

/api/user/verify-change

obtenir /api/user/verify-change # user.verifyChange

Nécessite Authorization: Bearer <token>.

Paramètres
NomDansTaperRequis
jeton requête chaîne | null facultatif
taper requête chaîne | null facultatif
mot de passe requête chaîne | null facultatif
Réponses
200 objet application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de réponse capturé · 400
GET /api/user/verify-change
{
  "_tag": "BadRequest",
  "message": "Token and verification type are required"
}
Exemple de SDK
user.verifyChange
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// UserVerifyChangeInput
const result = await client.user.verifyChange({})
curl
GET /api/user/verify-change
curl --request GET "${CADCAMFUN_URL}/api/user/verify-change" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

/api/user/git-profile

obtenir /api/user/git-profile # user.gitProfile

Nécessite Authorization: Bearer <token>.

Réponses
200 objet application/json
{
  name: string
  email: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
récupérer un exemple
user.gitProfile
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/git-profile`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
OBTENIR /api/user/git-profile
curl --request GET "${CADCAMFUN_URL}/api/user/git-profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le
mettre /api/user/git-profile # user.updateGitProfile

Nécessite Authorization: Bearer <token>.

Corps de la requête · requis · application/json
{
  name: string
  email: string
}
Réponses
200 objet application/json
{
  name: string
  email: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
récupérer un exemple
user.updateGitProfile
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/git-profile`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
PUT /api/user/git-profile
curl --request PUT "${CADCAMFUN_URL}/api/user/git-profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Essayez-le

/api/user

obtenir /api/user/{id} # user.byId

Nécessite Authorization: Bearer <token>.

Paramètres
NomDansTaperRequis
identifiant chemin chaîne requis
Réponses
200 objet application/json
{
  id: string
  name: string | null
  email: string | null
  image: string | null
  createdAt: string
  organizations: Array<{
    id: string
    name: string
    role: string
  }>
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemple de SDK
user.byId
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// UserByIdInput
const result = await client.user.byId({
  id: "<id>"
})
curl
OBTENIR /api/user/{id}
curl --request GET "${CADCAMFUN_URL}/api/user/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Essayez-le

Schémas

Schémas nommés accessibles à partir des paramètres, des corps et des réponses de ce groupe. UN ? marque un champ facultatif ; | null marque un champ qui peut être présent avec une valeur nulle.

BadRequestEncoded
{
  _tag: "BadRequest"
  message: string
}
InternalErrorEncoded
{
  _tag: "InternalError"
  message: string
}
KeyedInternalEncoded
{
  _tag: "KeyedInternal"
  error: string
}
NotFoundEncoded
{
  _tag: "NotFound"
  message: string
}
TokenBadRequestEncoded
{
  _tag: "TokenBadRequest"
  error: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

Appel à ce groupe

Les identifiants d'opération ont la forme user.<name>. Le SDK Promise généré (@cadcamfun/api/sdk) expose la plupart d'entre eux comme client.<namespace>.<method>(input), où input est un objet plat composé de paramètres de chemin et de champs de corps ; L'exemple de SDK de chaque carte montre l'accesseur exact et le type d'entrée. Les téléchargements en plusieurs parties, les réponses binaires ou JavaScript et les webhooks bruts ne sont pas générés ; ces cartes montrent fetch à la place.

Erreurs du SDK Promise
import { CadCam, ClientError } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

try {
  await client.projects.list()
} catch (error) {
  if (error instanceof ClientError) {
    // Transport | UnexpectedStatus | UnsupportedContentType | MalformedResponse | SseEventTooLarge
  } else {
    // a declared error body: switch on error._tag
  }
}

Dépannage

SymptômeCause probableRéparer
401 à chaque appelJeton d'un lancement précédent, ou manquant Bearer préfixeEnvoyer Authorization: Bearer <token> avec le jeton avec lequel le sidecar a été démarré.
400 avant que quoi que ce soit se produiseLe corps ou le paramètre ne correspond pas au schémaComparez la charge utile avec le schéma de demande sur la carte.
403 ou 404 sur un enregistrement visible ailleursLe compte intérimaire diffèreEnvoyez le droit x-session-token, ou utilisez le profil local propriétaire de l'enregistrement.
409État conflictuel, tel qu'un nom en double ou un chef de succursale obsolèteRelisez la ressource et réessayez avec les données actuelles.
Essayez, il est écrit "bloqué par CORS"Les documents sont servis à partir d'une origine sans bouclageExécutez la documentation localement ou copiez la demande en tant que curl.
Connexion rejetéeLe sidecar a redémarré sur un nouveau portLire le port du nouveau ready ligne.