Files
openfoodnetwork/engines/dfc_provider
Maikel Linke db77d1591c Add test examples to DFC API documentation
In other API specs, you provide example values in the schema. So the
specs contain examples which can be used for the documentation. But
instead of defining example data separately, we can use the generated
data by the specs. This way we document real output and don't have to
double up on documentation.

Note that we don't have schema definitions for the DFC API yet. And it
wouldn't make sense to replicate the DFC Ontology manually in JSON
Schema for this purpose. The DFC Connector ensures already that we
comply with the ontology. But I hope that we can use a tool at some
point to generate JSON Schema from the DFC Ontology which would add more
detail to the Swagger docs, I think.
2023-06-28 13:50:54 +10:00
..
2023-06-19 16:19:48 +10:00
2020-05-06 22:04:56 +02:00
2023-05-09 16:51:25 +10:00
2023-05-09 16:51:25 +10:00

Data Food Consortium API for the Open Food Network app (OFN DFC API)

This engine implements the Data Food Consortium specifications. It serves and reads semantic data encoded in JSON-LD.

Authentication

The DFC uses OpenID Connect (OIDC) to authenticate requests. You need an account with a trusted OIDC provider. Currently these are:

But you can also authenticate with your OFN user login (session cookie) through your browser.

API endpoints

The API is under development and this list may be out of date.

/api/dfc-v1.7/persons/:id
 * show: firstName, lastName, affiliatedOrganizations

/api/dfc-v1.7/enterprises/:id
 * show: name, suppliedProducts, catalogItems

/api/dfc-v1.7/enterprises/:enterprise_id/supplied_products (index)

/api/dfc-v1.7/enterprises/:enterprise_id/supplied_products/:id
 * create: name, description, quantity
 * show: name, description, productType, quantity
 * update: description

/api/dfc-v1.7/enterprises/:enterprise_id/catalog_items (index)

/api/dfc-v1.7/enterprises/:enterprise_id/catalog_items/:id
 * show: product, sku, stockLimitation, offers (price, stockLimitation)
 * update: sku, stockLimitation