Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Access Appery Database from a website using Jquery

I have had the answer to this, and now I am unable to find it!!

I need working example, of how I pull information from a appery database, via an external website. Most of the work is on the app. But some backend stuff needs a website. I have done this, but i am unable to find any information, or the code I used the last time.

Using jquery, PUT and GET, what examples are there ?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Access Appery Database from a website using Jquery

Thank you, that does help, and infact, that is me. But I have no idea how, or why, I have two accounts on here ?

Is there another with examples, like the above. I tried to search my name, but nothing came up ?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Access Appery Database from a website using Jquery

Appery.io databases, push and server code scripts can be easily accessed from any outside system via REST APIs. The documentation provides curl commands for each operation. A curl command is a universal language for explaining REST requests and can be used in any programming language.

Defining requests outside of Appery.io service editor is outside the scope of our support.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Access Appery Database from a website using Jquery

I am trying to POST to the database, but i keep getting an error,and I have looked at the docs, but still am unable to understand what the error is:

POST https://api.appery.io/rest/1/db/colle... 400 (Bad Request)

This is the code:

Code: Select all

 
 $.ajax({ 
   type: 'POST', 
   beforeSend: function(request) {  
request.setRequestHeader('X-Appery-Database-Id', '52*********');
}, url: '[url=https://api.appery.io/rest/1/db/collections/questions]https://api.appery.io/rest/1/db/colle...[/url]', data: {"question":"name2"}, dataType: "json", contentType:'JSON', success: function(response) { console.log("Successfully loaded"); }, error: function(xhr, ajaxOptions, thrownError) { console.log("Load error: " + xhr.status + " " + xhr.responseText); } });
[code] Here I am trying to post 'name2' into a col called question within a custom collection called questions ?
maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Access Appery Database from a website using Jquery

Are you able to to get a GET request working?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Access Appery Database from a website using Jquery

yes, thank you :)

Return to “Issues”