सामग्री पर जाएँ
CADCAMFUN
दस्तावेज़

दस्तावेज़

उपयोगकर्ताओं

प्रोफ़ाइल, खाता संसाधन, एपीआई कुंजी, टोकन रिकॉर्ड, पासवर्ड और खाता हटाना।

स्वचालित अनुवाद अभी उपलब्ध नहीं है; पाठ अंग्रेज़ी में है और इंटरफ़ेस आपकी भाषा में है। अंग्रेज़ी मूल देखें

प्लेग्राउंड

इन अनुरोधों को अपने स्वयं के चल रहे साइडकार को भेजें। मान इस ब्राउज़र में रहते हैं.

जुड़े नहीं हैं
यह कैसे काम करता है

साइडकार स्टार्टअप पर चुने गए लूपबैक पोर्ट पर सुनता है और इसे प्रिंट करता है ready रेखा; उस यूआरएल का उपयोग करें और CADCAMFUN_TOKEN इसकी शुरुआत की गई थी. अनुरोध सीधे इस पृष्ठ से उस पते पर जाते हैं।

साइडकार CORS हेडर को केवल टौरी मूल और तक भेजता है http://localhost या http://127.0.0.1 किसी भी बंदरगाह पर. होस्ट किए गए दस्तावेज़ों से ब्राउज़र प्रतिक्रिया को अवरुद्ध कर देता है, इसलिए दस्तावेज़ों को स्थानीय रूप से चलाएँ (bun run dev में packages/web) खेल के मैदान का उपयोग करने के लिए, या अनुरोध को कर्ल के रूप में कॉपी करें। वास्तविक डेटा को छुए बिना प्रयोग करने के लिए, साइडकार से शुरुआत करें CADCAMFUN_DATA_DIR एक बेकार निर्देशिका की ओर इशारा किया - देखें एपीआई वॉकथ्रू.

संचालन

18 एंडपॉइंट user समूह, साइडकार के स्वयं से उत्पन्न ओपनएपीआई दस्तावेज़. संरक्षित संचालन लेते हैं Authorization: Bearer $CADCAMFUN_TOKEN; देखना प्रमाणीकरण. व्यवहार और मर्यादा में हैं सबसिस्टम गाइड.

पाना /api/user/profile user.profile
रखना /api/user/profile user.updateProfile
पाना /api/user/stats user.stats
पाना /api/user/components user.components
पाना /api/user/projects user.projects
पाना /api/user/toolpaths user.toolpaths
पाना /api/user/organizations user.organizations
पाना /api/user/api-keys user.apiKeys
डाक /api/user/api-keys user.createApiKey
मिटाना /api/user/api-keys user.revokeApiKey
मिटाना /api/user/delete-account user.deleteAccount
रखना /api/user/password user.password
पाना /api/user/tokens user.tokens
डाक /api/user/tokens user.createToken
पाना /api/user/verify-change user.verifyChange
पाना /api/user/git-profile user.gitProfile
रखना /api/user/git-profile user.updateGitProfile
पाना /api/user/{id} user.byId
3डी में उपयोगकर्ता संचालन कक्षा में खींचें · ज़ूम करने के लिए स्क्रॉल करें · पैन करने के लिए दाईं ओर खींचें
प्रति ऑपरेशन एक ब्लॉक (18), इस पृष्ठ के प्रति संसाधन अनुभाग को स्टैक्ड किया गया है और विधि के अनुसार रंगा गया है: हरा GET, नारंगी POST, नीला PUT, बैंगनी PATCH, लाल DELETE। निर्माण के समय OpenAPI दस्तावेज़ से उत्पन्न।

/api/user/profile

पाना /api/user/profile # user.profile

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/प्रोफ़ाइल प्राप्त करें
{
  "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
  }
}
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/प्रोफ़ाइल प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
रखना /api/user/profile # user.updateProfile

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · मल्टीपार्ट/फॉर्म-डेटा
{
  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
}
जवाब
200 वस्तु 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
उदाहरण लाओ
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
/एपीआई/उपयोगकर्ता/प्रोफ़ाइल डालें
curl --request PUT "${CADCAMFUN_URL}/api/user/profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: multipart/form-data" \
  --data-binary @request-body
