I have tried to call REST API from Mobile site. Using the following url
http://IP_Address:8091/Bucket_Name/Document_Name/
the response is "Not found"
I have refer the below link:
http://developer.couchbase.com/documentation/mobile/1.1.0/develop/references/couchbase-lite/rest-api/document/get---db---doc-/index.html#example
My question is, how can I get json response using REST api?
You are mixing two different things here.
1. Couchbase Lite - Embedded database similar idea to SQLite - just document - key/value database.
2. Couchbase server - Fully fledged enterprise noSQL\KV\Document database.
You actually have two approaches:
When you are using Couchbase Lite as your mobile app you may need Sync gateway in order to talk back to the couchbase server.
The Sync gateway deals with the online updates of your data, while couchbase Lite acts as an offline - online repository of your data.
That is the preferred way - as you have the greatest support for you app.
When using only Couchbase server - you can use an SDK to create your calls - or use some REST API available in the REST service - such as views.
http://docs.couchbase.com/admin/admin/rest-intro.html
Thanks,
Roi
Related
I have an Ionic app which is configured in parse.com backend. How can I change it to work with Firebase backend or is there any alternative for parse.com backend? I tried back4app.com but it can't read my cloud code.
Firebase is totally different from Parse.com so if you want to move to firebase you will need to refactor all your client business logic which interact with Parse.com services. A very good alternative is to use parse-server which is the Parse.com open source. parse-server can be deployed to any cloud which support NodeJS runtime.
Please note if you decided to go with parse-server or with back4app you need to do some modifications to your cloud code and your client side code. The best is to follow the documentation which available under the parse-server github page that i mentioned above. Another good resource is this one which collect all the stuff related to parse-server and how to use parse-server in development or production
I would like to use a REST API as a data source for tableau. Is this possible in any way? The API service returns standard JSON, and I would think that would be an ideal scenario for tableau. Rather than connecting to some backend database behind the API.
Thanks
The web data connector does this and is in beta right now as noted by inox. See: https://www.tableau.com/web-data-connector
"The Web Data Connector will allow you to create a connection to almost any data that is accessible over HTTP. This can include internal web services, JSON data, REST APIs, and many other sources. It will not be supported in the initial launch of Tableau 9.0. Beta participants will be able to use a dedicated product key to continue building and testing connectors until the Web Data Connector officially launches."
Also, you can use the Extract API to create Tableau Extracts from an API: https://www.tableau.com/learn/tutorials/on-demand/extract-api-introduction
I'm trying to build an API which can be used to update some master data in my app. It contains various drop-downs for city, country etc. Whenever I add new data in these drop-downs, I need the apps to hit this API once a day and get the latest data. Also, if the API is requested older data (from older apps), it should be able to return such data based on some date query parameter.
What's the best way to create such an API?
Also, the API needs to be RESTful and will be exposed to Android/iOS environments.
API should be able to return so based on some date query parameter.
You can use two columns created_at and updated_at in you tables schema. So how can this will useful for your situation:
Whenever some one hitting api without date parameter, you are return all data which are created before current time.
Whenever some one hitting api with date parameter then you can return data which are created before value of date parameter.
Obviously you have to write complete logic for this at server side
end.
Please explore one of the Mobile Backend as a Service (mBaaS) products for your long term needs.
Here are some players:
BaasBox: Open source backend
Backendless: Allows
developers to have an instant backend without writing server-side
code.
Apigee App Services: provides a lot of free storage, push notification, analytics etc.
Appcelerator: An BaaS targeted at the Enterprise audience.
For the short run you may want to try https://www.webscript.io/ to embed some quick javascript code to return the JSON response for you.
I would put a spin on #Santanu's suggestion of using BaaS. I would recommend using a BaaS during the development phase of your project.
When the iPhone and Android Apps have been developed and tested, replace the Baas-based server components with a in-house built RESTful server.
This approach has a couple of benefits. It lets you divide the effort into two distinct parts: the client changes to your product, and the building of your server component.
I assume your company's current expertise lies in App development, so it should be easier for you all to upgrade your applications to use the BaaS-based APIs.
It will also be much easier to reiterate and refine your data components and models using a mature BaaS server.
With Apps using data requests to populate the drop-downs from a BaaS-based RESTful API, and stable working data models and data sets hosted in the BaaS servers, it will be much faster to start building your own RESTful service.
When you run into issues, you will be confident they are in the server side code. You can run A/B tests with the same Apps against two versions of the server and ensure the client experience is the same.
You could continue to use the BaaS Server for rapid prototyping and developing API extensions.
From the MongoLab's documentation, they recommend:
MongoLab databases can be accessed by your application code in two ways.
The first method - the one we strongly recommend - is to connect using one of the MongoDB drivers (as described above). You do not need
to use our API if you use the driver.
The second method, which you should use only if you cannot connect via one of the MongoDB drivers, is via MongoLab’s RESTful data API.
Why do they recommend using the driver rather than their REST API? One reason I can think of is portability across different MongoDB providers. Are there any other reasons? Wouldn't it be more beneficial for MongoLab to "vendor lock-in" customers with their API?
The points that #WiredPrairie and #Stennie brought up around security are correct. *When you use our REST API, you expose your API key to the client. Currently, anyone with the API key can modify your database. As a result, we only recommend using the REST API with public data, e.g. all the locations for taco trucks in the country.
By writing your own app tier, you can keep credentials to your database from being exposed to the client.
If you have any more questions, email us at support#mongolab.com. Happy to help!
-Chris#MongoLab
p.s. thanks #WiredPrairie and #Stennie
I am new to iOS development. How to save data (say user information) over the network into central database? My application will take user information and store it into central database.
This is not a trivial 'the answer is this...' kind of questions.
For what it is worth, you would need to set up some form of server application - perhaps using a web MVC framework like Rails, Django, Grails, ASP.NET MVC - providing a nice RESTful interface to some backend database, passing data around in JSON documents.
Here is a reference to the iOS API end of things:
URL Loading System
Since you are using PHP - you might want to write a RESTful API for the database operations you require. A SO question about this is found here
And here is a tutorial describing how to create an API in PHP for an online leaderboard - which should get you started:
Online Leaderboard for iPhone game in PHP