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

दस्तावेज़

टूलपाथ

सहेजे गए मशीनिंग कार्यक्रम, ड्राइंग एसोसिएशन और मान्य पोर्टेबल विनिर्माण दस्तावेज़।

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

प्लेग्राउंड

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

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

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

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

संचालन

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

पाना /api/toolpaths toolpaths.list
डाक /api/toolpaths toolpaths.create
पाना /api/toolpaths/{id} toolpaths.get
रखना /api/toolpaths/{id} toolpaths.update
मिटाना /api/toolpaths/{id} toolpaths.remove
पाना /api/toolpaths/{id}/setup-sheet toolpaths.setupSheet
डाक /api/toolpaths/post-check toolpaths.postCheck
पाना /api/drawings/{id}/toolpaths toolpaths.listForDrawing
डाक /api/drawings/{id}/toolpaths toolpaths.createForDrawing
3डी में टूलपाथ संचालन कक्षा में खींचें · ज़ूम करने के लिए स्क्रॉल करें · पैन करने के लिए दाईं ओर खींचें
प्रति ऑपरेशन एक ब्लॉक (9), इस पृष्ठ के प्रति संसाधन अनुभाग को स्टैक्ड किया गया है और विधि के अनुसार रंगा गया है: हरा GET, नारंगी POST, नीला PUT, बैंगनी PATCH, लाल DELETE। निर्माण के समय OpenAPI दस्तावेज़ से उत्पन्न।

/api/toolpaths

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

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

