1. Login to the system
Before making API calls, you must first authenticate using the login endpoint.
This call returns a token that must be included in all subsequent requests.
Example (cURL)
[email protected] password=XXXXXXX url=https://www.tspoonlab.com/recipes/api authenticate="username=$username&password=$password" echo -n 'rememberme:' > rememberme.txt curl -v --data "$authenticate" "$url/login" >> rememberme.txt
For later requests, include the token in your headers:
curl -X PUT -v -H "$(cat rememberme.txt)" "$url/integration/call"
2. Get the list of Dish Books
To retrieve the list of dish books (final recipe collections) that the user has access to, call:
Endpoint
GET https://www.tspoonlab.com/recipes/api/recipeCenters
If successful, the API returns a 200 OK status code and an array of UserRecipeCenter
objects.
Response
public class UserRecipeCenter { private String id; // Relationship ID between user and dish book private String idRecipeCenter; // Dish book identifier private String descr; // Dish book description private Boolean active; // True if this is the user's active book }
Notes
All requests require a valid login token (
rememberme
) in the header.The endpoint lists all dish books (final recipe sets) linked to the authenticated user.
Use HTTPS for all requests.