Questions tagged [httprequest]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
29 views

Is it possible to populate a Picklist with the results from API callout? [closed]

I have an API callout which returns a JSON containing the project names (for an external application) the currently logged-in user has access to. I would like to dynamically populate a picklist with ...
1
vote
1answer
24 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
55 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
20 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
21 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
41 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
27 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
45 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
35 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
28 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
27 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
97 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
18 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
19 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
13 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
101 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
130 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
149 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
28 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
70 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
36 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
176 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
74 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
42 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
207 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 ...
0
votes
1answer
38 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
25 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 ...
0
votes
0answers
124 views

How to change Marketing Cloud Http Request timeout?

Is there a way to change MC Http Request timeout? I think that the default is 30 seconds, but the process we are POSTing to via a form can take more. I'm using SSJS for the call: var result = HTTP....
0
votes
0answers
15 views

403 error on callout to service ran locally [duplicate]

I have a service I'm running in a docker container locally, listening in port 8000. The service is non http secured. I'm trying to send a GET request from my apex code to the service and getting an ...
0
votes
0answers
38 views

Problem with Apex HTTP callout POST Test [duplicate]

I get the following error: "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out" when executing my test. The code coverage is already at ...
0
votes
1answer
36 views

Problem with testing void HttpRequest

I can only get 23% code coverage with what I have. The http request in the method is not getting covered for some reason.. Here's what I've tried: Class: public class PostClientes { @...
0
votes
0answers
23 views

Is it possible to get content of a file from downloadable URL? [duplicate]

I am trying to send email with attachments. My goal is to get the content of a file from downloadable URL, then build the attachment for sending email. There is a standard solution provided by ...
2
votes
1answer
47 views

HttpPost method test will not run: Method does not exist or incorrect signature: void doPost() from the type MyOriginalClass

I have a test like below. and the error: Method does not exist or incorrect signature: void doPost() from the type MyOriginalClass In MyOriginalClass, the method has parameter like doPost(String url) ...
0
votes
1answer
37 views

Httprequest doesn't work in batch although Database.AllowsCallouts implemented

We are planning to start new integration functionality to a new system in our landscape (Workday). To do this we created integrations in apex with httpcallouts. We are planning to start the initial ...
0
votes
1answer
239 views

Apex, HttpRequest, Named Credentials

i have to make an httpRequest with apex to an external site. Problem: I have to securely store an API Key somewhere in salesforce so that it's possible to use in apex The header of the request must ...
0
votes
1answer
28 views

Error Invalid Conversion from runtime JSON to APEX

I am getting an error while converting the response from JSON to Apex class. Invalid conversion from runtime type MapAPIDemo.resourceSets to List<MapAPIDemo.resourceSets> Here is the code below ...
0
votes
1answer
52 views

http callout `Client credentials are missing` by using Basic Auth

I am trying to get the access token by calling PayPal API,I Am getting Client credentials are missing response. public static HttpResponse GetAccessToken() { Http http = new Http(); ...
3
votes
0answers
303 views

Executing multiple callouts from a future method

I have a problem when I try to execute multiple callout from a method of an Apex Class. The method code is the following: @future(callout=true) public static HttpResponse makeCallout(){ List<...
1
vote
1answer
104 views

Charset is set incorrectly to us-ascii instead of utf-8 when sending email from Marketing Cloud

We have an issue where an email sent from a journey is rendered with '????????' instead of Hebrew letters. We examine the mime code header (within the .eml file) and found this: Content-Type: text/...
0
votes
1answer
128 views

Bulkify trigger to future Callouts

I asked another question on the future callouts which was throwing the SystemLimitException, the recommendation was to use the Queable or making the future Callouts bulkified from the trigger. I tried ...
0
votes
1answer
109 views

Future Callout Throws: System.LimitException: Too many future calls: 51 [duplicate]

I am trying to call the external API endpoint from Salesforce when an account is created. I created a trigger on the Account which looks like below trigger createSegSubSegmentD on Account (after ...
0
votes
1answer
259 views

Apex rest service issue with HTTP Post method when i Access from Postman

i created Apex rest service and @HttpPost method , i am able call POST method & got data in request body successfully from workbench. but i had issue with when i try to access from Post man. i ...
1
vote
0answers
63 views

CORS problem in Lightning

My Lightning component makes 'GET' callouts for two different URLs of the same service. For one it goes correct each time: https://cors-anywhere.herokuapp.com/https://integration.visma.net/API/...
1
vote
2answers
526 views

How do I get correct base64 data present in VersionData field in ContentVersion through jsforce?

I am using jsforce to query VersionData field in ContentVersion object. However, it returns me the URL to the base64 data instead of the actual data. If I make a GET request to the URL (using the ...
3
votes
1answer
69 views

How to use a Named Credential for custom authentication that needs more than username, password to generate a secure token(X-Auth-Token)?

Premise We're currently storing the following parameters used for integration with a home grown web service: username password tokenKey initVector The below code is used to generate an ...
0
votes
0answers
80 views

For loop and insertData with ssjs

Anyone experience with using for loops to insert data into a data extension dynamically? I normal javascript I would use a forEach statement. I have the following JSON array (retrieved using HTTPGet) ...
1
vote
0answers
136 views

INVALID_TYPE ERROR while querying using REST API

I'm trying to run a query using REST API (RestSharp). This is my query: [SELECT Id FROM Account] This is my code: RestClient m_Client = new RestClient("https://my_instance.salesforce.com"); string ...
0
votes
0answers
41 views

How to pass Username and password of Named Credentials in HTTP Get [duplicate]

I am trying to send an send a request using get method of HTTP Request and I need to pass the username and password of Named credentials in the URL as username as clientID and password as the client ...
0
votes
1answer
110 views

How to do basic auth to acces external url and advoid System.HttpResponse[Status=Forbidden, StatusCode=403]

I have a basic auth which I have working with Postman but when I do this with apex I get an Forbidden error. The variables userKeyVal and userSecretVal are filled correctly, my url is correct and I ...
0
votes
1answer
68 views

Fetching data from Tempo API fails [closed]

I am trying to fetch data from Tempo API. I added and enabled Tempo URL in Remote Site settings. Now I am making a query to their API and it fails with error Unable to tunnel through proxy. Proxy ...

1
2 3 4 5
8