API and Authentication
Last updated
Was this helpful?
Last updated
Was this helpful?
The Id
is the base64-encoded version of the databaseId
with the ObjectType.
In other words, Id
= ObjectType
+ :
+ databaseId
For example, if the databaseId
for a recipe is b78a8f0d-4c89-4df1-bc73-42e2175e2737 then its iD would be UmVjaXBlOmI3OGE4ZjBkLTRjODktNGRmMS1iYzczLTQyZTIxNzVlMjczNw==
In Python, this would be done as follows:
DatabaseID
?Use the databaseID
to execute some of the queries and mutations. The databaseID
parameter is the base64-encoded version of the ID of an element that can be either of a user or a recipe.
For that reason, use thedatabaseId
to send it as a sg-user
parameter in the header.
To get the execute the query and to replace in the mentioned variable as follows:
Include the databaseID
in the sg-user
for all the queries that are executed on behalf of a user. For example:
Using it in the header:
If you need to get the list of all users created with a specific token, it is only required to send the token parameter because we don't require to get the information of a specific user.
If you need to generate a meal plan, it is required to send the databaseID
in the header since it will be generated for a specific user.
Use it in a mutation:
ID
? Use the ID when you The ID is the base64-encoded version of the databaseId
. Use this ID to send it as a parameter within a query or a mutation.
Some common examples:
The JWT authentication is intended to be used on the client-side while the API token authentication must be only used on the server-side.
Partners/clients which have an isolated database will need to authenticate by using a different HTTP header named Suggestic-Partner.
If you need to update your own recipe, you will need to pass the databaseID
as a parameter on the mutation.
If you need to delete/remove your own .
To retrieve the information of a specific
To retrieve the details of a particular based on its ID.
To update the status of a "day" on a
For more information, check the documentation.
For more information, check the documentation.