How to use data service api?

What I try to do: save and load some data. I manually logged in my epicenter account. Then run the data service api example code:
var ds = new F.service.Data({ root: 'survey-responses' }); ds.saveAs('user1', { 'question1': 2, 'question2': 10, 'question3': false, 'question4': 'sometimes' } ); ds.saveAs('user2', { 'question1': 3, 'question2': 8, 'question3': true, 'question4': 'always' } ); ds.query('',{ 'question2': { '$gt': 9} });
the error message I got from browser is 404. for https://api.forio.com/data///survey-responses/user2/
How do I construct correct url? For flow.js I use
`run: {

                // the model field should already be present
                model: 'model.eqn',

                // add the account, project, and server fields
                account: 'hangingsteel',
                project: 'well-factory',
                server: {
                    host: 'api.forio.com'
                }`

But for data service, I don’t know how to connect.

What each data service api method return, return values are not documented? How to get the response? Can I use promise as well for data service?

Hi Jay,

I’m assuming you’re running locally; You’d do this similar to how you had it for flowjs.

var ds = new F.service.Data({ root: 'survey-responses' account: 'X', project: 'Y' });
The above pattern of specifying the account and project as constructor options applies to all the API Adapters/services. We’ll update our docs to match.

-Naren

Also, this is not a substitute for documentation but scanning through the test-cases for each adapter on github might be useful to get a sense for the different things you can do with it/ options you can pass in. For instance the tests for Data API are here and showcase passing account and project in.

Good points, thank you. I will explore.