Rev 0.1 - 19.06.2020
The import widget works for integrating the Bring! import on a Website. For other integrations like App-to-App integrations Bring! supports the import via a deep link link. This link can be created using an API provide by Bring! and triggered by the App to start the import.
Note: The App-to-App integration points to a webpage (or json file - not recommended) that contains the ingredient information to be imported in a structured format. More on this here
To get an import link, send a request to the following Bring! Rest API:
POST https://api.getbring.com/rest/bringrecipes/deeplink
Payload:
{
"url" :"{recipeUrl}",
"baseQuantity": "{baseQuantity}",
"requestedQuantity": "{requestedQuantity}"
"sha1GoogleAdId" : "{sha1 hashed Google AdId}"
"sha1AppleIdfa" : "{sha1 hashed Apple IDFA}"
}
url: the Url to a page containing the engredients to be imported. REQUIRED
baseQuantity: the quantity of the source. If the site contains the information for recipeYield there is no need to deliver baseQuantity.
requestedQuantity: the quantity to be imported.
sha1GoogleAdId: The advertisement id of the device (Android only)
sha1AppleIdfa: The idfa of the device (iOS only)
Response (HTTP 200):
{
"deeplink" : "{deeplink}"
}
This deeplink in the result can be triggered by the App to import the recipe into Bring!
Url to import: https://qblog.qoqa.ch/de/posts/3147 (must be supported by our parser - more information here)
The site contains the ingredients for 4 portions
The link should import 6 portions
This results in the following POST body:
{
"url" :"https://qblog.qoqa.ch/de/posts/3147",
"baseQuantity": "4",
"requestedQuantity": "6"
"sha1GoogleAdId" : "{sha1 hashed Google AdId}"
"sha1AppleIdfa" : "{sha1 hashed Apple IDFA}"
}
Result:
{
"deeplink":"https://go.getbring.com/12XvvLwDMTdjhiFX9"
}
Example curl request
curl --location --request POST 'https://api.getbring.com/rest/bringrecipes/deeplink' \
--header 'Content-Type: application/json' \
--data-raw '{
"url" :"https://qblog.qoqa.ch/de/posts/3147",
"baseQuantity": "4",
"requestedQuantity": "6"
"sha1GoogleAdId" : "{sha1 hashed Google AdId}"
"sha1AppleIdfa" : "{sha1 hashed Apple IDFA}"
}'