9

Yes, you can, using either of two techniques. Your HttpCalloutMock's respond() method can inspect its inbound HttpRequest, and construct a different response based on which endpoint is being called, the parameters passed, etc. This allows you to write a single class that returns responses for multiple callouts made in sequence in your code under test. ...


2

The best secure way would be to use a Connected App and Server-Server flow It is always better to authenticate to Salesforce and reach into Salesforce using a connected app. However, as you pointed that if you do not have a lot of control then you need a proxy server doing this for you. One approach would be to use a Heroku Node.js app and exposing that to a ...


2

The resulting object you are getting there is from your Catch statement, not the HTTP.Post or HTTPPost error. This means that there is a syntax error that is causing the function to error, not an error on the server receiving the call. What the two SSJS HTTP functions are referring to as an error is if the call returns an issue from the server (server says ...


1

I would recommend using Code Resource (for example JSON one) instead of Cloud Page. It's faster and doesn't cost you Super Messages. You can capture the POST data with SSJS and output it to Data Extension (or leverage any other possible logic with SSJS functions). One thing I would strongly recommend would be to add some kind of security, for example by ...


1

405 is for "The request method doesn't have a corresponding Apex method." The method is correctly declared by @HttpPost annotation. This helps in sending large content via post body instead of the URL. Postman, there is a problem , if it gets 301 or 302 from Salesforce (a redirect directive), it redirects with a GET Method. So in a nutshell, you should test ...


1

You'll need to build two wrapper classes that look something like this: public class ChildWrapper { // Option 1: store the entire child object record public ChildObj__c theChild { get; set; } // Option 2: track each child field separately public Id childId { get; set; } public String childName { get; set; } // etc. etc. public ...


1

You don't send the SOAP POST requests to any of those URLs. They are XML namespaces - see Why are URLs in XML namespaces?. For the initial login() call you should use the endpoints defined in the docs: "https://login.salesforce.com/services/Soap/u/version/" E.g. You need to replace "version" with the actual API version. https://login....


1

var json = Platform.Function.ParseJSON(jsonVariable); if (json) { var coupon = json.coupon; for(var j = 0; j < coupon.length; j++) { var barCode = coupon[j][barcode]; var serialNumber = coupon[j][serialNumber]; var couponid = Platform.Function.GUID(); // and so forth //Assuming you don't have any coupon id in ...


Only top voted, non community-wiki answers of a minimum length are eligible