Questions tagged [httprequest]

httprequest is the request sent by browser to server for particular resource.

Filter by
Sorted by
Tagged with
-1
votes
1answer
30 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
0answers
26 views

JSON error - Null argument for JSONGenerator.writeStringField()

Here's my code for creating, I used this code to update JIRA from salesforce @RestResource(urlMapping='/*****/*') global without sharing class JiraIssueController { @future(callout=true) ...
0
votes
1answer
26 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
1answer
20 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
0answers
14 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
0answers
29 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
1answer
42 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
1answer
99 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
0answers
30 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
1answer
37 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
1answer
59 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
1answer
21 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
1answer
24 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
1answer
26 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
1answer
36 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
1answer
155 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
0answers
31 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
1answer
94 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
0answers
58 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
0answers
27 views

Trying to insert records in contact builder data extension

I've been racking my brains for a few days trying to use SSJS to insert records into a data extension that i created to do some tests. the data extension is located at audience studio, its called ...
0
votes
0answers
133 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
1answer
46 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
0answers
80 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
1answer
383 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
1answer
37 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 ...
1
vote
2answers
750 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
1answer
43 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
1answer
39 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
1answer
215 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
0answers
44 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
0answers
51 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 ...
0
votes
1answer
92 views

Apex callout with Oauth Token from Trigger

I am currently trying to make a webservice callout via Apex to update some fields on an object. We have an insert trigger that is linked to an Apex handler class. To use the webservice, I must first ...
0
votes
1answer
201 views

How to replace _id with id in a JSON response using REST API?

I am making a GET callout to the URL: https://th-superbadge-apex.herokuapp.com/equipment?_ga=2.245262661.1986105727.1612691455-984520333.1610882684. In the URL, the id field starts with _id which I ...
0
votes
2answers
34 views

Dynamically add or remove a member variable of a class

I have a JSON request class: public with sharing class RequestANA { public Notice notice = new Notice (); public class Notice { public String idExternal; public String name; ...
0
votes
1answer
374 views

Compose a multipart/form-data request from apex without base64 encode

May you have already tryed this solution, that use base64 May base64 encoded request work for you, but sometimes add some blank spaces in your params or params values is not a option, that is my case. ...
1
vote
1answer
60 views

Make HttpRequest Callout to send binary data without corruption

I faced issues when tried to send binary data from Salesforce to external web services. To start with, I tried to send binary data from Salesforce to itself. I am trying to read binary data from valid ...
0
votes
1answer
23 views

req.setEndpoint not working when a string with resource name is add

I have a http request like this: req.setEndpoint('callout:RSM'+method); where method is a string with a resource name that depending on certain conditions changes the value the problem is just req....
0
votes
1answer
44 views

partner.soap.sforce.com Http POST request

What is the endpoint to POST <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/...
0
votes
1answer
174 views

How can i send PUT request with a JavaScript button

I need the send PUT request to my SalesforceMiddleware project using with javascript button, with that situation i used the resource below: sforce.connection.remoteFunction https://resources.docs....
2
votes
1answer
403 views

How to properly send a Json in the body of a POST request?

I'm trying to do the same I accomplish with postman but with Apex and I'm not being able to do so: I need to send a POST request to this example endpoint: https://cccccccccccccc/api_jsonrpc.php This ...
0
votes
2answers
288 views

SWAPI - Error 301

i need to make an HTTP Request with Apex to the Star Wars Api but keep getting an error status 301 in the response. I don't know what to do anyomre, it's been a few days. If I make a fetch in Java ...
0
votes
1answer
35 views

Future Callout External Webservice CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, execution of AfterUpdate

When a Lead is created, I have a trigger that references a class that calls an external webservice, that digests its response, and should update a field called region_code__c from a value in the ...
1
vote
1answer
110 views

Deploy Metadata with Apex Testing Using REST error

I'm trying to deploy some ApexClass from Apex to Production Org using multipart/forma-data to /services/data/v48.0/metadata/deployRequest following docs. In the documentation is this example: POST /...
0
votes
1answer
37 views

Variable does not exist: MEDIA_TYPE__c [closed]

I have created custom fileds in Big Object to save my logs there. And trying to assign one of custom objects public class my_Log { public static void log(EventType eType, String requestId, ...
1
vote
1answer
502 views

SSJS: read response headers from Script.Util.HttpRequest object in SFMC

We need to retrieve the response headers from an HTTP GET call issued in SSJS with the Script.Util.HttpRequest function. Unfortunately, even though it seems straightforward and the task itself is ...
0
votes
1answer
122 views

SSJS Error on HTTP.Post

I'm facing an issue on sending an HTTP post request from Marketing cloud to ElasticSearch using SSJS. The aim is to send some import statistics of flat files to ElasticSearch in order to retrieve it ...
1
vote
0answers
47 views

Constructing a multipart/form-data request for transmitting a PDF to an external service [duplicate]

I'm trying to make a POST request to this specific endpoint from Apex to include what is required; a task Id and a single file. It has been very difficult. At first, Bad Request responses was all I ...
0
votes
2answers
828 views

What is Salesforce Daily api limit per user per 24 hours?

According to Salesforce Documentation, Salesforce Unlimited editions have a limit of 5,000 API calls Per License Type, per 24 hours and the total API calls per 24 hours are: 100,000 + (number of ...
1
vote
1answer
92 views

add custom headers for my custom Soap Apex webservice

i created below custom Apex Soap Webservice then i am able to get wsdl and shared to client for call SF, but i want to add some custom headers to my apex soap webservice, so that client must be add ...
0
votes
0answers
26 views

How to Store HTTP Request Code in separate class for Reusability? [duplicate]

We have JSON HTTP Post request that triggers from one salesforce object to external system and we want to extend this functionality for other object. This code Fires and creates a Record in external ...

1
2 3 4 5
8