इसे अजमाएं

यह ऑपरेशन मल्टीपार्ट/फॉर्म-डेटा लेता है; कर्ल या फ़ेच उदाहरण का उपयोग करें।

/api/user/stats

पाना /api/user/stats # user.stats

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/आँकड़े प्राप्त करें
{
  "projectsCount": 0,
  "drawingsCount": 0,
  "toolpathsCount": 0,
  "componentsCount": 0,
  "totalDesigns": 0,
  "memberSince": "2026-10-15T04:52:06.538Z"
}
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/आँकड़े प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/stats" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/components

पाना /api/user/components # user.components

आवश्यक है Authorization: Bearer <token>.

जवाब
200 सारणी<ऑब्जेक्ट> 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/घटक प्राप्त करें
[]
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/घटक प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/components" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/projects

पाना /api/user/projects # user.projects

आवश्यक है Authorization: Bearer <token>.

जवाब
200 सारणी<ऑब्जेक्ट> application/json
Array<{
  id: string
  name: string
  description: string | null
  createdAt: string
  updatedAt: string
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/प्रोजेक्ट प्राप्त करें
[]
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/प्रोजेक्ट प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/projects" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/toolpaths

पाना /api/user/toolpaths # user.toolpaths

आवश्यक है Authorization: Bearer <token>.

जवाब
200 सारणी<ऑब्जेक्ट> 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/टूलपाथ प्राप्त करें
[]
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/टूलपाथ प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/toolpaths" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/organizations

पाना /api/user/organizations # user.organizations

आवश्यक है Authorization: Bearer <token>.

जवाब
200 सारणी<ऑब्जेक्ट> 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/संगठन प्राप्त करें
[]
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/संगठन प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/organizations" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/api-keys

पाना /api/user/api-keys # user.apiKeys

आवश्यक है Authorization: Bearer <token>.

जवाब
200 सारणी<ऑब्जेक्ट> 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/api/user/api-कुंजियाँ प्राप्त करें
[]
एसडीके उदाहरण
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
/api/user/api-कुंजियाँ प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/user/api-keys # user.createApiKey

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  name?: unknown | null
}
जवाब
201 वस्तु application/json
{
  message: string
  apiKey: string
  name: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
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
पोस्ट/एपीआई/उपयोगकर्ता/एपीआई-कुंजियाँ
curl --request POST "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं
मिटाना /api/user/api-keys # user.revokeApiKey

आवश्यक है Authorization: Bearer <token>.

पैरामीटर
नाममेंप्रकारआवश्यक
keyId सवाल डोरी | null वैकल्पिक
जवाब
200 वस्तु application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
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
/api/user/api-कुंजियाँ हटाएँ
curl --request DELETE "${CADCAMFUN_URL}/api/user/api-keys" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/delete-account

मिटाना /api/user/delete-account # user.deleteAccount

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
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
हटाएं /एपीआई/उपयोगकर्ता/हटाएं-खाता
curl --request DELETE "${CADCAMFUN_URL}/api/user/delete-account" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/password

रखना /api/user/password # user.password

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  currentPassword?: string | null
  newPassword?: string | null
}
जवाब
200 वस्तु application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
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
/एपीआई/यूजर/पासवर्ड डालें
curl --request PUT "${CADCAMFUN_URL}/api/user/password" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/user/tokens

पाना /api/user/tokens # user.tokens

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु 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
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/उपयोगकर्ता/टोकन प्राप्त करें
{
  "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
    }
  ]
}
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/टोकन प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/tokens" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/user/tokens # user.createToken

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  name?: string | null
  permissions?: unknown | null
  expiresIn?: number | "Infinity" | "-Infinity" | "NaN" | null
}
जवाब
201 वस्तु 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
एसडीके उदाहरण
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
पोस्ट/एपीआई/उपयोगकर्ता/टोकन
curl --request POST "${CADCAMFUN_URL}/api/user/tokens" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/user/verify-change

पाना /api/user/verify-change # user.verifyChange

आवश्यक है Authorization: Bearer <token>.

