| title | Cake API v1.2.32 | |||
|---|---|---|---|---|
| language_tabs |
|
|||
| language_clients |
|
|||
| toc_footers | ||||
| includes | ||||
| search | false | |||
| highlight_theme | darkula | |||
| headingLevel | 2 |
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
This is a sample of Cake server created using springdocs - a library for OpenAPI 3 with spring boot.
Base URLs:
License: Apache 2.0
-
HTTP Authentication, scheme: bearer
-
oAuth2 authentication. For more information, see https://api.slack.com/docs/oauth
- Flow: authorizationCode
- Authorization URL = https://slack.com/oauth/authorize
- Token URL = https://slack.com/api/oauth.access
| Scope | Scope Description |
|---|---|
| users:read | Read user information |
| im:read | Read messages |
API with documentation annotations
Code samples
URL obj = new URL("/v1/othercake");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());GET /v1/othercake
Retrieve all cakes from the server, this is very slow operation since all cakes are baked synchronously, so all of them are made according to their preparation time.
Example responses
200 Response
[
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}
]400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | Inline |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Cake] | false | none | none |
| » name | string | true | none | Name of the cake. |
| » prepTimeMin | integer(int32) | false | none | Preparation time in minues. |
| » components | [Ingredient] | true | none | List if ingredients. |
| »» name | string | true | none | none |
| »» quantity | number(double) | true | none | none |
| »» unit | string | true | none | none |
Code samples
URL obj = new URL("/v1/othercake");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());POST /v1/othercake
Yummy yummy yummy!
Body parameter
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | Cake | false | Body of the request should contain cake definition |
Example responses
400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | None |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Code samples
URL obj = new URL("/v1/othercake/{cake}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());GET /v1/othercake/{cake}
Get recipe of particular cake
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cake | path | string | true | cake name to be retrieved from database |
Example responses
200 Response
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | Cake |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Code samples
URL obj = new URL("/v1/othercake/{cake}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());PUT /v1/othercake/{cake}
Update the recipe of particular cake
Body parameter
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | Cake | false | Body of the request should contain cake definition |
Example responses
400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | None |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Code samples
URL obj = new URL("/v1/othercake/{cake}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());DELETE /v1/othercake/{cake}
I don't know why one might want that!
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cake | path | string | true | cake name to be retrieved from database |
Example responses
400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | None |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
API with documentation annotations
Code samples
URL obj = new URL("/v1/cake");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());GET /v1/cake
Retrieve all cakes from the server, this is very slow operation since all cakes are baked synchronously, so all of them are made according to their preparation time.
Example responses
200 Response
[
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}
]400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | Inline |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Cake] | false | none | none |
| » name | string | true | none | Name of the cake. |
| » prepTimeMin | integer(int32) | false | none | Preparation time in minues. |
| » components | [Ingredient] | true | none | List if ingredients. |
| »» name | string | true | none | none |
| »» quantity | number(double) | true | none | none |
| »» unit | string | true | none | none |
Code samples
URL obj = new URL("/v1/cake");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());POST /v1/cake
Yummy yummy yummy!
Body parameter
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | Cake | false | Body of the request should contain cake definition |
Example responses
400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | None |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Code samples
URL obj = new URL("/v1/cake/{cake}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());GET /v1/cake/{cake}
Get recipe of particular cake
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cake | path | string | true | cake name to be retrieved from database |
Example responses
200 Response
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | Cake |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Code samples
URL obj = new URL("/v1/cake/{cake}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());PUT /v1/cake/{cake}
Update the recipe of particular cake
Body parameter
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | Cake | false | Body of the request should contain cake definition |
Example responses
400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | None |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
Code samples
URL obj = new URL("/v1/cake/{cake}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());DELETE /v1/cake/{cake}
I don't know why one might want that!
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cake | path | string | true | cake name to be retrieved from database |
Example responses
400 Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | default response | None |
| 400 | Bad Request | default response | ErrorCodeResponse |
| 404 | Not Found | default response | ErrorCodeResponse |
{
"code": "string",
"message": "string"
}
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| code | string | false | none | none |
| message | string | false | none | none |
{
"name": "cheese cake",
"prepTimeMin": 60,
"components": [
{
"name": "string",
"quantity": 0,
"unit": "string"
}
]
}
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | true | none | Name of the cake. |
| prepTimeMin | integer(int32) | false | none | Preparation time in minues. |
| components | [Ingredient] | true | none | List if ingredients. |
{
"name": "string",
"quantity": 0,
"unit": "string"
}
List if ingredients.
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | true | none | none |
| quantity | number(double) | true | none | none |
| unit | string | true | none | none |