Quantcast
Viewing all articles
Browse latest Browse all 5028

Calling API from post process

Hi,
how to create record in post process script ?

I am trying to add a record to employee table after user register
and I was able to build record with fields required for employee entry in

var record = {
has valid fields // i have tested it using client side api call.
}

  var result = platform.api.post("mysql/_table/employee", {resource: [record]});
  if (result.status_code !== 200) {
      throw new Error(JSON.stringify(result.content.error.message));
  }

this is throwing some wired error in console log,

any idea how do I call post method from scripting ?


Viewing all articles
Browse latest Browse all 5028