Appery.io rest api help

Hi! I am using DreamFactory as a rest api connector to my MySql database. I have that setup and working properly.

I am trying to use this rest api with my appery.io app. I can setup the data connections and get successful tests. What I can’t do is to get the api to return any data. For example, I was trying this on the todo app (small scale for learning). Here is the response from testing.

{
“swaggerVersion”:“1.2”,
“apiVersion”:“1.0”,
“authorizations”:{
“apiKey”:{
“type”:“apiKey”,
“passAs”:“header”
}
},
“info”:{
“title”:“DreamFactory Live API Documentation”,
“description”:"",
“contact”:"support@dreamfactory.com",
“license”:“Apache 2.0”,
“licenseUrl”:“http://www.apache.org/licenses/LICENSE-2.0.html
},
“events”:[
“swagger.cache_cleared”,
“swagger.cache_rebuilt”
],
“apis”:[
{
“path”:"/user",
“description”:“User session and profile”
},
{
“path”:"/system",
“description”:“System configuration”
},
{
“path”:"/db",
“description”:“Local database access”
},
{
“path”:"/email",
“description”:“Email utility access”
},
{
“path”:"/files",
“description”:“Local file storage access”
},
{
“path”:"/PMRapi",
“description”:“Price Match Report Test api”
}
]
}

The test doesn’t show any data. I have tried with just a where clause and with getRecords. Here is the parameters for the above test.
Request parameters:
X-DreamFactory-Application-Name
X-DreamFactory-Session-Token
table_name
getRecords
Test successful.
Request URL: {database_url}/db/{table_name} Test Successful

Please help. Thanks.

Working with this user via email - will post solution when we arrive at it.

Thanks,

  • Mark

I GOT IT TO RETURN DATA!!

Will this session token expire?

:smile:

yes, in 24 mins or so, I believe. This is something that cannot be changed on the hosted edition, however, you can manually override this by getting the locally installed version.

Glad to see you’re in good shape now!

Thanks,

  • Mark

So i would need to install it on my server. Right?

Also, I cant seem to get it to filter data. Any examples or hints?

Right - you’ll have to install it on server or use in cloud. As far as filtering data, I assume through the Live API you’re having trouble using the “where” clause syntax.

Assume the “where” is already there…

in which case, this would be a successful filter:

field (operator) ‘xyz’

name LIKE ‘%fath%’

Example with the URL:

https://dsp-mark.cloud.dreamfactory.com/rest/db/table?filter=types%3D%&limit=10000&app_name=mark

Hope this gives you a better understanding.

Thanks,
Mark

Yes, to override session duration you need to install on a server or your local computer. Easiest way to do that is with the Bitnami installers https://bitnami.com/stack/dreamfactory.

Filtering with the API uses SQL syntax. The best way to see it in action is by entering a query string in the ‘filter’ field of the live API docs and getting a 200 response back with correct JSON returned. Check out ‘Using Filters’ in the docs here for some examples.

Have a look here, too!

I can get it to filter great through the appery service setup.
I just can’t figure out how to transfer that to the appery datasource settings. I think I need a javascript for it. I am no programmer, but taking classes. :frowning: