EDITOR
...
API docs blocks
API endpoints
4 min
we also recognize that not all companies provide standardized apis, so we built an in house widget to let you describe to your team or customers what your api looks like additionally, it's super useful when working together with external teams, where you need to communicate an api specification, and instead of providing a json file, you provide a document with this widget, and let it describe anything from url, parameters, cookies, request structure, response structure, etc you can add one by typing (api) in the editor or clicking the api icon in a new row { "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" } } { "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" "body parameter", "value" "bodydataparameters" } } it's very flexible letting your team describe in detail any type of http endpoint we're also working on making it interactive, so your customers can actually make the request from here find other blocks discover new ways and blocks to create stunning and functional documentation pages editor blocks docid 6b0vtqtvunmp93e szq2p need help? ⬇️ use the blue chat bubble from bottom right corner or try ai chat (from search box) for quick answers your opinion matters use the below feedback form, anonymously or ask a question in q\&a section and our team or ai will give you a solution
🤔
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.