Pular para o conteúdo
CADCAMFUN
Docs

Documentação

Usuários

Perfis, recursos de conta, chaves de API, registros de token, senhas e remoção de conta.

Traduzido automaticamente do inglês. Ver o original em inglês

Área de testes

Envie essas solicitações para seu próprio sidecar em execução. Os valores permanecem neste navegador.

Não conectado
Como isso funciona

O sidecar escuta em uma porta de loopback escolhida na inicialização e a imprime em seu ready linha; use esse URL e o CADCAMFUN_TOKEN foi iniciado. As solicitações vão direto desta página para esse endereço.

O sidecar envia cabeçalhos CORS apenas para as origens Tauri e para http://localhost ou http://127.0.0.1 em qualquer porto. Nos documentos hospedados, o navegador bloqueia a resposta, então execute os documentos localmente (bun run dev em packages/web) para usar o playground ou copie a solicitação como curl. Para experimentar sem tocar em dados reais, inicie o sidecar com CADCAMFUN_DATA_DIR apontado para um diretório descartável - veja o passo a passo da API.

Operações

18 endpoints no user grupo, gerado a partir do próprio sidecar Documento OpenAPI. As operações protegidas levam Authorization: Bearer $CADCAMFUN_TOKEN; ver autenticação. Comportamento e limites estão em o guia do subsistema.

pegar /api/user/profile user.profile
colocar /api/user/profile user.updateProfile
pegar /api/user/stats user.stats
pegar /api/user/components user.components
pegar /api/user/projects user.projects
pegar /api/user/toolpaths user.toolpaths
pegar /api/user/organizations user.organizations
pegar /api/user/api-keys user.apiKeys
publicar /api/user/api-keys user.createApiKey
excluir /api/user/api-keys user.revokeApiKey
excluir /api/user/delete-account user.deleteAccount
colocar /api/user/password user.password
pegar /api/user/tokens user.tokens
publicar /api/user/tokens user.createToken
pegar /api/user/verify-change user.verifyChange
pegar /api/user/git-profile user.gitProfile
colocar /api/user/git-profile user.updateGitProfile
pegar /api/user/{id} user.byId
Operações de usuários em 3D Arraste para orbitar · role para ampliar · arraste com o botão direito para deslocar
Um bloco por operação (18), empilhado por seção de recursos desta página e colorido por método: verde GET, laranja POST, azul PUT, violeta PATCH, vermelho DELETE. Gerado a partir do documento OpenAPI em tempo de construção.

/api/user/profile

pegar /api/user/profile # user.profile

Requer Authorization: Bearer <token>.

Respostas
200 objeto 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
Resposta de exemplo capturado · 200
GET /api/usuário/perfil
{
  "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
  }
}
Exemplo 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
GET /api/usuário/perfil
curl --request GET "${CADCAMFUN_URL}/api/user/profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente
colocar /api/user/profile # user.updateProfile

Requer Authorization: Bearer <token>.

Corpo da solicitação · obrigatório · 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
}
Respostas
200 objeto 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
buscar exemplo
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
PUT /api/usuário/perfil
curl --request PUT "${CADCAMFUN_URL}/api/user/profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: multipart/form-data" \
  --data-binary @request-body
Experimente

Esta operação utiliza multipart/form-data; use o exemplo curl ou fetch.

/api/user/stats

pegar /api/user/stats # user.stats

Requer Authorization: Bearer <token>.

Respostas
200 objeto 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
Resposta de exemplo capturado · 200
GET /api/usuário/estatísticas
{
  "projectsCount": 0,
  "drawingsCount": 0,
  "toolpathsCount": 0,
  "componentsCount": 0,
  "totalDesigns": 0,
  "memberSince": "2026-10-15T04:52:06.538Z"
}
Exemplo 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
GET /api/usuário/estatísticas
curl --request GET "${CADCAMFUN_URL}/api/user/stats" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

/api/user/components

pegar /api/user/components # user.components

Requer Authorization: Bearer <token>.

Respostas
200 Matriz<objeto> 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
Resposta de exemplo capturado · 200
GET /api/usuário/componentes
[]
Exemplo 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
GET /api/usuário/componentes
curl --request GET "${CADCAMFUN_URL}/api/user/components" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

/api/user/projects

pegar /api/user/projects # user.projects

Requer Authorization: Bearer <token>.

Respostas
200 Matriz<objeto> application/json
Array<{
  id: string
  name: string
  description: string | null
  createdAt: string
  updatedAt: string
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Resposta de exemplo capturado · 200
GET /api/usuário/projetos
[]
Exemplo 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/usuário/projetos
curl --request GET "${CADCAMFUN_URL}/api/user/projects" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

/api/user/toolpaths

pegar /api/user/toolpaths # user.toolpaths

Requer Authorization: Bearer <token>.

Respostas
200 Matriz<objeto> 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
Resposta de exemplo capturado · 200
GET /api/user/toolpaths
[]
Exemplo 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}"
Experimente

/api/user/organizations

pegar /api/user/organizations # user.organizations

Requer Authorization: Bearer <token>.

Respostas
200 Matriz<objeto> 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
Resposta de exemplo capturado · 200
GET /api/usuário/organizações
[]
Exemplo 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/usuário/organizações
curl --request GET "${CADCAMFUN_URL}/api/user/organizations" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

/api/user/api-keys

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

