Questions tagged [callout]

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

161 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
0answers
1k views

Including access token in endpoint URL when using named credential in REST callout

I'm trying to retrieve a list of forms using the FormAssembly API via a HTTP Request to the endpoint: https://app.formassembly.com/api_v1/forms/index.json I was able to setup named credentials and ...
6
votes
0answers
135 views

Why inserting a user object and making callout in a test throws CalloutException in Production?

I stumbled upon strange behavior when executing tests on deployment to production organization. In the test, I first insert a User object, some other objects and then as the last one, a CampaignMember ...
5
votes
0answers
32 views

How can I unit test a http callout that uses a certificate?

The .setClientCertificateName method of the HttpRequest class requires a string that is the name of a certificate in the organization. In a unit test class, is it possible to mock this method? When I ...
5
votes
1answer
203 views

AWS Signature Version 4 Using Named Credentials

Anyone tried Summer '19 Named Credentials using AWS Signature Version 4 successfully? Trying again to use External Services and first step is the Credentials. I created an IAM user with the ...
5
votes
0answers
244 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 ...
4
votes
0answers
7k views

CalloutException: Read timed out error after increasing timeout

I have simple code to send a get request to our webservice that returns a small json response: System.HttpRequest request = new System.HttpRequest(); request.setMethod('GET'); request....
3
votes
0answers
212 views

Trying to call API through Apex with custom security certificate but getting CalloutException

I'm trying to use Apex to call some API endpoints to do some validation for my company. There are some specific properties of these APIs that make it a bit tricky: The APIs are hosted on self-...
3
votes
0answers
106 views

How to set up a test user in a unit test that invokes a callout from a future method

I want to do the following in a unit test: Create a test user to invoke System.runAs with Update a case record and then invoke a future method that has a callout in it Check the result Turns out I ...
3
votes
2answers
516 views

Automatically refresh a standard page layout

I have a webservice callout, and therefore I update a field on pagelayout according to the callback. The problem is I have to refresh the page layout (F5) everytime to see the field updated on my page ...
3
votes
0answers
347 views

Callout loop not allowed error while calling external service from an apex rest resource - SKUID

I want to fetch VIN details from an external webservice by callouts, this should be fired from SKUID page once user given input on the required field. From Skuid i am calling apex class which is ...
3
votes
0answers
727 views

Question on Queueable interface

I have a class implements Queueable interface. 1.Do I have to annotate the method with @future in my class? I received "Callout not allowed from this future method. Please enable callout by ...
3
votes
1answer
394 views

Callout to web service doesn't work depending the profile I'm using

I have a customized button that once you click it, a new window it's open displaying some data from an external app, getting the data through a SOAP web service. If I'm logged as System Administrator ...
2
votes
0answers
71 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 ...
2
votes
1answer
669 views

Is there a way to parse Json in Flow

I am have created an external service using the integrations beta feature in Salesforce. You can use the Apex actions created by this service in Flow. The problem that I am facing is that Apex call ...
2
votes
0answers
122 views

Post callout behavior assertions for unit test with static resource callout mock fail

I have a working queueable callout, and working tests using static resource callout mock I can successfuly run basic assertions on the mock response body and status. However, the callout method in ...
2
votes
0answers
314 views

Pass Account ID to Webservice

I am trying to call an external webservice and display the data in a Visualforce Page. First how do I pass a parameter to the external Web service? This is what I have done so far: Created the ...
2
votes
0answers
477 views

How do you use Named Credentials with a Google Cloud API, which requires a JWT to get a token?

Is it possible to used named credentials with a service account to connect to the Google Cloud Platform? I'm trying to make a client to send Pub/Sub messages to Google Cloud from Apex, and it'd be ...
2
votes
0answers
173 views

Connect to Microsoft Dynamics GP from apex

