For example, in a login module I want to call the API and check if the username and password provided by the user is true against the DB or not. If its true, then the user logs.
Is there a way that I can make relational query as well? Any example will be appreciated.
For example, in a login module I want to call the API and check if the username and password provided by the user is true against the DB or not. If its true, then the user logs.
DreamFactory validates user name and password on the login API call, so you don’t need to write logic to do this. Make sure to pass in all the correct parameters to authenticate and get a session. Here’s a login cURL example at the top of this page https://github.com/dreamfactorysoftware/dsp-core/wiki/cURL-Examples
Is there a way that I can make relational query as well? Any example will be appreciated.
Yes, you can fetch parent plus child records (1:M) or fetch records from two sibling tables via an intermediary junction table (M:M) in a single API call. To do that, pass in the correct associative key in the related parameter in the API call itself. You can test this in the API Docs interface in the admin console. Examples are below:
Note that you can also use stored procedures if you have more complex queries that need to join more than two tables. Stored procedures are callable by the API. Examples of that are here:
Alright, I am using email for now. But while using getRecordsByFilter() API with email id, I am getting a response like this:
{
"error": [{
"context": null,
"message": "Failed to retrieve records from 'my-data'.\nCDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@xyz.com LIMIT 1000' at line 3",
"code": 500
}]