Andrew Walker
Posts: 0
Joined: Thu Dec 05, 2013 9:11 am

Access Database Outside Appery

Are you able to build a website outside of Appery, but still use the same database as your mobile app? If so, how would one do this with HTML5 and JS. Thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Access Database Outside Appery

Hello! Yes, it's possible. Appery.io back-end has it's own API http://docs.appery.io/documentation/b..., you can use it to access DB.

Andrew Walker
Posts: 0
Joined: Thu Dec 05, 2013 9:11 am

Access Database Outside Appery

Thank you :)

Andrew Walker
Posts: 0
Joined: Thu Dec 05, 2013 9:11 am

Access Database Outside Appery

Are there any examples of how this works on an external website using javascript ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Access Database Outside Appery

Hi Andrew,

Sorry, this is an only reference we can suggest.

Andrew Walker
Posts: 0
Joined: Thu Dec 05, 2013 9:11 am

Access Database Outside Appery

I am sorry also, without an example, which works, I am unable to upgrade my plan, as there is no javascript examples on your docs. Only command line, which is no help to me.

If there is really no other help, then please let me know, and I will find another way away from appery.

Thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Access Database Outside Appery

Andrew,

Here is an example. To get data from database use this code (you can create other services in the same way):pre$.ajax({
url: "https://api.appery.io/rest/1/db/collections/a/51d56645e4b0b3e9055d450c",
beforeSend: function(xhr) {
xhr.setRequestHeader("X-Appery-Database-Id", "51d5662de4b0b3e9055d450a");
},
success: function(data) {
}
});/preWhere 'object_id' and 'database_id' should be replaced with yours (see in the document above). Let us know if you need any further help.

Andrew Walker
Posts: 0
Joined: Thu Dec 05, 2013 9:11 am

Access Database Outside Appery

That is great, I was doing it very different. Can I ask, what does '51d56645e4b0b3e9055d450c' relate too?

You also speak of service, if this is a REST service I have created in the back end, such as a read service of a collection, where do I get its reference object_id ?

Thank you :)

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Access Database Outside Appery

Hello! 51d56645e4b0b3e9055d450c is project id. You can do any requests to DB the way you do it in Appery.io project (retrieving object list, deleting, creating, editing). You just need to use correct URL and send necessary parameters with method you need. Here is more information http://docs.appery.io/documentation/b...

Andrew Walker
Posts: 0
Joined: Thu Dec 05, 2013 9:11 am

Access Database Outside Appery

Okay, so is Project id and Object_id the same thing ?

Return to “Issues”