Questions tagged [httprequest]
httprequest is the request sent by browser to server for particular resource.
394
questions
1
vote
0
answers
25
views
Can I config number of action in boxcar request?
I created a community site.
In the site I have a form with a lot of item dynamic (item stored in database: type (input, radio, checkbox,...), label, max length,...)
When I submit form, cause of number ...
0
votes
0
answers
15
views
Sending file from Salesforce to the Einstein Platform Services API
I'm trying to use the Einstein Platform Services API, specifically the OCR service (https://metamind.readme.io/docs/extract-data-from-custom-forms) to detect key value pairs in a custom form. I would ...
0
votes
1
answer
23
views
How to set StatusCode on Test.setMock [duplicate]
I have a simple class that just calls the generic HTTPCallOUt method for its test class.
I want it to be able to fail in order to catch all the code. Here is my code:
Test.startTest();
Test....
0
votes
0
answers
25
views
Compose a multipart/mixed HTTP request [duplicate]
How do I set the request body of a POST request in Apex in the raw format. Below is the sample raw body that I am trying to set,
--foo_bar
Content-Type: application/http
GET /gmail/v1/users/test@gmail....
0
votes
2
answers
116
views
HTTP/1.0 Requests
We have received a notification that requests are reaching our salesforce.com Org using HTTP/1.0 and such requests are no longer supported.
I assume these requests are, most likely, coming from some ...
0
votes
1
answer
28
views
Test class for HTTPCallout POST with Invocable Method from Flow [duplicate]
I'm still pretty new to this, and I've looked around and haven't been able to find the solution that combines everything like I'm trying to do. I've tried quite a few things, but here's where I ...
0
votes
1
answer
49
views
Getting a script-thrown exception on a PUT to Amazon S3
Code generates an XML document and PUTs in into an S3 Bucket.
If I comment out the Header code for Content Length, it does not throw, but S3 requires Content Lengths in the header. So it fails at the ...
0
votes
2
answers
28
views
Why Places field on account object is not getting updated in the UI after making callout from trigger using future method?
I have made two custom fields 'Pincode__c' of type text and 'Places__c' of type Long Text Area.I am inserting account record by providing 'Pincode__c' value and want the custom field 'Places__c' to ...
1
vote
1
answer
90
views
Named Credential Permission Error - How to enable named credentials with "Named Principal"
I've got a new named credential setup using an OIDC auth provider and the named principal type. It's authenticated successfully but when I try to call it I get
String namedCredential = 'callout:asdf';
...
0
votes
0
answers
236
views
REST API - File Upload using HTTP Request with multiple parameter in apex (salesforce)
I'm trying to post form data using HTTP request with multipart/form-data with multiple parameters but It's always showing error "invalid file contents".
{"http_code":400,"...
0
votes
1
answer
25
views
HTTPPost : Unexpected parameter encountered during deserialization: attributes
I am having the following code to insert a Case record. When I run the code using workbench I am able to insert a case record. But when I try to call the API from another sandbox I am getting Error :
...
0
votes
3
answers
45
views
Getting [OBJECT][OBJECT] in data table
Apex class
public class IndianPostDataService {
@AuraEnabled(cacheable=true)
public static String getDetailsUsingPincode(string PINCODE){
Http http= new Http();
...
1
vote
1
answer
125
views
Convert code snipet from Java to Apex
I am trying to do an api call and am getting a 403 error. I am putting the apex code below that is getting the 403 error. We opened a ticket with the company that we are sending the callout to and ...
0
votes
0
answers
29
views
error: unsupported port: 444
I am getting an error when adding a site in the Remote Site Setting section.
error: unsupported port: 444. supported ports are 80, 443, and 1024 to 65535
It is an external service and the provider ...
0
votes
1
answer
115
views
SSJS API call with form-data Content-Type
I am trying to make a request to an external API with SSJS and I have found this post where Eliot Harper posted a solution.
I have made a lot of API calls using SSJS but with Content-Type JSON. Now I ...
0
votes
4
answers
73
views
httpCallout @future
can please someone tell me what I am doing wrong. I am only able to get 30 percent test converge. I am unable to get test converge for the http. Any suggestion is much appreciated Thank you!
public ...
0
votes
0
answers
254
views
How to use Named Credentials in a Basic Auth callout with API key?
This initial code works perfectly to do a Callout with UN, PW and API key in Custom Settings.
But this is less secure and so I want to move teh UN & PW to Named Credentials.
but it fails.
This ...
3
votes
1
answer
343
views
Cannot download large files from Salesforce URL using C#
I'm new to Salesforce. I am trying to download a large file (around 13 MB) from Salesforce which needs to be uploaded to Azure Storage using C#. Below is the URL sample:
https://mysampleinstance.my....
0
votes
1
answer
36
views
Error While POSTing to a third party PDF and additional parameters
I am calling a rest api with multipart/form-data content type. I need to pass a pdf and additional parameters to generate a pdf. The appends the additional params data to the pdf and generate a new ...
0
votes
2
answers
293
views
SSJS - Cannot get the result of post request
I'm trying to send a post request via SSJS
var url = 'https://th-apex-http-callout.herokuapp.com/animals';
var payload = '{"name":"wesh moose"}';
var req = new Script.Util....
0
votes
0
answers
19
views
Need to write a test class for Http post class [duplicate]
@RestResource(urlMapping='/PioneerRxChangeEventListner/*')
global without sharing class PioneerIntPharmacyApiClass{
@HttpPost
global static ParentResponseWrapper doPost() {
// variable ...
-1
votes
1
answer
173
views
Iterate through API response to check for headers and index
In my Apex class I'm making a request to an API to retrieve data. The API returns the data in the form of a CSV string.
Apex:
public static String callMyAPI() {
HttpRequest ...
0
votes
1
answer
86
views
How to send attachment/contentdocument to external system using Apex
I am trying to send a simple test document to the external system.
The request goes through well when I do it using Postman but as soon as I try to send similar request from salesforce it comes back ...
0
votes
1
answer
131
views
How to encrypt sent data using the XMLHttpRequest and retrieve it via AMPscript?
Our client is looking for a preference center where there is no page refreshing, the user click on submit and a message pops up
I did not do this before, so I made an example to achive this, with a ...
0
votes
0
answers
60
views
CDC and Formula Fields
We started an initiative and were in process of testing a POC using CDC for the first time in Salesforce. We knew of the 5 object limit when utilizing this feature and we were able to work with this.
...
0
votes
0
answers
39
views
Invoking 3rd party APIs via Salesforce Marketing Cloud
We intend to use the Journey Builder of the Salesforce Marketing Cloud in order to invoke a 3rd party HTTP-based API.
As far as I can tell, our only viable option is following the guidelines of: Build ...
0
votes
1
answer
411
views
The Test.isRunningTest() function is not working
I am using if(Test.isRunningTest()) condition to set the response code to 200 for code coverage related to my HTTP callout class, so that the success scenario gets covered. But in the coverage details ...
0
votes
1
answer
212
views
Tooling API Composite Request
I'm trying to create multiple flexipage records from workbench using the tooling API but I'm getting a 404 error "Resource Not Found". I followed the following resource: https://developer....
0
votes
0
answers
33
views
Files are getting corrupted when sent over http request [duplicate]
I am sending files to a third-party system through an HTTP Post request, whenever a new file is uploaded or attached under any of the Order records by writing a trigger for ContentDocumentLink Object. ...
0
votes
1
answer
273
views
XML request from apex
I need to post some data to server using XML.
The XML body of my request is
requestBody = '<?xml version="1.0" encoding="UTF-8"?><xmlreq><record name="...
0
votes
1
answer
403
views
Internal Server Error for a HTTP POST request [closed]
I am having a script activity that Posts an HTTP request. The issue is that sometimes, the request returns internal error(500). However, since this is an error and not an exception, my catch block ...
1
vote
1
answer
57
views
Basic GET request not working with name credential
I have a GET request I want to manage but Authorization Header is not working if I retrieve username and password from Named Credential.
String username = '{!$Credential.UserName}';
String password = '...
0
votes
1
answer
60
views
Sending a HTTP Rest Request to Microsoft Graph HTML formatting issues
I'm trying to setup an automated calendar invite using the Microsoft Graph API endpoint and APEX. I have successfully created a HTTPcallout the sends the calendar invite, but i am having trouble ...
0
votes
1
answer
47
views
Soap request and parse responce
I have URL which returns XML with session id when I run it from the browser.
http://11.111.111.11/scripts/webcrf.promasys/webui/dtp.p?name=login&userid=XXX&password=XXX&language=en
In ...
0
votes
1
answer
312
views
Retrieve API name of all profiles
How do I retrieve the API name of all profiles that exist in a SF organisation?
I can retrieve the API name of individual profiles via HTTP request:
public static String getProfileAPIName(Id profileId)...
-1
votes
1
answer
784
views
Error: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]
Myclass
public with sharing class soapServiceApexClass {
@future(callout=true)
@AuraEnabled
public static void createSOAPWebSevice(Integer x, Integer y){
...
0
votes
0
answers
59
views
String concatenation of endpoint modify the comportment of a Get request
string id = '12345'; // will be set dynamically
string endpoint = 'https:/sameEnpoint/leads/' + '12345'; //opt1
string endpoint = 'https:/sameEnpoint/leads/' + id; //opt2
string endpoint = 'https:/...
1
vote
1
answer
473
views
Named Credential ignores authorization header in apex
I have created a named credential, myNamedCredential, where Generate Authorization Header is True. When I look at the codebase, we have a trigger with code that will set the Authorization Header using ...
1
vote
0
answers
143
views
Attempting to get an http request with user input from LWC input field
I am trying to allow our Salesforce Users to paste a unique number into an input field on an LWC, then let an Apex Class process a named Credential HTTP request - currently getting an error and not ...
0
votes
0
answers
307
views
Batch Apex Class with HTTPCallout to Insert New or Update existing records
I'm struggling to make this work. I'm a very beginner developer and really need some help.
I need to connect to an external system, get the Contacts from a list and create new Leads in Salesforce. In ...
-2
votes
1
answer
157
views
Setting REST Request Body [closed]
I need to set below request body in a http rest callout which is working fine in postman.
[{
"notification_type": "complaints",
"notification_mode": "push&...
0
votes
0
answers
172
views
Will a Queueable Class run in series if it is recursive?
I have a scenario where I need to call an API from a trigger that will update a few fields from the API. The trigger is an after insert and is setup to avoid recursion with other triggers on the same ...
0
votes
1
answer
727
views
System.CalloutException: The URI is invalid
I'm doing a simple HTTP callout in Apex using a Named Credential with Username/Password authentication, but I'm getting a System.CalloutException: The URI is invalid.
What could be the cause here?
...
1
vote
1
answer
122
views
Every HTTP request I send gives a 401 Unauthorized code
I'm working on a trigger that will send an HTTP request on some records creation/updates.
I have developed the method the trigger should execute, however, every single HTTP request I send gets a 401 ...
2
votes
2
answers
2k
views
Execute SOQL query via REST API in apex
I'm trying to execute an SOQL query via REST API call because I want to retrieve custom labels (ExternalString) previous to a date and by Category.
I generate my query like this
Datetime limitDate = ...
0
votes
1
answer
302
views
Updating value from apex class
I am in the process of learning apex / salesforce.
I am trying to update a textfield, in the salesforce UI with the Account object, when a HTTP request is made.
So in the base class I made for the ...
0
votes
1
answer
84
views
base64 as parameter from RestRequest non valid for deserialize
I have a service that allows me to change a user's profile picture.
The petition type is POST, and it has the following structure:
{
"UserId":"0057E000008wDTRQA2",
"...
0
votes
1
answer
649
views
How to prevent 403 errors when using S3 presigned URL in image tag? [closed]
I'm having a signature mismatch issue when attempting to use signed URLs within image tags in an aura component. I call the controller to calculate the signed URLs for a number of different image ...
1
vote
0
answers
77
views
Parsing of Json response from Tooling API code [duplicate]
Please have a look through the attached debug log
Below is my code:-
Apex Class:-
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(Url....
0
votes
0
answers
63
views
Salesforce POST with both SObjects and ContentVersion [duplicate]
I'm trying to build functionality in Salesforce to allow a payload POST which would create multiple SObjects and ContentVersions (Images/PDFs mostly). I've built out a custom endpoint to handle the ...