Questions tagged [httprequest]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

HTTP response code to be used

I have a scenario where we are not able to process a json request due to DML errors . What standard HTTP error code can be used in this scenario . 422 is my pick but wanted to know if there is some ...
0
votes
0answers
5 views

Apex HTTP Get request with setBody is automatically makes the callout as POST [duplicate]

I am trying to do a GET request with a JSON body. It works fine with POSTMAN but same in Apex the callout is automatically getting converted to the POST method. And if I remove the req.setBody(body); ...
0
votes
1answer
16 views

Add new picklist values to all Record Types that use this Global Value Set

I'v been used tooling API for update Global value set. but now the new picklist values i'v added doesn't display at the picklist field. I'v notice to the check box when adding new values to global ...
0
votes
0answers
22 views

Using username password callout using NameCredential

I am able to make an apex callout by passing the username and password in the request body. public class RestCallout{ private String rootPointURL ; private static HttpRequest HTTPREQUEST = new ...
2
votes
1answer
62 views

Multipart form data uploads only the first file when using HttpFormBuilder ( try with given RestEndpoint and Anonymous Apex)

I am using the same solution as Daniel provided : When I use the below method to upload file, one by one, it works fine, jpg, pdf, docx anything. But when I try to upload multiple files using the ...
-1
votes
0answers
15 views

org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte Ef in state 2

I am Uploading Pdf file please help me, I am getting the error org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte Ef in state 2** public static void uploadFile(Blob ...
0
votes
1answer
16 views

Receiving an abnormal amount of unexpected errors when calling PATCH request

I'm not sure what is causing these errors as when I single them out and run them again, they run just fine. Here is the response log: [, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ...
1
vote
1answer
28 views

Cannot deserialize instance of date JSON_PARSER_ERROR when no date present while patching

I am working with a Google Apps Script to upload data into Salesforce. Everything works except I am running into this error when a date is not present in a date field, which happens only occasionally ...
2
votes
3answers
346 views

Apex HttpMethod with two possible returning types

Is it possible to make an apex httpMethod return two different kind of data type (DTOs). When I try to do : global static Object myMethod() I get this error : HttpGet methods do not support return ...
1
vote
1answer
132 views

Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable”

I'm perfoming a HTTP GET callout to an external cURL connected through proxy, using Postman i get the response. However, while making callout from Salesforce, it gives the following error: System....
-1
votes
1answer
22 views

Test class for Http Request code coverage is 50 percent [duplicate]

I have a class public class myclass { @AuraEnabled public static List <Json2Apex> customerData(String startDate, String enddate){ List <Json2Apex> LSData = new List &...
0
votes
1answer
27 views

Xero Invoice - API Character limit in Apex Salesforce

I'm new to salesforce and i'm trying to Integrate Xero Invoice. While calling the API GET https://api.xero.com/api.xro/2.0/Invoices/ i've got one question in my mind that what will be the character ...
0
votes
1answer
30 views

Simultaneous HTTP Callouts from Lightning Component with a single callback

I have a case where I have to call a 3rd party's API anywhere from 1 to 5 times, and I would like to have the page have a "loading" screen until they have all completed. Ideally, I would want these ...
0
votes
0answers
53 views

Apex Callout to Rest API throws error

I need your advice on testing the integration of third party Rest API from apex like below public class Testing { public final String clientId = ‘xxxxxxxxxxxx’; public final String ...
0
votes
1answer
21 views

get the source domain from a post request

Third-party need to send Data to Salesforce using Https post request - They cant handle token access so it must be a force.com site. I referred an Apex class to the site (Without using VF page), by ...
0
votes
1answer
34 views

Testing Apex Trigger with Asynchronous HTTP Callouts

I have an apex trigger f_contactPushNotificationTrigger that should fire when a new contact is created. This trigger call f_PushNotification class used to Post data. I used @future to make this task ...
3
votes
2answers
80 views

Best Practice deserialize a JSON to avoid heap size limit

I'm sending an HTTP request to get a JSON of Students. The JSON is a complex JSON with arrays and its break into 3 objects in Salesforce. I'm using a class (JSON2APEX) to deserialize the JSON. Some ...
1
vote
2answers
194 views

Callouts using the @future annotation or Queueable

I have a contact trigger and I need to make a callout (GET) from trigger whenever the email of a contact is modified. I know I can do this from the @future in trigger, but online I see many examples ...
0
votes
1answer
47 views

How to make my REST Callout Efficient?

I am looking at using an email verification tool like ZeroBounce to verify that we have the correct email data. They have an API that we can connect to, which is great. Now I am trying to understand ...
0
votes
0answers
84 views

ERROR_HTTP_414 - <h1>Bad Message 414</h1><pre>reason: URI Too Long</pre> on VS Code

I am trying to push the code to my scratch org through VS Code using following command - sfdx force:source:push --json --loglevel fatal But getting following error on VS Code. ERROR_HTTP_414" - "...
1
vote
1answer
29 views

Flow HTTP Request Using External Services - Data Not Coming Back From Endpoint. Troubleshoot?

I'm trying to play with External Site Settings-based HTTP callouts from Flow as seen in last Friday's Spring '20 release webinar for admins ("External Site Settings" explanation & demo starts at ...
0
votes
1answer
128 views

Apex callout issue

I have an endpoint which is working by disabling SSL certificate verification in Postman. Also I add a CA certificate and client certificate details. Through Postman I am able to get a response. But ...
1
vote
0answers
34 views

'uncommitted work pending' callout exception thrown in *tests only*

I am converting a lead in the Execute method of a batch class, then making 2 callouts with those results in the Finish() method. It works gloriously and throws no errors. However, in the test ...
0
votes
2answers
58 views

Unable to retrieve security descriptor for this frame error in HTTP POST request SSJS marketing cloud

I am trying to post a request to my site and I am using SSJS HTTP post method. But the POST request is throwing error "" Unable to retrieve security descriptor for this frame. Im not sure what i ...
1
vote
1answer
43 views

How do I fix an invalid request in JSON format?

I'm trying to send and SMS through serwersms and creation a Callout with JSON. This request works fine: https://api2.serwersms.pl/messages/send_sms.json?username=LOGIN&password=PASS&phone=...
0
votes
2answers
22 views

Checking domain from where my webservice request is being made

I have several webservice requests being made via APEX to external systems, right now we would like to add the domain from where these requests are being made to our clients firewall. Where can i ...
0
votes
1answer
29 views

Response to Http request - response

I'm making integration to an external system and send them a request, and I get a JSON as a response via REST API. The response has a lot of data to upsert to SF. While upserting the Data inside the ...
0
votes
1answer
93 views

how to query job batches info bulk api 2.0

Before, using bulk api 1.0 endpoint. I could make request to get all job's batches like so: ` req.setEndpoint('callout:BulkApi' + '/' + jobId + '/batch'); req.setMethod('GET'); req.setHeader('...
0
votes
1answer
35 views

Tooling API response, how to print in log?

I’m trying to print (system.debug) the response returned from tooling API but the debug is not displaying anything. So, I was wondering if the code below is correct. HttpRequest req = new HttpRequest(...
0
votes
1answer
590 views

Parse child JSON object in JSON array

i am trying to parse a response which is a json object that has JSON array, what I need is to get value in the specific object from the array, inside "results" I'd like to get value from key "id" ...
0
votes
0answers
75 views

error“:”Unprocessable Entity“,”message“:”Server could not parse JSON"

I'm having with JSON parsing when I send PUT request via APEX, I create variable for the body and put in req_put.setBody(data_comment) and get the error error":"Unprocessable Entity","message":"...
0
votes
0answers
68 views

Continuation callback method is not invoked

The actual code is very big, I tried to simplify it as much as possible. The design is such we cannot call the continuation method directly. So looking for ways of invoking it. Many thanks! VF Page ...
0
votes
1answer
78 views

Apex Class Array to JSON - Blank data is being sent

The requirement is to send an array (Item text to JSON from APEX Class). The issue is APEX Class is passing empty array to JSON. ("ItemText":[] ) JSON code below <ns0:QUOTATION_TEXT> {%- ...
0
votes
0answers
673 views

System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable” ERROR

I'm trying to make an HTTP Request to other System. They provided the endpoint URL which contains a Port number. https://Test.com:50001/RESTAP/BGN/PRDV/CREATE When I'm trying to make the request I'...
0
votes
0answers
122 views

Keep getting WSA Action = null error and null header for Http Request

I am trying to post XML data to an external service using an endpoint WSDL. I have set up a Named Credential in Salesforce with authentication. When I run the code below I get the following error: &...
-2
votes
1answer
377 views

System.JSONException: Unexpected character ('<' (code 60))

I am trying to connect another org using user agent auth flow, I am getting auth code and passing it to apex method and then I am getting the below error. private static final string ...
0
votes
1answer
968 views

How to get file name in http response?

I am using apex code to get file from url and able to insert it as attachment. I would like to know file name as well while insert ? When I open link in chrome it save the file with file name. ...
0
votes
0answers
129 views

Has anyone solved the error 415 (Unsupported Media Type) in salesforce?

Has anyone solved the error 415 (Unsupported Media Type) in salesforce ? I tried to upload a file to ContentVersion via rest api request but it 415 error will be returned by my org. Is there any ...
0
votes
1answer
64 views

Named Credential Tooling API SOAP Envelope

Attempting to switch from using custom setting to named credential for authentication. I've updated the http request endpoint to use the named credential but how to update the SOAP envelope to not use ...
0
votes
1answer
246 views

HTTP request - Whitelisting

I need to send an HTTP request to an external Server. They need to open my permissions there and they asking for my URL OR IP address. Since I using Salesforce and it's on the cloud, I don't know ...
0
votes
0answers
35 views

Auth Provider for Trello?

I've spent too many hours today trying to set up an Auth Provider + Named Credential for Trello's auth flow... I guess my question is, for those who have dealt with Auth Providers in SFDC, is this ...
0
votes
2answers
430 views

call tooling API when using lightning component [duplicate]

When I make request tooling API from Apex by using lightning component, the error This session is not valid for use with the REST API is responsed. Also, the response status code is 401, and status is ...
3
votes
1answer
3k views

System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable”

I'm trying to make an HTTP Request to other System. They provided the endpoint URL which contains a Port number. https://Test.com:50001/RESTAP/BGN/PRDV/CREATE When I'm trying to make the request I ...
2
votes
0answers
151 views

Sending 100KB attachment via HTTPRequest throws System.UnexpectedException

I'm trying to upload an attachment from SF to a third party server using REST API, First, my third party does not support base64 content-transfer so I cannot send from SF a base64 attachment. ...
0
votes
1answer
169 views

HttpResponse with status code 0 [closed]

I am using an API to get some response. When I check my HttpResponse. It is like this: System.HttpResponse[Status=null, StatusCode=0] In what case we get such a response?
3
votes
1answer
389 views

Using Named Credentials in OAuth 2 authentication (grant_type=password)

I want to get an access token from an external endpoint (HTTP callout to REST API) without hardcoding passwords. The external system expects a request with Oauth 2.0 authentication details provided in ...
0
votes
0answers
213 views

How to fix callout error — You have uncommitted work pending. Please commit or rollback before calling out? [duplicate]

I'm doing an upload attachment to AWS, but I'm getting this error -- 'You have uncommitted work pending. Please commit or rollback before calling out' How do I fix this? @AuraEnabled public ...
3
votes
1answer
868 views

JSON Serialize and Deserialize on HttpRequest

In order to make a @future(callout=true) call, I'm serializing an HTTPRequest object in order to send it to the @future method accepting a String jsonHttpRequest parameter. Instance Method ...
1
vote
0answers
153 views

Whitelisting Marketing Cloud for SSJS and custom Journey Builder activities

I'm trying to get Mulesoft open for data coming from the following sources in Marketing Cloud: custom Journey Builder activities server-side JavaScript (HTTP requests) Ampscript (HTTP requests) ...
0
votes
1answer
27 views

When using the Favorite API to get all the favorites for the current user it returns as Http Response the Code: 302, Status: Moved Temporaly]?

I am using as reference this documentation: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_favorites.htm And it says that by doing an HTTP GET request to this url ...

1
2 3 4 5
7