---
title: API endpoints
slug: th/user-guides/api-endpoints
description: ค้นพบวิดเจ็ตภายในของเราที่ช่วยให้การสื่อสารกับ API มีประสิทธิภาพ แชร์สเปก API กับสมาชิกในทีมหรือกับลูกค้าได้อย่างง่ายดาย รวมถึงคำอธิบายโดยละเอียดของ URL พารามิเตอร์ คุกกี้ โครงสร้างคำขอ และโครงสร้างการตอบกลับ สำรวจตัวอย่างโค้ดใน 
createdAt: 2019-08-16T16:37:43.000Z
---

เรายังตระหนักด้วยว่าไม่ใช่ทุกบริษัทจะมีการให้บริการ API ที่เป็นมาตรฐาน ดังนั้นเราจึงสร้างวิดเจ็ตภายในขึ้นมาเพื่อให้คุณสามารถอธิบายให้ทีมของคุณหรือให้ลูกค้าทราบได้ว่า API ของคุณมีลักษณะอย่างไร

นอกจากนี้ยังมีประโยชน์มากเมื่อทำงานร่วมกับทีมภายนอก ซึ่งคุณจำเป็นต้องสื่อสารสเปกของ API และแทนที่จะให้ไฟล์ JSON คุณสามารถให้เอกสารที่มีวิดเจ็ตนี้และให้มันอธิบายทุกอย่างตั้งแต่ URL, พารามิเตอร์, คุกกี้, โครงสร้างคำขอ, โครงสร้างการตอบกลับ เป็นต้น

คุณสามารถเพิ่มวิดเจ็ตได้โดยพิมพ์ `(api)` ในตัวแก้ไขหรือคลิกไอคอน API ในแถวใหม่

***

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.cakes.com/v1/cakes/:id",
  "name": "Cakes API",
  "method": "POST",
  "request": {
    "pathParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID of the cake to get, \n for free of course."
      }
    ],
    "queryParameters": [
      {
        "kind": "required",
        "name": "recipe",
        "type": "string",
        "description": "The API will do its best to find \n a cake matching the provided recipe."
      },
      {
        "kind": "required",
        "name": "gluten",
        "type": "boolean",
        "description": "Whether the cake should be \n gluten-free or not."
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "X-Auth-Token",
        "type": "string",
        "description": "Authentication token to track \n down who is emptying our stocks."
      }
    ],
    "formDataParameters": [],
    "bodyDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "mNZW47TKMdx5VBY_A7w-y",
        "code": "{\n    \"name\": \"Cake's name\",\n    \"recipe\": \"Cake's recipe name\",\n    \"cake\": \"Binary cake\"\n}",
        "language": "200"
      },
      {
        "id": "4txTa0_LO1TWO7FOVvFjj",
        "code": "{\n    \"message\": \"Ain't no cake like that.\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "mNZW47TKMdx5VBY_A7w-y"
  },
  "examples": {
    "languages": [
      {
        "id": "5x2tfkoh7utDmGpv45DOA",
        "code": "fetch(\"https://api.cakes.com/v1/cakes/:id\", {\n  \"method\": \"POST\",\n  \"headers\": {\n    \"Accept\": \"application/json\"\n  }\n})\n.then(response => {\n  console.log(response);\n})\n.catch(err => {\n  console.error(err);\n});",
        "language": "javascript"
      },
      {
        "id": "sDqk0BbLTuvGBkZUjLsSv",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://api.cakes.com/v1/cakes/:id';\nlet options = {\n  method: 'POST', \nheaders: {\n    Accept: 'application/json',\n  }\n};\nfetch(url, options)\n  .then(res => res.json())\n  .then(json => console.log(json))\n  .catch(err => console.error('error:' + err));",
        "language": "nodejs"
      },
      {
        "id": "G4ZGYdLoiDVDuj2yhZVt6",
        "code": "curl --request POST\n  --url https://api.cakes.com/v1/cakes/:id \n  --header 'Accept: application/json'",
        "language": "curl"
      },
      {
        "id": "s6TUVImaWbitxzfW9NgLm",
        "code": "import requests\n\nurl = \"https://api.cakes.com/v1/cakes/:id\"\nheaders = {\"Accept\": \"application/json\"}\nresponse = requests.request(\"GET\", url, headers=headers)\nprint(response.text)",
        "language": "python"
      },
      {
        "id": "AWzqoYUXp7zqI-QoObWAZ",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://api.cakes.com/v1/cakes/:id';\nlet options = {method: 'POST', headers: {Accept: 'application/json'}};\nfetch(url, options)\n  .then(res => res.json())\n  .then(json => console.log(json))\n  .catch(err => console.error('error:' + err));",
        "language": "ruby"
      }
    ],
    "selectedLanguageId": "5x2tfkoh7utDmGpv45DOA"
  },
  "responses": [
    {
      "statusCode": 200,
      "description": "Cake successfully retrieved.",
      "jsonExample": "{\n    \"name\": \"Cake's name\",\n    \"recipe\": \"Cake's recipe name\",\n    \"cake\": \"Binary cake\"\n}"
    },
    {
      "statusCode": 404,
      "description": "Could not find a cake matching this query.",
      "jsonExample": "{\n    \"message\": \"Ain't no cake like that.\"\n}"
    }
  ],
  "description": "This endpoint allows you to obtain free cakes.",
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": true,
  "autoGeneratedAnchorSlug": "cakes-api",
  "legacyHash": "uR6Ob1_8v48ocI1ix7eYI"
}
```
:::

***

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.cakes.com",
  "name": "Add Cake",
  "method": "PUT",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID of the cake to get"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "ujXlls271GisHxHhB4Vuq",
        "code": "",
        "language": "100"
      },
      {
        "id": "yJFwqLNqQZ1CqWmbDWVSV",
        "code": "{\n    \"name\": \"Cake's name\",\n}",
        "language": "200"
      },
      {
        "id": "veFsTjk4UScAb9yR7AK6Y",
        "code": "{\n    \"message\": \"Ain't no cake like that.\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "ujXlls271GisHxHhB4Vuq"
  },
  "examples": {
    "languages": [
      {
        "id": "a7SyxH465CLSN6X0xbe4g",
        "code": "fetch(\"https://api.cakes.com\", {\n  \"method\": \"GET\",\n  \"headers\": {\n    \"Accept\": \"application/json\"\n  }\n})\n.then(response => {\n  console.log(response);\n})\n.catch(err => {\n  console.error(err);\n});",
        "language": "javascript"
      },
      {
        "id": "48WTucfgCh18gcuyiTY-h",
        "code": "A simple text.",
        "language": "none"
      }
    ],
    "selectedLanguageId": "a7SyxH465CLSN6X0xbe4g"
  },
  "description": "Add a new cake",
  "currentNewParameter": {
    "label": "พารามิเตอร์ของเนื้อหา",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": true,
  "autoGeneratedAnchorSlug": "add-cake",
  "legacyHash": "ZeFKbNEVwtwvB6gFp8448"
}
```
:::

