---
title: Endpoint Documentation
slug: docs/demo/endpoint-documentation
description: Learn how to retrieve cake information using the "Get Cakes" endpoint of the API with this comprehensive document. It includes detailed code examples in popular programming languages and covers various environments such as Dev, Qa, and Live. Discover how 
icon: 🌤️
createdAt: 2019-08-06T08:34:52.000Z
---

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.cakes.com/v1/cakes/:id",
  "name": "Get Cakes ",
  "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": "4Ilti9dKBK8U0eW38WreO",
        "code": "{\n    \"name\": \"Cake's name\",\n    \"recipe\": \"Cake's recipe name\",\n    \"cake\": \"Binary cake\"\n}",
        "language": "202"
      },
      {
        "id": "Evx-t2vWJQOat0auvZIf3",
        "code": "{\n    \"message\": \"Ain't no cake like that.\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "4Ilti9dKBK8U0eW38WreO"
  },
  "examples": {
    "languages": [
      {
        "id": "NohS7eEKx54rU8g3rEOV4",
        "code": "curl --request GET\n  --url https://api.cakes.com/v1/cakes/:id \n  --header 'Accept: application/json'",
        "language": "curl"
      },
      {
        "id": "VFQS7UNLji7AKFZ4TAxVE",
        "code": "",
        "language": "go"
      },
      {
        "id": "LQ04gyMmqwroOgVmjyPxC",
        "code": "fetch(\"https://api.cakes.com/v1/cakes/:id\", {\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": "05Kkw-yE63Ziy_iysxc2s",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://api.cakes.com/v1/cakes/:id';\nlet options = {\n  method: 'GET', \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": "EITbfLha3sNdBwirOFT2l",
        "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": "haxee3uKLAyUwu87IhJSO",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://api.cakes.com/v1/cakes/:id';\nlet options = {method: 'GET', 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": "NohS7eEKx54rU8g3rEOV4"
  },
  "responses": [
    {
      "statusCode": "202",
      "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 get free cakes.",
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-cakes",
  "legacyHash": "51OfL4CMRpXHr8be_6pqE"
}
```
:::



:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.cakes.com",
  "name": "Get Cakes",
  "method": "PUT",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID of the cake to get"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "pNrQsOJvkr6SAuADkXpPq",
        "code": "{\n    \"name\": \"Cake's name\",\n}",
        "language": "200"
      },
      {
        "id": "wkg9fHksbnMQigxe_qLON",
        "code": "{\n    \"message\": \"Ain't no cake like that.\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "pNrQsOJvkr6SAuADkXpPq"
  },
  "examples": {
    "languages": [
      {
        "id": "nDeSYgklPcqTb1Gxv6RRc",
        "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"
      }
    ],
    "selectedLanguageId": "nDeSYgklPcqTb1Gxv6RRc"
  },
  "description": "Get a cake by its ID",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-cakes-1",
  "legacyHash": "2GErm0ucOELTj1LQY9Rno"
}
```
:::







## Environments&#x20;

### Dev

### Qa

### Live

## Throttling

## Cost per 1000 calls





[Realtime Editor with Markdown Shortcuts!](docId\:x_04MEQiLWW4yMHOOMc80)&#x20;

[Sharing Lambda Layers](docId:4UJrxmSxdWgTEd9zWyMWQ)&#x20;

[Changelogs and Callouts](docId:-s8TpoG43TvvdbuZEXoLH)&#x20;

[Changelogs](docId:6PlTlcJH3q6HLS8oG4efx)&#x20;

[Full API Docs with Swagger/OpenAPI](docId\:w0OoEl1oHiEkrHuZQ3FDv)&#x20;

##

