Page 1 of 4

Access Database Outside Appery

Posted: Thu Dec 05, 2013 9:11 am
by Andrew Walker

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


Access Database Outside Appery

Posted: Thu Dec 05, 2013 9:47 am
by Maryna Brodina

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.


Access Database Outside Appery

Posted: Thu Dec 05, 2013 11:14 am
by Andrew Walker

Thank you :)


Access Database Outside Appery

Posted: Thu Dec 05, 2013 5:24 pm
by Andrew Walker

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


Access Database Outside Appery

Posted: Thu Dec 05, 2013 6:33 pm
by Kateryna Grynko

Hi Andrew,

Sorry, this is an only reference we can suggest.


Access Database Outside Appery

Posted: Thu Dec 05, 2013 8:44 pm
by Andrew Walker

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


Access Database Outside Appery

Posted: Thu Dec 05, 2013 9:42 pm
by Kateryna Grynko

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.


Access Database Outside Appery

Posted: Fri Dec 06, 2013 8:40 am
by Andrew Walker

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 :)


Access Database Outside Appery

Posted: Fri Dec 06, 2013 10:39 am
by Maryna Brodina

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...


Access Database Outside Appery

Posted: Fri Dec 06, 2013 11:06 am
by Andrew Walker

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