Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [callout]

"HTTP Callouts" connect to a remote web server from Apex code.

1
vote
1answer
18 views

Test error condition in finish() method of Batchable class

Trying to figure out how to test error condition in the finish() method of this Batchable class. I am testing the error condition in the execute() method by calling it separately in the test and ...
1
vote
1answer
23 views

Test error condition in batch class with callouts

I have an Apex class with a callout (oregonDistricts.apxc) and I have two tests written that test both the success and error conditions. These tests are passing and the class has 100% code coverage. ...
0
votes
1answer
19 views

How to redirect to external url from apex from callout response

I have a class from which I do a callout in apex. After the response of the callout I want to redirect the user to an external url how can I achieve this?. I have only been able to redirect ...
2
votes
1answer
24 views

Future method is not invoked from PostInstall script

I'm trying to create a future method that makes a callout, and for some reason it's not invoked when the script is done. postInstallScript.cls: global class postInstallScript implements system....
0
votes
1answer
15 views

System.UnexpectedException: Invalid parameter value for parameter “Decryption Exception”

I tried to execute some code in a sandbox and I got an odd error message: System.UnexpectedException: Invalid parameter value '****' for parameter "Decryption Exception". Looks like it happened ...
-1
votes
0answers
9 views

How can we send an image from sfdc using multipart/form-data [closed]

I'm trying to integrate a third party system with salesforce, this system requires that the request post a multipart/form-data body which contains JSON parameters and the image file. Could any one ...
0
votes
0answers
22 views

Uploading CA-Signed CRT to Salesforce?

I have an existing CA-Signed Certificate (CRT) given to me by my client, and it is needed to be able to make callouts to their external system. I have not found a way to be able to upload a CRT to ...
0
votes
2answers
21 views

Parse JSON using APEX provided JSON Methods

Salesforce rockstars! I'm in need of some help, and thank you in advance for taking the time to review my question! I'm pretty new to Java/Apex, and most of the work I do is with internal Salesforce ...
1
vote
1answer
22 views

Prevent parallel executions of flow element

I have a screen flow that is included in a lightning record page. At some point it executes a callout to an external system. The scenario that I would need to avoid is to have multiple users open the ...
4
votes
1answer
153 views

Sync with Pardot by Apex Trigger | Duplicate send to Pardot button in Apex

I have Pardot installed in my SF sandbox and it is connected to a Pardot Sandbox. [Use Case]: If a prospect is in the recycle bin in Pardot, then it does not sync with Salesforce. If from a ...
0
votes
0answers
21 views

Getting Bad Request from Post request to SharePoint Rest API from APEX

Hi i am doing a post request for delete a folder in sharepoint from salesforce i am using below code string Authorization = 'Bearer ' + spa.basicAuthCallOut(); HttpRequest req = new HttpRequest(); ...
0
votes
1answer
39 views

REST Integration - JSON Serialization/Deserialization alternative to wrapper class

I am building a REST integration between two Salesforce Environments. One environment will be used to setup and stage Data and when ready the Integration will be able to push data from the src to the ...
0
votes
2answers
36 views

I am not getting refresh token on outh2.0 using Connected App in salesforce

I created one connected app in Salesforce. I am doing every time two callout one for outh2.0 and another for actual apexrest callout. I want to avoid outh2.0 callout every time. The following solution ...
1
vote
0answers
15 views

MetadataService in apex overriding the IP ranges on Profile instead of adding the new onces

I have requirement to update ProfileLoginIpRange on the profile. Lets say there are 5 IP ranges already added on the profile and I want to add 1 more to it. Code Used, MetadataService.MetadataPort ...
0
votes
1answer
31 views

Execute HttpRequest as a different user

We have a scenario that user invokes a callout via lightning component button. Its an http request to an external service, and on response - there is an update in SF. We would like that the running ...
0
votes
1answer
62 views

call Messaging Queue every 5 Minutes [closed]

