Jump to content
  • 0

Rest Api Insert Record


Teshan

Question

Hi,

I am trying insert a record which has a auto number. I am trying return auto-number in my response but it returns nothing.

can anyone advise on this.

 

table :TBL_TEST{uid autonumber,ID string ,NAME string}

 

function CallWebAPI1() {
    
var params={"ID":"1","NAME":"test"};
    request.open("POST", "https://XXXXX.caspio.com/rest/v1/tables/TBL_TEST/rows", true);

    request.setRequestHeader("Authorization", "Bearer "+ accessToken);
    request.setRequestHeader("Accept", "application/json");
    request .setRequestHeader("Content-Type", "application/json;charset=UTF-8");


   request.send(JSON.stringify(params));


    request.onreadystatechange = function () {
      if (request.readyState == 4 && request.status== 201) {
       var response = request.responseText;
 //request.responseText returns empty here.
       }
    }

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...