दस्तावेज़
प्रमाणीकरण
खाता साइन-इन, साइन-अप, पुनर्प्राप्ति, सत्यापन, जादुई लिंक, सत्र लुकअप और पासकी पंजीकरण।
स्वचालित अनुवाद अभी उपलब्ध नहीं है; पाठ अंग्रेज़ी में है और इंटरफ़ेस आपकी भाषा में है। अंग्रेज़ी मूल देखें
इन अनुरोधों को अपने स्वयं के चल रहे साइडकार को भेजें। मान इस ब्राउज़र में रहते हैं.
यह कैसे काम करता है
साइडकार स्टार्टअप पर चुने गए लूपबैक पोर्ट पर सुनता है और इसे प्रिंट करता है ready रेखा; उस यूआरएल का उपयोग करें और CADCAMFUN_TOKEN इसकी शुरुआत की गई थी. अनुरोध सीधे इस पृष्ठ से उस पते पर जाते हैं।
साइडकार CORS हेडर को केवल टौरी मूल और तक भेजता है http://localhost या http://127.0.0.1 किसी भी बंदरगाह पर. होस्ट किए गए दस्तावेज़ों से ब्राउज़र प्रतिक्रिया को अवरुद्ध कर देता है, इसलिए दस्तावेज़ों को स्थानीय रूप से चलाएँ (bun run dev में packages/web) खेल के मैदान का उपयोग करने के लिए, या अनुरोध को कर्ल के रूप में कॉपी करें। वास्तविक डेटा को छुए बिना प्रयोग करने के लिए, साइडकार से शुरुआत करें CADCAMFUN_DATA_DIR एक बेकार निर्देशिका की ओर इशारा किया - देखें एपीआई वॉकथ्रू.
संचालन
15 एंडपॉइंट auth समूह, साइडकार के स्वयं से उत्पन्न ओपनएपीआई दस्तावेज़. संरक्षित संचालन लेते हैं Authorization: Bearer $CADCAMFUN_TOKEN; देखना प्रमाणीकरण. व्यवहार और मर्यादा में हैं सबसिस्टम गाइड.
| डाक | /api/auth/identity/start | auth.identityStart |
| डाक | /api/auth/identity/poll | auth.identityPoll |
| डाक | /api/auth/identity/cancel | auth.identityCancel |
| डाक | /api/auth/forgot-password | auth.forgotPassword |
| डाक | /api/auth/reset-password | auth.resetPassword |
| डाक | /api/auth/send-magic-link | auth.sendMagicLink |
| डाक | /api/auth/send-verification-email | auth.sendVerificationEmail |
| डाक | /api/auth/verify-email | auth.verifyEmail |
| डाक | /api/auth/signout | auth.signout |
| पाना | /api/auth/get-session | auth.getSession |
| डाक | /api/auth/signin-direct | auth.signinDirect |
| डाक | /api/auth/signup | auth.signup |
| डाक | /api/auth/test-direct-create | auth.testDirectCreate |
| डाक | /api/auth/verify-magic-link | auth.verifyMagicLink |
| डाक | /api/auth/passkey-register | auth.registerPasskey |
/api/auth/identity
auth.identityStart आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ id: string url: string issuer: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
उदाहरण लाओ
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/start`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/start" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
auth.identityPoll आवश्यक है Authorization: Bearer <token>.
{ id: string }
200 वस्तु | वस्तु | वस्तु application/json
{ status: "pending" } | { status: "complete" tokens: { access: string refresh: string expiresAt: number | "Infinity" | "-Infinity" | "NaN" } } | { status: "failed" message: string }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
उदाहरण लाओ
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/poll`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/poll" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
auth.identityCancel आवश्यक है Authorization: Bearer <token>.
{ id: string }
200 वस्तु application/json
{ success: true message: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
उदाहरण लाओ
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/cancel`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/cancel" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/forgot-password
auth.forgotPassword आवश्यक है Authorization: Bearer <token>.
{ email?: string | null callbackURL?: string | null }
200 वस्तु application/json
{ success: true message: string debugResetLink?: string | null }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthForgotPasswordInput
const result = await client.auth.forgotPassword({
email: "",
callbackURL: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/forgot-password" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/reset-password
auth.resetPassword आवश्यक है Authorization: Bearer <token>.
{ token?: string | null newPassword?: string | null confirmPassword?: string | null }
200 वस्तु application/json
{ success: true message: string user: { id: string email: string name: string | null } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthResetPasswordInput
const result = await client.auth.resetPassword({
token: "",
newPassword: "",
confirmPassword: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/reset-password" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/send-magic-link
auth.sendMagicLink आवश्यक है Authorization: Bearer <token>.
{ email?: string | null callbackURL?: string | null }
200 वस्तु application/json
{ success: true message: string debugMagicLink?: string | null }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSendMagicLinkInput
const result = await client.auth.sendMagicLink({
email: "",
callbackURL: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/send-magic-link" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/send-verification-email
auth.sendVerificationEmail आवश्यक है Authorization: Bearer <token>.
{ email?: string | null callbackURL?: string | null }
200 वस्तु application/json
{ success: true message: string debug: { link: string } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSendVerificationEmailInput
const result = await client.auth.sendVerificationEmail({
email: "",
callbackURL: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/send-verification-email" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/verify-email
auth.verifyEmail आवश्यक है Authorization: Bearer <token>.
{ token?: string | null }
200 वस्तु application/json
{ success: true message: string user: { id: string email: string name: string | null emailVerified: string } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthVerifyEmailInput
const result = await client.auth.verifyEmail({
token: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/verify-email" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/signout
auth.signout आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ success: true message: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
एसडीके उदाहरण
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.auth.signout() curl
curl --request POST "${CADCAMFUN_URL}/api/auth/signout" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/auth/get-session
auth.getSession आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ session: { user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string updatedAt: string } expires: string sessionToken?: string | null } }
401 प्रामाणिकअनधिकृतएन्कोडेड | अनधिकृत एन्कोडेड application/json
AuthUnauthorizedEncoded | UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
{
"session": {
"user": {
"id": "c942817d-0162-4291-84ff-77321d387acc",
"email": "local@cadcamfun.local",
"name": "Local user",
"emailVerified": null,
"createdAt": "2026-10-15T04:52:06.538Z",
"updatedAt": "2026-10-15T04:52:06.538Z"
},
"expires": "2026-10-22T04:52:23.311Z"
}
} एसडीके उदाहरण
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.auth.getSession() curl
curl --request GET "${CADCAMFUN_URL}/api/auth/get-session" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/auth/signin-direct
auth.signinDirect आवश्यक है Authorization: Bearer <token>.
{ email?: string | null password?: string | null }
200 वस्तु application/json
{ success: true message: string user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string } token: string }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 प्रामाणिकअनधिकृतएन्कोडेड | अनधिकृत एन्कोडेड application/json
AuthUnauthorizedEncoded | UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSigninDirectInput
const result = await client.auth.signinDirect({
email: "",
password: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/signin-direct" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/signup
auth.signup आवश्यक है Authorization: Bearer <token>.
{ email?: string | null password?: string | null confirmPassword?: string | null name?: string | null }
201 वस्तु application/json
{ success: true message: string user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSignupInput
const result = await client.auth.signup({
email: "",
password: "",
confirmPassword: "",
name: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/signup" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/test-direct-create
auth.testDirectCreate आवश्यक है Authorization: Bearer <token>.
{ email?: string | null password?: string | null name?: string | null }
201 वस्तु application/json
{ success: true message: string user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string } }
400 TestCreateBadRequestEncoded application/json
TestCreateBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 TestCreateFailureEncoded application/json
TestCreateFailureEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthTestDirectCreateInput
const result = await client.auth.testDirectCreate({
email: "",
password: "",
name: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/test-direct-create" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/verify-magic-link
auth.verifyMagicLink आवश्यक है Authorization: Bearer <token>.
{ token?: string | null }
200 वस्तु application/json
{ success: true message: string user: { id: string email: string | null name: string | null } token?: string | null }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthVerifyMagicLinkInput
const result = await client.auth.verifyMagicLink({
token: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/verify-magic-link" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/auth/passkey-register
auth.registerPasskey आवश्यक है Authorization: Bearer <token>.
200 कोई भी JSON मान application/json
unknown 401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
501 PasskeyNotImplementedEncoded application/json
PasskeyNotImplementedEncoded
एसडीके उदाहरण
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.auth.registerPasskey() curl
curl --request POST "${CADCAMFUN_URL}/api/auth/passkey-register" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
स्कीमा
नामित स्कीमा इस समूह के मापदंडों, निकायों और प्रतिक्रियाओं से पहुंच योग्य हैं। ए ? एक वैकल्पिक फ़ील्ड चिह्नित करता है; | null उस फ़ील्ड को चिह्नित करता है जो शून्य मान के साथ मौजूद हो सकता है।
AuthBadRequestEncoded{ _tag: "AuthBadRequest" error: string details: string }
AuthInternalEncoded{ _tag: "AuthInternal" error: string details: string }
AuthNotFoundEncoded{ _tag: "AuthNotFound" error: string details: string }
PasskeyNotImplementedEncoded{ _tag: "PasskeyNotImplemented" error: string details: string todoImplementation: { webauthn: string challengeGeneration: string credentialStorage: string userVerification: string } }
TestCreateBadRequestEncoded{ _tag: "TestCreateBadRequest" error: string }
TestCreateFailureEncoded{ _tag: "TestCreateFailure" error: string message: string }
इस समूह को कॉल किया जा रहा है
ऑपरेशन आईडी का फॉर्म है auth.<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 पंक्ति. |