Questions tagged [callout]

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

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

Not Found / Forbidden error while using GET Operation in AWS S3 folder

I'm trying to get a csv file from a AWS s3 bucket, I've access to bucket and some of the folders in it. But i'm unable to access("GET") files from one of the folder. I get an error NOT FOUND"/404 when ...
1
vote
1answer
120 views

Salesforce to Xero integration using Named Credentials by OAuth 2.0

I am trying to do the integration between Salesforce and Xero by using Named Credentials (Authentication Protocol is OAuth 2.0). I created an Auth provider - Then created Named credentials of OAuth 2....
1
vote
1answer
415 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
1answer
805 views

salesforce to salesforce using partner wsdl in Apex - query call failing

I am trying to connect to other salesforce org. I have partner wsdl. I have used FuseIT SFDC explorer to create Apex class from this partner wsdl. I am successfully able to login to other SF org using ...
1
vote
2answers
49 views

How to correctly construct a TestClass for an API Rest Callout | Getting the error “Method does not exist or incorrect signature”

Apex Class for REST Callout public with sharing class FindAnApprenticeship { public class Payload{ @invocableVariable(label='Find An Apprenticeship URL') public String ...
0
votes
0answers
21 views

Error in moving audio content to azure retrieving with apex callout

I am making a callout to a 3rd party to retrieve an mp3 file The endpoint is a HTTP GET (https://media.ringcentral.com/restapi/v1.0/account/~/recording/RECORDINGID/content) The response is the actual ...
0
votes
0answers
22 views

Formatting data on a lightning component without using lightningrecordform

So, I am currently working on a call out to another service outside of Salesforce. I have made the call out and am successfully returning data from the service outside Salesforce. So, my question is ...
1
vote
2answers
147 views

Testing a trigger calling batch class for making a callout gives System.CalloutException

I am trying to write unit test for a trigger which calls batch apex performing callouts first then updates the response to those record. Trigger's psuedo code looks like: trigger AccountTrigger on ...
1
vote
0answers
30 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 ...
-3
votes
0answers
22 views

this is my apex class help me to write test class for this,thanks in advance [duplicate]

public static decimal Httpmethod(decimal USD) { Http http1 = new Http(); HttpRequest req1 = new HttpRequest(); req1.setendpoint('https://api.exchangeratesapi.io/latest?base=USD'); ...
-1
votes
1answer
18 views

Test Class For Http callout Post [duplicate]

Kindly Provide me a feasible solution to write the test class for this below code` public class ActiveCampaign { @future (callout=true) public static void createUser(String Email, String FirstName, ...
2
votes
4answers
1k views

Clicking button should reload the page and the callout must be performed asynchronously

My question is, should clicking a button reload a page and perform an asynchronous callout? It looks like its reloading the page after finishing the callout. Custom Button : Execute JavaScript {!...
2
votes
1answer
1k views

Salesforce Apex - POSTing multipart/form-data Content-Type

I am following through Dan's interesting blog (http://www.fishofprey.com/2017/04/steps-required-to-support-posting.html) which has proved to make the impossible possible on salesforce apex for lot ...
0
votes
1answer
18 views

Integrate Salesforce with Active Campaign

I want to integrate salesforce with ActiveCampighn using the Api key and Url of ActiveCampighn through Http Post method. I want to create a contact from Salesforce to Active campaign. I tried with the ...
-1
votes
1answer
24 views

How to process the raw response generated by the WSDL2Apex Callout?

I am getting a huge chunk of raw response from the WSDL2Apex web service call out and I want it to be able to be processed into APEX Data structures, i.e. lists and maps. Raw Response Snippet: ...
0
votes
2answers
61 views

How to use Promises / synchronize two asynchronous methods in Lightning Web Component(LWC)?

In LWC JS, I am making an external API call-out and an Apex method and accumulating the results. How to synchronizes the process? Example: renderedCallback(){ let a,b; getApiResult().then(...
0
votes
1answer
1k views

SOAP API: Applying filter to a retrieve data in Apex

I generated Apex code from the ExactTarget SOAP Api: Exacttarget Wsdl URL I am trying to make webservicecallouts using apex to retrieve "SentEvent" for an specific subscriber. Using SOAPUi it works ...
1
vote
2answers
62 views

Logging Solution for Force.com Public RESTful webservice

I've created a public site with a RESTful service mentioned in this blog, however this site uses Guest User License and I can't see any debug statements when this webservice is used by Postman. Is ...
1
vote
1answer
422 views

Override Save button without additional VF page

I try to implement the following: After clicking the Save button on a Standard Object I want to make a callout to a web-service and after receiving the results I want to present a custom VF page where ...
2
votes
1answer
62 views

Named Credential Authentication [duplicate]

I am trying to connect with Xero using Named Credentials. I am using oAuth2.0 authentication protocol. I have created a Auth. Provider and Named credentials as shown in the image below The Named ...
1
vote
1answer
900 views

Lightning component immediate server action?

I have an application which depends on outbound calls to REST APIs to fetch data. Is there a way to enqueue and process actions right away? It seems like if I enqueue an action, it is not processed ...
1
vote
1answer
383 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 ...
3
votes
2answers
572 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 ...
2
votes
1answer
38 views

Source of an erroneous “You have uncommitted work pending” error in Test?

From the top, I do understand how "You have uncommitted work pending" errors happen, but the following is very strange behaviour from Salesforce... It seems that for one org we have, creating an ...
2
votes
0answers
22 views

Salesforce External Service - Capturing Request and Response

We are doing POC to use external services for integrating with external systems. It works well.With spring 20 as per preview release notes enhanced external service is going GA. Question: Is ...
0
votes
1answer
43 views

Timeout Error: You have uncommitted work pending when Queueable is being called from trigger

I have a class with @future method: public without sharing class SubmitOnApproval { @future public static void oppRecordsToSubmit(id oppId){ Opportunity o = [select id, ...
2
votes
1answer
57 views

What is best Option to store Access Token, Refresh tokens?

Platform cache : I am using platform cache but platform cache is not returning anything after very small period of time ( approx 30 sec- 60 sec ). Custom Setting : Custom setting has a limitation of ...
0
votes
0answers
32 views

Bulkifying a trigger or send everything in a Future method (with a callout inside)

I would like to anticipate a "mass update" of my accounts. I need to bulkify my code which contains a Callout. What happens when a mass update is done ? Like importing a list of account. Is the ...
1
vote
1answer
42 views

How can I use queueable Apex instead of a future method with arguments?

I have an @future class, SubmitOnApproval which is called when an opportunity is approved. This class is below: public without sharing class SubmitOnApproval { @future public static void ...
0
votes
1answer
33 views

How to remove dom response from a loop

I have a dom class handler which I am calling from batch class. I am looping through the response to perform dml operations across certain objects. Since I have to use the response across different ...
18
votes
1answer
931 views

Apex Framework / library for consuming REST services

To consume REST services there is a lot of boilerplate code needed: Build Apex Objects to model the responses Code to deserialize REST responses to those classes Handling of HTTP requests, responses ...
0
votes
0answers
19 views

Scheduled Class within a Batch Class

I am trying to schedule a callout from a scheduled class. In order to get around the limitation of sending callouts from scheduled classes, I tried to include the scheduled class within my batch class,...
0
votes
1answer
34 views

Should I use a single callout with a list or mulitple callout for each Account?

I wanted to Bulkify my code to be able to update/create a long list of account for which I need to callout to my api. I know that I can't do more than 50 callouts per future methods. But using ...
1
vote
1answer
32 views

SFDX plugin to generate Apex classes from Swagger file is failing to install

I'm trying to install this plugin https://github.com/muenzpraeger/sfdx-plugin , due to some reason it is failing. Please let me know if there is any other way that i can generate classes using swagger ...
2
votes
2answers
968 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 ...
3
votes
1answer
29 views

Callback method is not getting called in continuation object

I am getting invalid session Id when i try to perform callout using continuation api . If i remove continuation api code and perform a normal callout the the same code is working. Below is the code @...
0
votes
1answer
45 views

The following exception has occurred: IO Exception: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable”

We have a batchable Apex job (process) where we call an external web service for some Accounts. It starts and service is called. Then, for some records it we get the error : Unable to tunnel through ...
0
votes
2answers
658 views

Callout to SAP from Salesforce using REST API

I am trying to pass a json data to an external URL. With a basic knowledge, I have added them to remote site settings. The sample URL is http://xyz-xyz.sap.xx.com:50000/xyz/xyz. I have created an apex ...
0
votes
1answer
28 views

Using Python as backend to Salesforce App

Python has some amazing libraries that I want to take advantage of. The only issue that I am concerned about here are the governor limits for long running operations. I am creating a deduping app and ...
0
votes
1answer
46 views

Accessing data of Sandbox from Scratch Org

I want to be able to query, insert and update records of a Sandbox from a Scratch org, only during the development phase. I know that scratch orgs are meant to be populated with just a little amount ...
1
vote
0answers
26 views

Correctly Write Test and Callout test on trigger [duplicate]

I have a trigger on Account after insert and after update. In both cases I need to call my BUS to update in the compagny database. Since I will have to deploy my dev into QA I need to write a test ...
0
votes
1answer
35 views

validate callout payload at webservice? [closed]

I am making a callout to web service. How can i validate payload received from callout at web service endpoint. is there anyway to authenticate that request actually came from salesforce only?
11
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 ...
1
vote
2answers
914 views

how to create an incident in serviceNow from salesforce(Case)?

I'm trying to integrate salesforce and serviceNow. If I create a new case in salesforce, that should be saved as incident in serviceNow. Here I developed some code but I'm stuck at mapping the ...
1
vote
1answer
27 views

Get Request Submitting as a Post Request

i am sending a GET request to a spring boot backend api, but i keep getting a 405 error, POST method not allowed my code is public class TextingSolution { private final Contact xReceiver {get;set;...
0
votes
2answers
999 views

Serialize and deserialize the List<sObject> in APEX

How to serialize and deserialize the list of sObjects in APEX. I tried to serialize the list of sobjects like this . JSON.serialize(Trigger.New) This is returning a json array of objects like the ...
0
votes
1answer
33 views

Composite REST Resource Not Found

I created a composite REST to insert opportunity for existing account, but all the GET method return error resource not found.. someone help { "allOrNone" : true, "compositeRequest" : [{ "method" ...
-1
votes
1answer
3k views

I need to sent the body in form of Form data

I am posting the data to endpoint url through http callouts from developer console and getting response "200 ok" and in body of response i am getting an error message of "{"IsSuccess":false,"...
0
votes
1answer
14 views

TestMethod Doesn't Support Web Service Call Out Error For Trigger on delete

I have this trigger which deletes the Specific Objects records on delation of a record. I wrote a test class for this but since I am a toootal Noob, I was unable to manage to cover the whole thing and ...
0
votes
1answer
497 views

Create folder using dropbox api

I want to create the folder & sub-folder using dropbox api using apex. I have gone through few links but not able to find complete documentation. On most of the links I have found the below code ...