No records returned from GET

Hi

I hope someone can help me out here. I’m sure it’s something simple but can’t for the life of me work out what is wrong…

I’m making a basic view based get request as follows:

$(document).on(‘knack-form-submit.view_1011’, function(event, view, record) {

$.ajax({
url: ‘https://api.knack.com/v1/pages/scene_345/views/view_2474/records/’,
//async: false,
type: ‘GET’,
headers: {
‘Authorization’: Knack.getUserToken(),
‘X-Knack-Application-Id’:Knack.application_id,
‘X-Knack-REST-API-KEY’:“knack”,
‘Content-Type’:‘application/json’
},

complete: function(data) {
  Knack.views['view_2474'].model.fetch();      
  Knack.views['view_2475'].model.fetch();
},

success: function(data) {
  console.log (data);
  .
  .
  . etc

View_1011 and view_2474 both reside on scene_345. View_1011 is a form and view_2474 is a table view.

I’m tryng to retireve all of the records from view_2474 after view_1011 has been submitted. I can see that there are records in view_2474 with my own eyes but the above code refuses to return any records at all. The GET executes successfully but returns 0 records.

Any ideas??? This is driving me nuts.

Many thanks, Neil.

Hello Neil,

Looks like everything is okay. Possibly maybe you are using a private server or knack may change the base url of your application.

you can contact either knack or share an app with me I will check. or just provide me your app url and login

Regards,
Sunny Singla
ssingla1985@gmail.com

Thanks Sunny.

I’ve shared a very simple test app with you which reproduces the problem as the original app is much more complex and I wondered if the functionality was being affected by something else… apparently not! I do similar operations to this throughout the original app and everything works fine - I can’t figure out what the difference is with this scenario.

Kind regards

Neil

Hello Neil,

I think then you need to contact with customer support … or check your network complete url while rendering that view.

Thanks,
Sunny Singla