Skip to main content
Participant
May 21, 2019
Question

I am trying to execute a HTTPXML request to push data via API from a PDF to a HCL LEAP platform. This code is set to run on Javascript via button click with the PDF. All relevant fields on the PDF are set as variables. The code works when ran within

  • May 21, 2019
  • 1 reply
  • 573 views

I am trying to execute a HTTPXML request to push data via API from a PDF to a HCL LEAP platform. This code is set to run on Javascript via button click with the PDF. All relevant fields on the PDF are set as variables. The code works when ran within a browser. I am stuck on how to get the PDF to open a HTTP handler to perform the function.

var jp = {};
jp.flowState = 'ST_PendingPDFupload';
jp.pressedbutton = 'S_Submit1';
jp.F_CAC = this.getField("F_CAC").value.toString()


var s = JSON.stringify(jp); //covert to string to send in XHR
var UID = this.getField("UID").value.toString();
var urla = 'https://domain/forms-basic/secure/org/data/ba48a093-5a1d-       
40ef-87f6-bb196b95fa9f/F_NewForm1/'
var urlb = 'freedomIdentifyKey=00'
var url = (urla + UID + urlb)
var client= new XMLHttpRequest(); //open an HTTP request
client.open("PUT",url,false);
client.setRequestHeader('Content-Type', 'application/json');
client.setRequestHeader('Accept', 'application/json');
client.setRequestHeader('Cookie', 'freedomIdentifyKey=00');
client.send(s);

    This topic has been closed for replies.

    1 reply

    sinious
    Legend
    May 22, 2019

    Just curious what UID might look like. Your urla ends with ...F_NewForm1/ (it adds the forward slash), then you append your UID, then you append urlb which doesn't have a prefix of a forward slash, it just starts as freedomIdentifyKey=00. Does UID solve this possible URL pattern issue? I'm assuming yes since you say it works in a browser but I'm curious to have a more complete example from you. We can't see the structure of UID.