I want to make Integration between Salesforce and ActiveMQ(Is is a messaging server where the company send and save messages in this service). The Context: Every 5 Minutes should salesforce a ...
2
votes
2answers
49 views

Unable to do callout from PostInstall Script

As per the Salesforce documentation, Post-Install script can perform callouts using an async operation only. https://help.salesforce.com/articleView?id=apex_post_install_script.htm&type=5 So, I ...
0
votes
1answer
49 views

How to do a dependent callout from a future callout

How do I send a future callout to an external system inserting an parent object and as soon as I get the response back with an external id send another callout with a child object to an external ...
1
vote
2answers
46 views

Make http callout in batch after insert actions

I have a batch job with http callout enabled, in the execute() method, the code logic goes like: global void execute(Database.BatchableContext BC, List<Object> scope){ List<CustomObject&...
0
votes
2answers
274 views

Yahoo API callout failing

Below code was working fine few days back. Suddenly stopped working and throws error. String endPoint = 'https://query.yahooapis.com/v1/public/yql?q='; String queryUrl = 'select item.condition from ...
1
vote
1answer
70 views

MetaData API and Tooling API

Is it possible to get below things using Apex: I want to get field Updates that are used in a particular or all WorkFlow rule/s. I want to get Workflow rules and approval Processes that are ...
-1
votes
1answer
42 views

Chunk Account list into List<List<Account>>() based on a condition

I am having trouble with a small piece of code. I am calling an API, with List of accounts address. API is working fine, but it gives error when URL endpoint length exceeds 3500. I have a look on ...
0
votes
1answer
32 views

How to execute class or method after update external id from post callout

I have a custom object in Salesforce with a set of fields. Some of the fields I sent over by an invocable method which calls a future method to send the first set of fields to entity in an external ...
0
votes
0answers
17 views

Authenticated Callout to Webservice using SSO

We are facing the following problem. We need to make webservice callout through Mulesoft in a way the user is making the call is not a service user, but the logged one: Both Salesforce and ...
1
vote
3answers
58 views

Increase the callout time limit from 120 seconds to more

I am calling a REST API from my Salesforce instance which generally takes 100-150 seconds to process and return the result. The cumulative apex callout time limit is 120 seconds. Is there any way ...
-1
votes
2answers
57 views

Iterable Batch Apex

I want to write a batch class and need to make a webservice callout from it. Once the response is returned in Json format. I want to process the same into objects of salesforce. So I know how to make ...
0
votes
0answers
31 views

Can APEX Capture Cookies in Callout HttpResponse?

I'm trying to post data from my org to a third party using a REST API they've provided for us. The process for this is: POST client_credentials (client_id and client_secret) to obtain access_token ...
-3
votes
1answer
84 views

I am getting error System.HttpResponse[Status=Server Error, StatusCode=500] for the following code [duplicate]

I am runing my code from anonymous window HttpRequest req=new HttpRequest(); Http http=new Http(); //Header req.setHeader('Content-Type','text/xml'); req.setHeader('SOAPAction',''); //Body String ...
2
votes
1answer
42 views

Mock REST and SOAP callouts in the same method

I'm trying to figure out how to test a controller method that does both REST and SOAP callouts in the same transaction. Here is the pseudo code: HelperClass public static void restCallout(){ // ...
0
votes
1answer
92 views

Read Time Out Exception

I am calling REST API method to update some data to another system from apex but getting "common.apex.runtime.impl.ExecutionException: Read timed out" exception. Here is my request code HttpRequest ...
0
votes
1answer
39 views

XML-RPC support in Apex

We have an existing external system whose API documentation mention that the client system should support XML-RPC specification. To consume the services on this external system, can we directly do a ...
9
votes
1answer
622 views

How do I unit test code that includes a callout?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
0
votes
1answer
23 views

How to callout second time if first request gets timed out

I have been asked this question and I am looking for possible approaches for such scenario. If I make an callout to an external service and if don't receive any response and gets timed out and then ...
0
votes
1answer
11 views

Composite Rest Salesforce

Can we use composite(tree or batch) rest to send multiple POST request to third party(non salesforce endpoint) in a single send call ?
0
votes
0answers
126 views

“Connection reset” exception when sending a callout (HTTP.send())

We have been receiving this intermittent exception when trying to make a callout for a few months now ("Connection reset" is the exception message): Connection reset Class.Sip_HttpUtil.callout: ...
0
votes
1answer
31 views

call out method is not called in a continuous class, call out from VF page

I was trying to do a callout from a VF page constructor. I'm using Continuation class. As I've to show the response in the Page. Yhe problem is the callout method is not called. Below is the code, I ...
2
votes
0answers
50 views

HttpResponse Error 502 on callout to internal URL

Recently, I deployed a change set to my organization production environment. On production, it works fine, but on community my callout doesn't look to work as expected. Basically, on my code, I make a ...
0
votes
1answer
121 views

Callout from scheduled Apex not supported: Retrieving token

I have a scheduled batch class that updates my order payments however I am receiving an error that the callout is not supported. I have read other posts that for batch classes if Database....
0
votes
1answer
51 views

test class with Batch and Callout [duplicate]

I have a problem with FeedItems in my Test class, it's very weird behaviour Does someone explain to me why this happens? Callout Class public with sharing class Callout { public static void ...
0
votes
1answer
35 views

APEX Would like to validate my approach [closed]

I have written the following REST callout to update Club & Players custom object. Based on the API ID club information is fetched and updated, same for players as well. For players I need to check ...
6
votes
2answers
200 views

Is this test for callout wrong? How to make a bulk?

I wrote mock and test for callout, but I don't think it's right. I think I check wrong things with asserts and maybe call the same methods a few times, while have another ways to get 100%. Have I? I ...
0
votes
1answer
31 views

Malformed JSON: Expected '[': wrong test, callout or mock?

I have System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set and I don't know how to fix it. Callout: public class Callout { public List<Tool__c> toolsList; public ...
1
vote
1answer
119 views

Salesforce limit of synchronous rest service

I have to implement in salesforce many inbound synchronous rest services. What are the salesforce limits that I have to consider? I found only the following: API Requests. A long-running API request ...
0
votes
1answer
112 views

APEX making HTTP Request, and It fails

I'm trying to make an http request, with the UserInfo.getSessionID(), in the authorization value, to https://{{INSTANCE}}.salesforce.com/services/data/v43/ui-api/record-ui/{{sObjectID}} and It ...
0
votes
1answer
27 views

Prevent Record Update Synchronously via External HTTP Call

I'm integrating Salesforce with an external system, and updates to records in Salesforce need to be kept in sync with the system. If the request to the external system fails, the update in SF should ...
0
votes
1answer
63 views

Limits of Batch, REST API: how to get 2000+ records, not just 250?

This code works, but I can get only 250 records even if on other side 2000+ records. I think my batch is incorrect. How can I make a few callouts per 1 time to get 2000+ records from service side? ...
0
votes
2answers
45 views

What's wrong with my Batch Apex + Http callout get method?

I think my code is wrong. Last version of my HttpGet/Callout code (it works): How to use HttpGet service to get a list of objects and create them? Now I try to make it batch. My Execute Anonymous ...
4
votes
3answers
612 views

Confused by CalloutException

I have a trigger on Account and Opportunity - both do a callout to the Google Geocoding API and then update itself using a future method. Now I also want to send an email before the update if certain ...
1
vote
1answer
27 views

HttpGet and Callout: is not a valid Salesforce ID for the type

I get Item's list from 1 organisation and want to insert them like Another Items in 2 organisation. But it try to insert it with Id. How can I fix that? Error: System.DmlException: Insert failed. ...
1
vote
1answer
151 views

How to use HttpGet service to get a list of objects and create them?

I have a callout method which helps to get an list of objects from another salesforce-organisation. But how can I convert this list into objects on callout's organisation side? And how can I do this ...