This Repository is only to track the Eaternity API Documentation of
eaternity / eaternity-api Goto Github PK
View Code? Open in Web Editor NEWThe repository for the Eaternity REST API Documentation.
The repository for the Eaternity REST API Documentation.
This Repository is only to track the Eaternity API Documentation of
I have problem with creating new product using the PUT https://co2.eaternity.ch/api/products/:id
endpoint.
I used to be able to do it without specifying nutrient-values.
However, now when I try the following request
curl --location --request PUT 'https://co2.eaternity.ch/api/products/1144facb-331b-43f4-8749-e4f71e5ad2bd' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic XXX' \
--data-raw '{
"id": "54a8b6fc-ceaf-4eaf-83bf-3d1b6b45a24e",
"amount": 1.0,
"ingredients-declaration": "Gemüsespieße",
"names": [
{
"language": "de",
"value": "Gemüsespieße"
}
]
}'
I am getting following error status=400
and payload
BAD REQUEST: nutrient-values can not be empty.
I tried with the following without any success
"nutrient-values": {"amount":1.0}
curl --location --request PUT 'https://co2.eaternity.ch/api/products/1144facb-331b-43f4-8749-e4f71e5ad2bd' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic XXX' \
--data-raw '{
"id": "54a8b6fc-ceaf-4eaf-83bf-3d1b6b45a24e",
"amount": 1.0,
"ingredients-declaration": "Gemüsespieße",
"names": [
{
"language": "de",
"value": "Gemüsespieße"
}
],
"nutrient-values": {"amount":1.0}
}'
with the same error
BAD REQUEST: nutrient-values can not be empty.
curl --location --request PUT 'https://co2.eaternity.ch/api/products/1144facb-331b-43f4-8749-e4f71e5ad2bd' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic XXX' \
--data-raw '{
"id": "54a8b6fc-ceaf-4eaf-83bf-3d1b6b45a24e",
"amount": 1.0,
"ingredients-declaration": "Gemüsespieße",
"names": [
{
"language": "de",
"value": "Gemüsespieße"
}
],
"nutrient-values": [{"amount":1.0}]
}'
and getting the following error
{
"status": "BAD_REQUEST",
"key": "json processing exception",
"message": "JSON parsing error on line number 11. Check API Documentation and JSON format."
}
Any idea what is the required payload? We use to use this endpoint by only provided the name and the amount.
What is the required minimum payload.
This is just a friendly suggestion, to make it easier to work with the documentation.
In Create a recipe
(https://github.com/Eaternity/eaternity-api/blob/master/apiary.apib#L420) in the documentation, the example request does not work (when copy+pasting into postman) because:
It does not have a kitchen-id
It would be nice if this field name was specified.
Invalid json
Line 46 and 68 is not valid json (for example "gtin": 00012345678905
), are lacking " ". This returns an error.
Perhaps, there is a good reason why the request looks like it does. In that case, feel free to just close this issue!
/ Philip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.