REST API: How to get a final-dish book
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 (books of final elaborations) 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; // Identificador de la relación usuario/libro de elaboraciones finales
private String idRecipeCenter; // identificador del libro de elaboraciones finales
private String descr; // Descripción del libro
private Boolean active; // Si el libro es el libro activo para el usuario
}
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.
