Endpoint Documentation
5 min
Get Cakes
This endpoint allows you to get free cakes.
POST
https://api.cakes.com/v1/cakes/:id
Path Parameters
- idstringrequiredDescription
Query Parameters
- recipestringrequiredDescription
- glutenbooleanrequiredDescription
Header Parameters
- X-Auth-TokenstringrequiredDescription
curl
curl --request GET
--url https://api.cakes.com/v1/cakes/:id
--header 'Accept: application/json'go
javascript
fetch("https://api.cakes.com/v1/cakes/:id", {
"method": "GET",
"headers": {
"Accept": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});nodejs
const fetch = require('node-fetch');
let url = 'https://api.cakes.com/v1/cakes/:id';
let options = {
method: 'GET',
headers: {
Accept: 'application/json',
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));python
import requests
url = "https://api.cakes.com/v1/cakes/:id"
headers = {"Accept": "application/json"}
response = requests.request("GET", url, headers=headers)
print(response.text)ruby
const fetch = require('node-fetch');
let url = 'https://api.cakes.com/v1/cakes/:id';
let options = {method: 'GET', headers: {Accept: 'application/json'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));202
{
"name": "Cake's name",
"recipe": "Cake's recipe name",
"cake": "Binary cake"
}404
{
"message": "Ain't no cake like that."
}
Get Cakes
Get a cake by its ID
PUT
https://api.cakes.com
Body Parameters
- idstringrequiredDescription
javascript
fetch("https://api.cakes.com", {
"method": "GET",
"headers": {
"Accept": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});200
{
"name": "Cake's name",
}404
{
"message": "Ain't no cake like that."
}
Environments
Dev
Qa
Live
Throttling
Cost per 1000 calls
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.