มันมีความยืดหยุ่นสูงมาก ช่วยให้ทีมของคุณอธิบายในรายละเอียดเกี่ยวกับเอ็นด์พอยต์ HTTP ได้ทุกประเภท

เรายังกำลังพัฒนาให้สามารถโต้ตอบได้ ดังนั้นลูกค้าของคุณจะสามารถส่งคำร้องขอจากที่นี่ได้จริง

***

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-C1IcmVcG0rx4ZLHX6X7V7-20250911-192557.png"}
:FontAwesome[]{icon="fa-solid fa-cubes"} &#x20;**&#x20;ค้นหาบล็อกอื่นๆ**

ค้นพบวิธีและบล็อกใหม่ๆ เพื่อสร้างหน้าเอกสารที่สวยงามและใช้งานได้ดี.

[ดูบล็อกทั้งหมด](docId\:fvbccw7nLvGJbcHvBvBG9)&#x20;
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-YRyGGWKsNS1ZZJa5XJy0z-20250911-192608.png"}
:FontAwesome[]{icon="fa-solid fa-headset"}**&#x20; ต้องการความช่วยเหลือ?  ⬇️**

ใช้ **ฟองแชทสีน้ำเงิน** **ที่มุมขวาล่าง** เพื่อรับความช่วยเหลือ.

หรือใช้ **AI Chat** (จากช่องค้นหา) เพื่อรับคำตอบอย่างรวดเร็ว.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-MS_ubDHlXgoktt4svD2rL-20250911-192619.png"}
:FontAwesome[]{icon="fa-solid fa-hand-holding-heart"}**&#x20;  ความเห็นของคุณสำคัญ**

ใช้แบบฟอร์มความคิดเห็นด้านล่างได้แบบไม่ระบุตัวตน.

หรือถามคำถามใน **ส่วนถาม-ตอบ** แล้วทีมของเราหรือ AI จะให้คำตอบแก่คุณ.
:::
::::

