API endpoints
3 นาที
เรายังตระหนักด้วยว่าไม่ใช่ทุกบริษัทจะมีการให้บริการ api ที่เป็นมาตรฐาน ดังนั้นเราจึงสร้างวิดเจ็ตภายในขึ้นมาเพื่อให้คุณสามารถอธิบายให้ทีมของคุณหรือให้ลูกค้าทราบได้ว่า api ของคุณมีลักษณะอย่างไร นอกจากนี้ยังมีประโยชน์มากเมื่อทำงานร่วมกับทีมภายนอก ซึ่งคุณจำเป็นต้องสื่อสารสเปกของ api และแทนที่จะให้ไฟล์ json คุณสามารถให้เอกสารที่มีวิดเจ็ตนี้และให้มันอธิบายทุกอย่างตั้งแต่ url, พารามิเตอร์, คุกกี้, โครงสร้างคำขอ, โครงสร้างการตอบกลับ เป็นต้น คุณสามารถเพิ่มวิดเจ็ตได้โดยพิมพ์ (api) ในตัวแก้ไขหรือคลิกไอคอน api ในแถวใหม่ { "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" \[] }, "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" } { "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 ได้ทุกประเภท เรายังกำลังพัฒนาให้สามารถโต้ตอบได้ ดังนั้นลูกค้าของคุณจะสามารถส่งคำร้องขอจากที่นี่ได้จริง ค้นหาบล็อกอื่นๆ ค้นพบวิธีและบล็อกใหม่ๆ เพื่อสร้างหน้าเอกสารที่สวยงามและใช้งานได้ดี ดูบล็อกทั้งหมด docid\ fvbccw7nlvgjbchvbvbg9 ต้องการความช่วยเหลือ? ⬇️ ใช้ ฟองแชทสีน้ำเงิน ที่มุมขวาล่าง เพื่อรับความช่วยเหลือ หรือใช้ ai chat (จากช่องค้นหา) เพื่อรับคำตอบอย่างรวดเร็ว ความเห็นของคุณสำคัญ ใช้แบบฟอร์มความคิดเห็นด้านล่างได้แบบไม่ระบุตัวตน หรือถามคำถามใน ส่วนถาม ตอบ แล้วทีมของเราหรือ ai จะให้คำตอบแก่คุณ
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.
