import 'package:nc_cookbook_api/api.dart';
All URIs are relative to http://localhost:8000/apps/cookbook
Method | HTTP request | Description |
---|---|---|
callImport | POST /api/v1/import | Import a recipe using schema.org metadata from a website |
deleteRecipe | DELETE /api/v1/recipes/{id} | Delete an existing recipe |
getImage | GET /api/v1/recipes/{id}/image | Get the main image of a recipe. If no image is stored a fallback image is delivered. |
listRecipes | GET /api/v1/recipes | Get all recipes in the database |
newRecipe | POST /api/v1/recipes | Create a new recipe |
recipeDetails | GET /api/v1/recipes/{id} | Get a single recipe from the server |
search | GET /api/v1/search/{query} | Search for recipes for keywords, tags and categories with the named search string |
updateRecipe | PUT /api/v1/recipes/{id} | Update a recipe |
Recipe callImport(url)
Import a recipe using schema.org metadata from a website
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final Url url = ; // Url |
try {
final response = api.callImport(url);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->callImport: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
url | Url |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
String deleteRecipe(id)
Delete an existing recipe
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final String id = id_example; // String | The id of the recipe
try {
final response = api.deleteRecipe(id);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->deleteRecipe: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the recipe |
String
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Uint8List getImage(id, size)
Get the main image of a recipe. If no image is stored a fallback image is delivered.
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final String id = id_example; // String | The id of the recipe to obtain the image for.
final String size = size_example; // String | The size of the requested image * `full` - Full resolution image (size full res) * `thumb` - thumbnail of the image (size 250px) * `thumb16` - icon of the image (size 16px) by default the full size image will be returned
try {
final response = api.getImage(id, size);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->getImage: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the recipe to obtain the image for. | |
size | String | The size of the requested image * full - Full resolution image (size full res) * thumb - thumbnail of the image (size 250px) * thumb16 - icon of the image (size 16px) by default the full size image will be returned |
[optional] |
- Content-Type: Not defined
- Accept: image/jpeg, image/svg+xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BuiltList listRecipes()
Get all recipes in the database
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
try {
final response = api.listRecipes();
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->listRecipes: $e\n');
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
int newRecipe(recipe)
Create a new recipe
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final Recipe recipe = ; // Recipe | A JSON representation of the recipe to be saved. See also the structure at https://schema.org/Recipe
try {
final response = api.newRecipe(recipe);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->newRecipe: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
recipe | Recipe | A JSON representation of the recipe to be saved. See also the structure at https://schema.org/Recipe |
int
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Recipe recipeDetails(id)
Get a single recipe from the server
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final String id = id_example; // String | The id of the recipe
try {
final response = api.recipeDetails(id);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->recipeDetails: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the recipe |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BuiltList search(query)
Search for recipes for keywords, tags and categories with the named search string
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final String query = query_example; // String | The search string, urlencoded, separated with spaces and/or commas
try {
final response = api.search(query);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->search: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
query | String | The search string, urlencoded, separated with spaces and/or commas |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
int updateRecipe(id, recipe)
Update a recipe
import 'package:nc_cookbook_api/api.dart';
// TODO Configure HTTP basic authorization: app_password
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('app_password').password = 'YOUR_PASSWORD';
final api = NcCookbookApi().getRecipesApi();
final String id = id_example; // String | The id of the recipe
final Recipe recipe = ; // Recipe |
try {
final response = api.updateRecipe(id, recipe);
print(response);
} catch on DioError (e) {
print('Exception when calling RecipesApi->updateRecipe: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the recipe | |
recipe | Recipe |
int
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]