Skip to main content
edited body
Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

I'm trying to connect to a web portal via API's.

HttpRequest httpRequest = new HttpRequest();
httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx');
String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body);
httpRequest.setMethod('GET');
Http htt = new hTTP();

 HttpResponse httpRe = htt.send(httpRequest);
 system.debug('++++++response'+httpRe.geTbody());

 String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

0

909:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb
**09:26:09:000 USER_DEBUG   <status>fail</status>**
09:26:09:000 USER_DEBUG     <items><item><code><![CDATA[-1]]></code><heading><![CDATA[Form Error]]></heading><description><![CDATA[No data received.]]></description><routine><![CDATA[]]></routine><icon><![CDATA[]]></icon><priority><![CDATA[]]></priority></item></items>

What I'm missing ?Any modification needed?

I'm trying to connect to a web portal via API's.

HttpRequest httpRequest = new HttpRequest();
httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx');
String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body);
httpRequest.setMethod('GET');
Http htt = new hTTP();

 HttpResponse httpRe = htt.send(httpRequest);
 system.debug('++++++response'+httpRe.geTbody());

 String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

0

9:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb
**09:26:09:000 USER_DEBUG   <status>fail</status>**
09:26:09:000 USER_DEBUG     <items><item><code><![CDATA[-1]]></code><heading><![CDATA[Form Error]]></heading><description><![CDATA[No data received.]]></description><routine><![CDATA[]]></routine><icon><![CDATA[]]></icon><priority><![CDATA[]]></priority></item></items>

What I'm missing ?Any modification needed?

I'm trying to connect to a web portal via API's.

HttpRequest httpRequest = new HttpRequest();
httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx');
String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body);
httpRequest.setMethod('GET');
Http htt = new hTTP();

 HttpResponse httpRe = htt.send(httpRequest);
 system.debug('++++++response'+httpRe.geTbody());

 String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

09:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb
**09:26:09:000 USER_DEBUG   <status>fail</status>**
09:26:09:000 USER_DEBUG     <items><item><code><![CDATA[-1]]></code><heading><![CDATA[Form Error]]></heading><description><![CDATA[No data received.]]></description><routine><![CDATA[]]></routine><icon><![CDATA[]]></icon><priority><![CDATA[]]></priority></item></items>

What I'm missing ?Any modification needed?

added 65 characters in body
Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

I'm trying to connect to a web portal via API's.

`HttpRequest httpRequest = new HttpRequest(); httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx'); String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body); httpRequest.setMethod('GET'); Http htt = new hTTP();

HttpResponse httpRe = htt.send(httpRequest); system.debug('++++++response'+httpRe.geTbody());

String re = httpRe.geTbody();

HttpRequest httpRequest = new HttpRequest();
httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx');
String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body);
httpRequest.setMethod('GET');
Http htt = new hTTP();

 HttpResponse httpRe = htt.send(httpRequest);
 system.debug('++++++response'+httpRe.geTbody());

 String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

09:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb 09:26:09:000 USER_DEBUG fail 09:26:09:000 USER_DEBUG 0

9:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb
**09:26:09:000 USER_DEBUG   <status>fail</status>**
09:26:09:000 USER_DEBUG     <items><item><code><![CDATA[-1]]></code><heading><![CDATA[Form Error]]></heading><description><![CDATA[No data received.]]></description><routine><![CDATA[]]></routine><icon><![CDATA[]]></icon><priority><![CDATA[]]></priority></item></items>

What I'm missing ?Any modification needed?

I'm trying to connect to a web portal via API's.

`HttpRequest httpRequest = new HttpRequest(); httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx'); String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body); httpRequest.setMethod('GET'); Http htt = new hTTP();

HttpResponse httpRe = htt.send(httpRequest); system.debug('++++++response'+httpRe.geTbody());

String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

09:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb 09:26:09:000 USER_DEBUG fail 09:26:09:000 USER_DEBUG

What I'm missing ?Any modification needed?

I'm trying to connect to a web portal via API's.

HttpRequest httpRequest = new HttpRequest();
httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx');
String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body);
httpRequest.setMethod('GET');
Http htt = new hTTP();

 HttpResponse httpRe = htt.send(httpRequest);
 system.debug('++++++response'+httpRe.geTbody());

 String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

0

9:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb
**09:26:09:000 USER_DEBUG   <status>fail</status>**
09:26:09:000 USER_DEBUG     <items><item><code><![CDATA[-1]]></code><heading><![CDATA[Form Error]]></heading><description><![CDATA[No data received.]]></description><routine><![CDATA[]]></routine><icon><![CDATA[]]></icon><priority><![CDATA[]]></priority></item></items>

What I'm missing ?Any modification needed?

Source Link

Error with Apex callout

I'm trying to connect to a web portal via API's.

`HttpRequest httpRequest = new HttpRequest(); httpRequest.setEndpoint('xxxxxxxxxxxxxxxxxxxxxxxx'); String body='account=xxxx&authenticationkey=xxxxxxxxxxx&username=Tester&id=xxxxx';

httpRequest.setBody(body); httpRequest.setMethod('GET'); Http htt = new hTTP();

HttpResponse httpRe = htt.send(httpRequest); system.debug('++++++response'+httpRe.geTbody());

String re = httpRe.geTbody();

The 4 parameters I used are noted in the guide.But it shows up a different error.

09:26:09:229 VARIABLE_ASSIGNMENT [7]|httpRe|"System.HttpResponse[Status=OK, StatusCode=200]"|0x5eded4bb 09:26:09:000 USER_DEBUG fail 09:26:09:000 USER_DEBUG

What I'm missing ?Any modification needed?