I would like to connect to Microsoft Dynamics GP from Salesforce using NTLM Authentication. I used this library to Authenticate the service (https://github.com/natewallace/ApexNTLM), I prepare a ...
2
votes
1answer
164 views

Dynamic WebServiceCallout call results in “Variable does not exist: WebServiceCallout ”

I want to encapsulate a WebServiceCallout.invoke to reuse it in various cases, so I've build the following static method public static Object callSOAP(Object stub, Object request_x, Map<String, ...
2
votes
0answers
246 views

REST callout's output is not correct (a string is not a string)?

I am trying to do the Apex REST Callout Trailhead. One of the challenge requirements is: The 'getAnimalNameById' method must call https://th-apex-http-callout.herokuapp.com/animals/:id, using the ...
2
votes
0answers
344 views

HTTP post request is not leaving salesforce servers

In sandbox environment, immediately after the callout request I get a callout response "System.HttpResponse[Status=Forbidden, StatusCode=403]" even though I have already configured the domain in the ...
2
votes
0answers
42 views

Apex Callout - Need help sending AuthenticationHeader. Request Error. Invalid Login

I am trying to send account record information to an external web service. I have created an Apex Class from WSDL. Right now when I pass the request I am not sending authenticationHeader details. In ...
2
votes
0answers
667 views

Box.com creating folder for record failing

i'm encountering a wierd behavior in my box.com integration for salesforce. Here's the code. @future (callout=true) public static void createFolder(Id id) { //Instantiate the Toolkit object ...
2
votes
1answer
267 views

Salesforce Javascript CORS rules

Is there a good summary of where from Salesforce allow and does not allow calling out to 3rd party REST API's (assume header Access-Control-Allow-Origin: *). Possible scenarios I can imagine: ...
2
votes
0answers
567 views

ConcurrentPerOrgApex Limit exceeded

We are calling Queueable Interface from trigger to make multiple callouts to external systems. The number of callout from Queueable class is 50 as the other system can process only one record at a ...
2
votes
0answers
573 views

No longer receiving “String length exceeds maximum” in SOAP Callouts

We have a .NET SOAP web service called by an Apex class that returns very large strings. The class used to occasionally throw the error: "String length exceeds maximum". I just realized it isn't ...
2
votes
0answers
627 views

Client certificate authentication on web service callout in Salesforce

I am trying to invoke 3rd party web-services from Salesforce using WSDL2APEX. The client has also shared a .p12 certificate which I need to use for client authentication while making web-service call ...
2
votes
0answers
482 views

Test Method for callout in Future method

I have a trigger on Account. On Account insert, I am sending a callout through future method. I am trying to write a test class for this but I am getting either of these two errors - 1) You have ...
2
votes
0answers
1k views

Http callout not giving correct response when calling fom visualforce page

I am stuck in to one strange problem. I am sending http request as below. The below request giving me perfect result when i m calling it from developer console, but for some reasons it is not working ...
2
votes
0answers
71 views

Spring 14 Login issue using partner wsdl

I have approval process where users will approve records only through email. Once Users approved automatically pdf will be generated. Since there is a restriction in create pdf from Trigger or future ...
2
votes
1answer
3k views

concurrent request limit exceeded

I am getting below eroor intermittently. I know the reason for this error as I read on docs but could not find out what I am supposed to do to avoid it, what might be the resolution. Error - "...
1
vote
0answers
23 views

Rest API callout using basic authorisation

String filter = 'OrderNumber eq \'1000035\' and SoldtoCustomer eq \'10045005\''; String Username = user; String Password = pass; String expand = 'EvLineDetailsSet'; String format ='...
1
vote
0answers
187 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 ...
1
vote
1answer
28 views

Unit Test - Flow Variable to Apex Class to HttpRequest

For context, I am usually just a declarative Admin and can usually achieve whatever I need to on the platform using Flow, PB, or simple WFR. Very seldom do I have to 'resort' to Apex. I have a Flow ...
1
vote
0answers
60 views

How to use ampscript from Marketing Cloud to make a callout to salesforce rest api?

Anyone know how to use ampscript from Marketing Cloud to make a callout to salesforce rest api? The REST API I need to call from ampscript is listed below: /services/data/v45.0/query?q=SELECT ID , (...
1
vote
1answer
31 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 ...
1
vote
0answers
51 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 ...
1
vote
0answers
368 views

Apex Continuation - Response Method

I am using Apex Continuation to make a callout from a VF page, but the response method is not being executed and, as a result, no response is displayed on the page. Can anyone please see why this is ...
1
vote
0answers
73 views

organisation inconsistencies - You have uncommitted work pending. Please commit or rollback before calling out

I have a fairly complex class dealing with http callouts. I have taken great care to avoid performing any dml operations before after all callout operations are complete. All of my callout operations ...
1
vote
0answers
210 views

Where I can store access and secret keys for callouts to AWS SQS service? Should I use Named Credentials or other means suit better for this case

This question has an answer to how to send request to Amazon SQS service from Apex. However, I am concerned that we have to expose access and secret keys in the code. Is this possible to use Named ...
1
vote
0answers
560 views

System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.0 404 Not Found”

while we are making a callout to external system we are getting the below error: System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found" I have googled and ...
1
vote
0answers
70 views

CallOut Class not Executing

I was hoping someone can help looker over this callout flow to see if I may have configured something wrong. I'm not seeing any new logs when this should be invoked from Process Builder so I don't ...
1
vote
1answer
257 views

Webservice error in Apex

I have generated classes from WSDL file. I'm trying to execute a method from the generated class, there I'm getting the below error. System.CalloutException: Web service callout failed: Unexpected ...
1
vote
0answers
24 views

Testing problems

I am trying to deploy a new piece of Apex that conducts some internal Salesforce operations (inserting a number into a field based on another field). The test involves inserting a lead into ...
1
vote
0answers
959 views

Consume third party Rest API ( How to get data in Salesforce)

I am new to Salesforce. Planning to integrate third party REST API (http://rt4.marcura.com/REST/1.0/search/ticket/?user=salesforce&pass=salesforcepass&query=CX::Team1) into Salesforce. What ...
1
vote
1answer
299 views

Testing future callout method

I am attempting to test a @future callout class that pings another class to make an API call and update some fields in the Lead object. I am using the mock http method and here's the script: @isTest ...
1
vote
1answer
312 views

Visual Workflow plugin to callout to an external webservice and POST JSON

Can anyone help in providing an example of an APEX class which can make a HTTP JSON POST request to an external webservice using a plugin for SF visual workflow? Example I tried following here ...
1
vote
0answers
45 views

StripeForce addLineItem is not working

I have a task using the StripeForce Stripe Client. I've been trying to do the following. Once an invoice is created on stripe, to use the webhook invoice.created and then add a line item to the ...
1
vote
0answers
432 views

How to access external URL in salesforce

I am new in salesforce - I need to hit my product URL(http://hostName:9090/product/HTTPListener?ExecuteProcess=Create_PO) to call certain workflow from salesforce. I did few things with Apex trigger ...
1
vote
1answer
317 views

Soap Callout From Trigger - how to get the response

I am struggling with a weird issue. I have a Soap webservice fired from a after insert/ after update Trigger. i made my function @future to be able to make the call but the response that i have is my ...