Puntos finales de la API
4 min
también reconocemos que no todas las empresas ofrecen apis estandarizadas, por lo que creamos un widget interno para permitirte describir a tu equipo o clientes cómo es tu api además, es muy útil cuando se trabaja junto con equipos externos, donde necesitas comunicar una especificación de api, y en lugar de proporcionar un archivo json, proporcionas un documento con este widget y permites que describa cualquier cosa, desde url, parámetros, cookies, estructura de la solicitud, estructura de la respuesta, etc puedes añadir uno escribiendo (api) en el editor o haciendo clic en el ícono de api en una nueva fila { "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" "parámetro del cuerpo", "value" "bodydataparameters" }, "hastryitout" true, "autogeneratedanchorslug" "add cake", "legacyhash" "zefkbnevwtwvb6gfp8448" } es muy flexible y permite que su equipo describa en detalle cualquier tipo de endpoint http también estamos trabajando para hacerlo interactivo, de modo que sus clientes puedan realizar la solicitud desde aquí encontrar otros bloques descubre nuevas formas y bloques para crear páginas de documentación impresionantes y funcionales revisa todos los bloques docid\ g2gqexisue2xnvgu6pwst ¿necesitas ayuda? ⬇️ usa la burbuja de chat azul en la esquina inferior derecha o prueba el chat de ia (desde la barra de búsqueda) para respuestas rápidas tu opinión importa usa el siguiente formulario de comentarios, de forma anónima o haz una pregunta en la sección de preguntas y respuestas y nuestro equipo o la ia te dará una solución
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.