Requer Authorization: Bearer <token>.

Respostas
200 Matriz<objeto> 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
Resposta de exemplo capturado · 200
GET /api/user/api-keys
[]
Exemplo 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
GET /api/user/api-keys
curl --request GET "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente
publicar /api/user/api-keys # user.createApiKey

Requer Authorization: Bearer <token>.

Corpo da solicitação · obrigatório · aplicação/json
{
  name?: unknown | null
}
Respostas
201 objeto application/json
{
  message: string
  apiKey: string
  name: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemplo 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
Experimente
excluir /api/user/api-keys # user.revokeApiKey

Requer Authorization: Bearer <token>.

Parâmetros
NomeEmTipoObrigatório
keyId consulta corda | null opcional
Respostas
200 objeto application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemplo 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
DELETE /api/user/api-keys
curl --request DELETE "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

/api/user/delete-account

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

Requer Authorization: Bearer <token>.

Respostas
200 objeto application/json
{
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemplo 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
DELETE /api/usuário/delete-conta
curl --request DELETE "${CADCAMFUN_URL}/api/user/delete-account" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

/api/user/password

colocar /api/user/password # user.password

Requer Authorization: Bearer <token>.

Corpo da solicitação · obrigatório · aplicação/json
{
  currentPassword?: string | null
  newPassword?: string | null
}
Respostas
200 objeto application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Exemplo 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
COLOQUE /api/usuário/senha
curl --request PUT "${CADCAMFUN_URL}/api/user/password" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Experimente

/api/user/tokens

pegar /api/user/tokens # user.tokens

Requer Authorization: Bearer <token>.

Respostas
200 objeto 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
Resposta de exemplo capturado · 200
OBTER /api/usuário/tokens
{
  "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
    }
  ]
}
Exemplo 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
OBTER /api/usuário/tokens
curl --request GET "${CADCAMFUN_URL}/api/user/tokens" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente
publicar /api/user/tokens # user.createToken

Requer Authorization: Bearer <token>.

Corpo da solicitação · obrigatório · aplicação/json
{
  name?: string | null
  permissions?: unknown | null
  expiresIn?: number | "Infinity" | "-Infinity" | "NaN" | null
}
Respostas
201 objeto 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
Exemplo 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/usuário/tokens
curl --request POST "${CADCAMFUN_URL}/api/user/tokens" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Experimente

/api/user/verify-change

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

Requer Authorization: Bearer <token>.

Parâmetros
NomeEmTipoObrigatório
ficha consulta corda | null opcional
tipo consulta corda | null opcional
senha consulta corda | null opcional
Respostas
200 objeto application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
Resposta de exemplo capturado · 400
GET /api/user/verify-change
{
  "_tag": "BadRequest",
  "message": "Token and verification type are required"
}
Exemplo 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}"
Experimente

/api/user/git-profile

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

Requer Authorization: Bearer <token>.

Respostas
200 objeto application/json
{
  name: string
  email: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
buscar exemplo
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
GET /api/user/git-profile
curl --request GET "${CADCAMFUN_URL}/api/user/git-profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente
colocar /api/user/git-profile # user.updateGitProfile

Requer Authorization: Bearer <token>.

Corpo da solicitação · obrigatório · aplicação/json
{
  name: string
  email: string
}
Respostas
200 objeto 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
buscar exemplo
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
Experimente

/api/user

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

Requer Authorization: Bearer <token>.

Parâmetros
NomeEmTipoObrigatório
eu ia caminho corda obrigatório
Respostas
200 objeto 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
Exemplo 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
GET /api/usuário/{id}
curl --request GET "${CADCAMFUN_URL}/api/user/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Experimente

Esquemas

Esquemas nomeados acessíveis a partir dos parâmetros, corpos e respostas deste grupo. UM ? marca um campo opcional; | null marca um campo que pode estar presente com um valor nulo.

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
}

Chamando este grupo

Os IDs de operação têm o formato user.<name>. O Promise SDK gerado (@cadcamfun/api/sdk) expõe a maioria deles como client.<namespace>.<method>(input), onde input é um objeto plano de parâmetros de caminho e campos de corpo; o exemplo do SDK de cada cartão mostra o acessador e o tipo de entrada exatos. Multipart uploads, respostas binárias ou JavaScript e webhooks brutos não são gerados; essas cartas mostram fetch em vez disso.

Erros do Promise SDK
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
  }
}

Solução de problemas

SintomaCausa provávelConsertar
401 em cada chamadaToken de um lançamento anterior ou ausente Bearer prefixoEnviar Authorization: Bearer <token> com o token com o qual o sidecar foi iniciado.
400 antes que algo aconteçaO corpo ou parâmetro não corresponde ao esquemaCompare a carga útil com o esquema de solicitação no cartão.
403 ou 404 em um registro que você vê em outro lugarA conta atuante difereEnvie o certo x-session-tokenou use o perfil local que possui o registro.
409Estado conflitante, como um nome duplicado ou um cabeçalho de ramificação obsoletoLeia novamente o recurso e tente novamente com os dados atuais.
Tente dizer "bloqueado pelo CORS"Os documentos são veiculados a partir de uma origem sem loopbackExecute os documentos localmente ou copie a solicitação como curl.
Ligação recusadaO sidecar foi reiniciado em uma nova portaLeia a porta do novo ready linha.