पैरामीटर
नाममेंप्रकारआवश्यक
projectId सवाल डोरी | null वैकल्पिक
प्रकार सवाल डोरी | null वैकल्पिक
operationType सवाल डोरी | null वैकल्पिक
खोज सवाल डोरी | null वैकल्पिक
जनता सवाल डोरी | null वैकल्पिक
जवाब
200 सारणी<ऑब्जेक्ट> application/json
Array<{
  id: string
  name: string
  description: string | null
  data: unknown
  type: string | null
  operationType: string | null
  gcode: string | null
  thumbnail: string | null
  isPublic: boolean
  projectId: string
  createdAt: string
  updatedAt: string
  createdBy: string
  drawingId: string | null
  materialId: string | null
  toolId: string | null
  machineConfigId: string | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
/एपीआई/टूलपाथ प्राप्त करें
[]
एसडीके उदाहरण
toolpaths.list
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsListInput
const result = await client.toolpaths.list({})
curl
/एपीआई/टूलपाथ प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/toolpaths" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/toolpaths # toolpaths.create

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

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  name?: string | null
  description?: string | null
  data?: unknown | null
  gcode?: string | null
  projectId?: string | null
  type?: string | null
  operationType?: string | null
  isPublic?: boolean | null
  thumbnail?: string | null
  materialId?: string | null
  machineConfigId?: string | null
  toolId?: string | null
  simulation?: unknown | null
  baseUpdatedAt?: string | null
}
जवाब
201 वस्तु application/json
{
  id: string
  name: string
  description: string | null
  data: unknown
  type: string | null
  operationType: string | null
  gcode: string | null
  thumbnail: string | null
  isPublic: boolean
  projectId: string
  createdAt: string
  updatedAt: string
  createdBy: string
  drawingId: string | null
  materialId: string | null
  toolId: string | null
  machineConfigId: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
toolpaths.create
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsCreateInput
const result = await client.toolpaths.create({
  name: "",
  description: "",
  data: null,
  gcode: "",
  projectId: "",
  type: "",
  operationType: "",
  isPublic: false,
  thumbnail: "",
  materialId: "",
  machineConfigId: "",
  toolId: "",
  simulation: null,
  baseUpdatedAt: ""
})
curl
पोस्ट/एपीआई/टूलपाथ
curl --request POST "${CADCAMFUN_URL}/api/toolpaths" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं
पाना /api/toolpaths/{id} # toolpaths.get

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

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
जवाब
200 वस्तु application/json
{
  id: string
  name: string
  description: string | null
  data: unknown
  type: string | null
  operationType: string | null
  gcode: string | null
  thumbnail: string | null
  isPublic: boolean
  projectId: string
  createdAt: string
  updatedAt: string
  createdBy: string
  drawingId: string | null
  materialId: string | null
  toolId: string | null
  machineConfigId: string | null
  project: {
    id: string
    name: string
    ownerId: string
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
toolpaths.get
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsGetInput
const result = await client.toolpaths.get({
  id: "<id>"
})
curl
प्राप्त करें /api/toolpaths/{id}
curl --request GET "${CADCAMFUN_URL}/api/toolpaths/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
रखना /api/toolpaths/{id} # toolpaths.update

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

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  name?: string | null
  description?: string | null
  data?: unknown | null
  gcode?: string | null
  projectId?: string | null
  type?: string | null
  operationType?: string | null
  isPublic?: boolean | null
  thumbnail?: string | null
  materialId?: string | null
  machineConfigId?: string | null
  toolId?: string | null
  simulation?: unknown | null
  baseUpdatedAt?: string | null
}
जवाब
200 वस्तु application/json
{
  id: string
  name: string
  description: string | null
  data: unknown
  type: string | null
  operationType: string | null
  gcode: string | null
  thumbnail: string | null
  isPublic: boolean
  projectId: string
  createdAt: string
  updatedAt: string
  createdBy: string
  drawingId: string | null
  materialId: string | null
  toolId: string | null
  machineConfigId: string | null
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
toolpaths.update
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsUpdateInput
const result = await client.toolpaths.update({
  id: "<id>",
  name: "",
  description: "",
  data: null,
  gcode: "",
  projectId: "",
  type: "",
  operationType: "",
  isPublic: false,
  thumbnail: "",
  materialId: "",
  machineConfigId: "",
  toolId: "",
  simulation: null,
  baseUpdatedAt: ""
})
curl
/api/toolpaths/{id} डालें
curl --request PUT "${CADCAMFUN_URL}/api/toolpaths/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं
मिटाना /api/toolpaths/{id} # toolpaths.remove

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

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
जवाब
200 वस्तु application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
toolpaths.remove
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsRemoveInput
const result = await client.toolpaths.remove({
  id: "<id>"
})
curl
हटाएँ /api/toolpaths/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/toolpaths/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
पाना /api/toolpaths/{id}/setup-sheet # toolpaths.setupSheet

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

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
जवाब
200 वस्तु application/json
{
  data: {
    title: string
    jobId: string
    release: "blocked" | "preview" | "verified-program"
    material: {
      name: string
      iso: string
    }
    machine: {
      name: string
      post: string
    }
    setup: {
      orientation: string
      workOffset: string
      origin: {
        x: number
        y: number
        z: number
      }
      stock: {
        x: number
        y: number
        z: number
      }
    }
    tools: Array<{
      number: number
      id: string
      name: string
      kind: string
      diameter: number
      flutes: number
      fluteLength: number
      shankDiameter: number
      stickout: number
      holder?: string
      operations: string[]
      seconds: number
    }>
    operations: Array<{
      index: number
      id: string
      name: string
      strategy: string
      status: "ok" | "failed"
      tool?: number
      seconds: number
      cutLength: number
      removedVolume: number
      rpm?: number
      feed?: number
      ap?: number
      ae?: number
      warnings: string[]
    }>
    totals: {
      tools: number
      operations: number
      cycleSeconds: number
      cuttingSeconds: number
      removedVolume: number
    }
    claims: Array<{
      id: string
      status: string
      detail: string
    }>
    notes: string[]
    issues: Array<{
      severity: string
      message: string
    }>
    identity: {
      job: string
      part: string
      nc: string
      algorithm: string
    }
    titleBlock?: {
      [key: string]: string | number
    }
  }
  html: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण लाओ
toolpaths.setupSheet
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/toolpaths/${id}/setup-sheet`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
/एपीआई/टूलपाथ/{id}/सेटअप-शीट प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/toolpaths/<id>/setup-sheet" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं

/api/toolpaths/post-check

डाक /api/toolpaths/post-check # toolpaths.postCheck

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

अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  definition: unknown
  sample?: boolean
}
जवाब
200 वस्तु application/json
{
  valid: boolean
  issues: Array<{
    path: string
    message: string
  }>
  sample?: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण लाओ
toolpaths.postCheck
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/toolpaths/post-check`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
पोस्ट/एपीआई/टूलपाथ/पोस्ट-चेक
curl --request POST "${CADCAMFUN_URL}/api/toolpaths/post-check" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

/api/drawings

पाना /api/drawings/{id}/toolpaths # toolpaths.listForDrawing

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

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
जवाब
200 सारणी<ऑब्जेक्ट> application/json
Array<{
  id: string
  name: string
  description: string | null
  data: unknown
  type: string | null
  operationType: string | null
  gcode: string | null
  thumbnail: string | null
  isPublic: boolean
  projectId: string
  createdAt: string
  updatedAt: string
  createdBy: string
  drawingId: string | null
  materialId: string | null
  toolId: string | null
  machineConfigId: string | null
  Material: {
    id: string
    name: string
  } | null
  MachineConfig: {
    id: string
    name: string
    type: string
  } | null
  Tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
  } | null
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
toolpaths.listForDrawing
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsListForDrawingInput
const result = await client.toolpaths.listForDrawing({
  id: "<id>"
})
curl
/एपीआई/ड्राइंग/{id}/टूलपाथ प्राप्त करें
curl --request GET "${CADCAMFUN_URL}/api/drawings/<id>/toolpaths" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
इसे अजमाएं
डाक /api/drawings/{id}/toolpaths # toolpaths.createForDrawing

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

पैरामीटर
नाममेंप्रकारआवश्यक
पहचान पथ डोरी आवश्यक
अनुरोध का मुख्य भाग · आवश्यक · एप्लिकेशन/जेसन
{
  name?: string | null
  description?: string | null
  data?: unknown | null
  gcode?: string | null
  projectId?: string | null
  type?: string | null
  operationType?: string | null
  isPublic?: boolean | null
  thumbnail?: string | null
  materialId?: string | null
  machineConfigId?: string | null
  toolId?: string | null
  simulation?: unknown | null
  baseUpdatedAt?: string | null
}
जवाब
201 वस्तु application/json
{
  id: string
  name: string
  description: string | null
  data: unknown
  type: string | null
  operationType: string | null
  gcode: string | null
  thumbnail: string | null
  isPublic: boolean
  projectId: string
  createdAt: string
  updatedAt: string
  createdBy: string
  drawingId: string | null
  materialId: string | null
  toolId: string | null
  machineConfigId: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
toolpaths.createForDrawing
import { CadCam } from "@cadcamfun/api/sdk"

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

// ToolpathsCreateForDrawingInput
const result = await client.toolpaths.createForDrawing({
  id: "<id>",
  name: "",
  description: "",
  data: null,
  gcode: "",
  projectId: "",
  type: "",
  operationType: "",
  isPublic: false,
  thumbnail: "",
  materialId: "",
  machineConfigId: "",
  toolId: "",
  simulation: null,
  baseUpdatedAt: ""
})
curl
पोस्ट /एपीआई/ड्राइंग/{id}/टूलपाथ
curl --request POST "${CADCAMFUN_URL}/api/drawings/<id>/toolpaths" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
इसे अजमाएं

स्कीमा

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

BadRequestEncoded
{
  _tag: "BadRequest"
  message: string
}
ConflictEncoded
{
  _tag: "Conflict"
  message: string
}
ForbiddenEncoded
{
  _tag: "Forbidden"
  message: string
}
InternalErrorEncoded
{
  _tag: "InternalError"
  message: string
}
NotFoundEncoded
{
  _tag: "NotFound"
  message: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

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

ऑपरेशन आईडी का फॉर्म है toolpaths.<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 पंक्ति.