पैरामीटर
नाममेंप्रकारआवश्यक
टोकन सवाल डोरी | null वैकल्पिक
प्रकार सवाल डोरी | null वैकल्पिक
पासवर्ड सवाल डोरी | null वैकल्पिक
जवाब
200 वस्तु application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 400
/एपीआई/उपयोगकर्ता/सत्यापित-परिवर्तन प्राप्त करें
{
  "_tag": "BadRequest",
  "message": "Token and verification type are required"
}
एसडीके उदाहरण
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
/एपीआई/उपयोगकर्ता/सत्यापित-परिवर्तन प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/verify-change" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/user/git-profile

पाना /api/user/git-profile # user.gitProfile

आवश्यक है Authorization: Bearer <token>.

जवाब
200 वस्तु application/json
{
  name: string
  email: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण लाओ
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
/api/user/git-प्रोफ़ाइल प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/user/git-profile" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
रखना /api/user/git-profile # user.updateGitProfile

आवश्यक है Authorization: Bearer <token>.

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  name: string
  email: string
}
जवाब
200 वस्तु 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
उदाहरण लाओ
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
/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
इसे अजमाएं

/api/user

पाना /api/user/{id} # user.byId

आवश्यक है Authorization: Bearer <token>.

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
जवाब
200 वस्तु 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
एसडीके उदाहरण
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
प्राप्त करें /एपीआई/उपयोगकर्ता/{id}
curl --request GET "${CADCAMFUN_URL}/api/user/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

स्कीमा

नामित स्कीमा इस समूह के मापदंडों, निकायों और प्रतिक्रियाओं से पहुंच योग्य हैं। ए ? एक वैकल्पिक फ़ील्ड चिह्नित करता है; | null उस फ़ील्ड को चिह्नित करता है जो शून्य मान के साथ मौजूद हो सकता है।

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
}

इस समूह को कॉल किया जा रहा है

ऑपरेशन आईडी का फॉर्म है user.<name>. जनरेट किया गया प्रॉमिस SDK (@cadcamfun/api/sdk) उनमें से अधिकांश को इस रूप में उजागर करता है client.<namespace>.<method>(input), कहाँ input पथ पैरामीटर और बॉडी फ़ील्ड की एक सपाट वस्तु है; प्रत्येक कार्ड का एसडीके उदाहरण सटीक एक्सेसर और इनपुट प्रकार दिखाता है। मल्टीपार्ट अपलोड, बाइनरी या जावास्क्रिप्ट प्रतिक्रियाएँ और कच्चे वेबहुक उत्पन्न नहीं होते हैं; वे कार्ड दिखाते हैं fetch इसके बजाय.

प्रॉमिस एसडीके से त्रुटियाँ
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
  }
}

समस्या निवारण

लक्षणसंभावित कारणहल करना
हर कॉल पर 401पिछले लॉन्च से टोकन, या गायब Bearer उपसर्गभेजना Authorization: Bearer <token> टोकन के साथ साइडकार की शुरुआत की गई।
कुछ होने से पहले 400बॉडी या पैरामीटर स्कीमा से मेल नहीं खाताकार्ड पर अनुरोध स्कीमा के साथ पेलोड की तुलना करें।
कहीं और दिखने वाले रिकॉर्ड पर 403 या 404एक्टिंग अकाउंट अलग हैसही भेजो x-session-token, या उस स्थानीय प्रोफ़ाइल का उपयोग करें जो रिकॉर्ड का स्वामी है।
409विरोधाभासी स्थिति, जैसे डुप्लिकेट नाम या पुराना शाखा प्रमुखसंसाधन को दोबारा पढ़ें और वर्तमान डेटा के साथ पुनः प्रयास करें।
कोशिश करें यह कहता है "सीओआरएस द्वारा अवरुद्ध"दस्तावेज़ गैर-लूपबैक मूल से परोसे जाते हैंदस्तावेज़ों को स्थानीय रूप से चलाएँ या अनुरोध को कर्ल के रूप में कॉपी करें।
कनेक्शन नहीं हो सकासाइडकार एक नए बंदरगाह पर फिर से शुरू हुईनए से पोर्ट पढ़ें ready पंक्ति.