Rest API: How to get a final-dish book
System login
To make calls to our APIs, the first thing you need is to authenticate through a login call. That call returns a token that you must then attach to every subsequent call.
This shell script shows how to authenticate using curl:
[email protected]
password=XXXXXXX
url=https://app.tspoonlab.com/recipes/api
authenticate='username='$username'&password='$password
echo -n 'rememberme:' > rememberme.txt
curl -v --data $authenticate $url/login >> rememberme.txt
On later calls, add the token received from the login call to your headers:
curl -X PUT -v -H "$(cat rememberme.txt)" $url/integration/llamada
Get the list of recipe centers
To get the list of recipe centers your user has access to, make this call:
GET: https://app.tspoonlab.com/recipes/api/recipeCenters
It returns an array of the UserRecipeCenter class and a 200 code.
public class UserRecipeCenter {
private String id; // User/recipe-center relationship id
private String idRecipeCenter; // recipe center id
private String descr; // Book description
private Boolean active; // Whether the book is the active book for the user
}
Did you find this article helpful?
If you need further assistance, contact support by clicking the built-in Support Chat in the bottom-right corner of your screen.
