Questions tagged [httppost]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
29 views

We want to Pass JSON Payload to JSON Code resource and need to execute Final HTTPPOST2 function on JSON to execute external API call at backend

Requirement -: We need to Pass JSON Payload from one CloudPage to JSON Code resource via HTTPPOST AMPscript method and need to execute Final HTTPPOST2 function on JSON code resource to send that ...
user avatar
  • 29
-1 votes
0 answers
25 views

I have to Update the existing opportunity through the rest services the key is the (payment_id +'_'+ name) which checks if opportunity is exist or not

This Is Main Contrl @RestResource(urlMapping='/PaymentOppUpdate') global class PaymentOpportunityController { @HttpPut global static void doPost() { RestRequest req = ...
user avatar
0 votes
0 answers
47 views

HTTPPOST2 Ampscript call taking too much time , impacting slow Thank you page load on form submission

Requirement We are working on a requirement where we need to send customer details (FirstName , LastName , EmailAddress) entered into web-form to "External API end point" So once customer ...
user avatar
  • 29
-1 votes
1 answer
25 views

Can I add suffix in urlMapping for HttpPost in RestResource

I'm having an apex class like this: @RestResource(urlMapping='/api/v1') global without sharing class MyRestService { @HttpGet global static List<sObject> getDataById() {...} @HttpPost global ...
user avatar
0 votes
0 answers
19 views

Not getting enough coverage [duplicate]

global class OpportunityService implements OpportunityInterface { public List<dataJSON> convertJSONDataToOppList(String requestBody){ try{ List<dataJSON> DataList = ...
user avatar
-2 votes
0 answers
36 views

I want to write a test class for @httppost method [duplicate]

@RestResource(urlMapping='/lookeropportunity') global class OpportunityController { @HttpPost global static void createOpp(){ try{ RestRequest request = RestContext....
user avatar
-3 votes
1 answer
45 views

This is my class for httppost request ,so i want to send the response code with error message when the request is come into the system [closed]

This is my code, what I want to send is if request is sucessfully created then send code 201 with sucess message and if not created then send 501 with error message @RestResource(urlMapping='/...
user avatar
0 votes
1 answer
53 views

How can I send a list of records (multiple forms with key-value pairs) in a single request via multipart/form-data HTTP POST

This is not about files, but about key-value pairs. And I already got below to work for ONE submission/record. How do I tweak below to support multiple record submissions? private final static string ...
user avatar
0 votes
1 answer
29 views

HTTPPost : Unexpected parameter encountered during deserialization: attributes

I am having the following code to insert a Case record. When I run the code using workbench I am able to insert a case record. But when I try to call the API from another sandbox I am getting Error : ...
user avatar
  • 679
0 votes
0 answers
36 views

How to create multiple ApexClassMembers with one call?

According to answer to my previous question, Tooling API objects are not supported in /composite calls. Is there a way to insert a large (let's say 2000) number of ApexClassMembers instead of ...
user avatar
0 votes
1 answer
114 views

HttpPost unable to parse LIST of JSON data

I'm testing this with the Salesforce workbench and I'm using /services/apexrest/myRestRequest/doPost with JSON data { "contacts": [ { "personEmail": "...
user avatar
-1 votes
2 answers
158 views

Record is only update from API [closed]

The record which came from Rest API should only update from API, no user can update the record manually. for(Opportunity guestuser: trigger.new) { id currentuser = guestuser.CreatedById; ...
user avatar
1 vote
0 answers
52 views

Send MMS message to twilio from salesforce

I am trying to send MMS message with Twilio Api from my Apex Code. I have working logic which sends SMS message with Twilio API. Based on this documentation Sending Messages we neeed to add the "...
user avatar
-1 votes
1 answer
105 views

System.TypeException: Invalid decimal in Rest Resource @HttpPost

I developed an Apex REST web service in Salesforce with the method 'POST' and i am trying to insert the string value in currency field of Product__c object, so when I try to hit the API im getting the ...
user avatar
0 votes
1 answer
250 views

'System.NullPointerException: Attempt to de-reference a null object' error on test class for @RestResource @HttpPost

I developed an Apex REST web service in Salesforce with the method 'POST' This is my main class public class Product { public String pName; public String pRating; public List<Item> ...
user avatar
0 votes
0 answers
34 views

How to write test class for apex @httpPost? [duplicate]

I am using the below code with the method 'POST' to insert records in Opportunity object, records are getting inserted, but I am not able to figure it out on how to write the test class for this? Any ...
user avatar
0 votes
1 answer
38 views

Error While POSTing to a third party PDF and additional parameters

I am calling a rest api with multipart/form-data content type. I need to pass a pdf and additional parameters to generate a pdf. The appends the additional params data to the pdf and generate a new ...
user avatar
  • 101
0 votes
0 answers
20 views

Need to write a test class for Http post class [duplicate]

@RestResource(urlMapping='/PioneerRxChangeEventListner/*') global without sharing class PioneerIntPharmacyApiClass{ @HttpPost global static ParentResponseWrapper doPost() { // variable ...
user avatar
1 vote
1 answer
109 views

WSProxy HTTP POST Request only runs a handful of records at a time before erroring and pausing

I'm leveraging SSJS WSProxy's HTTP Request to send a payload over to a third-party server. The payload is essentially a data extension's information that is being looped over until all records are ...
user avatar
0 votes
1 answer
92 views

Unable to create Case object with SSJS

I am able to create a Case in SalesCloud using Postman. However, with the same JSON payload this is failing from my CloudPage using SSJS (note that I retrieve the token successfully in the same page) ...
user avatar
1 vote
1 answer
457 views

Do Apex rest services methods like @HttpPost support Apex class object as parameter?

I am writing an Apex Rest Service with the POST Method. For that, I have written an apex class wrapper for the request. Like below. global class RestRequestWrapper { global String eId; global ...
user avatar
  • 10.9k
1 vote
0 answers
63 views

Contact Deletion in Automation Studio with SSJS

Basing on the article here I prepared a code snippet to run in Automation Studio. Unfortunately we receive Bad Request(400) error for second API call everytime even though all passed parameters are ...
user avatar
  • 11
0 votes
1 answer
74 views

Using landing page to receive data from a callback

I am using MC Event notification Service and I created a callback (using a 3rd party site) to receive data posted back from Marketing Cloud. I want to see if I can utilize a landing page to receive ...
user avatar
  • 49
0 votes
1 answer
836 views

How to submit a Pardot form using AJAX?

I am confused a little bite, why pardot is not allowing such ajax requests ? aren't they more user friendly features ? I added a form handler and tried to use it of course & it works when I keep ...
user avatar
  • 156
2 votes
1 answer
441 views

Possible to Authenticate an incoming Webhook for use with Post REST Service

Still new to working with REST services and apex in general. I have put together a simple REST Service for inserting records with JSON delivered via HTTPPost. Everything works great when I use ...
user avatar
  • 43
0 votes
1 answer
124 views

Rest Service - Return grandchild in the response

I need to create a Rest Api where I want to take as input an Id and perform a query on an object. The response must contain the fields of this record and also some related records (children) and the ...
user avatar
0 votes
1 answer
116 views

partner.soap.sforce.com Http POST request

What is the endpoint to POST <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/...
user avatar
  • 683
0 votes
1 answer
291 views

SSJS Error on HTTP.Post

I'm facing an issue on sending an HTTP post request from Marketing cloud to ElasticSearch using SSJS. The aim is to send some import statistics of flat files to ElasticSearch in order to retrieve it ...
user avatar
0 votes
1 answer
69 views

Not able to Save the HTTPPOST2 response in the data extension

I have made a HTTPPOST2 API call and got the JSON response. I want to insert the JJSON response into Data Extension. Below is the JSON response : { "success": true, "...
user avatar
0 votes
0 answers
31 views

Writing a test class for an HttpPost [duplicate]

I'm not able to figure out how to get any code coverage on an Apex HttpPost method. Apex class: @RestResource(urlMapping='/approve/*') global with sharing class exAppClass { jstcl__TG_Timesheet__c ts =...
user avatar
6 votes
1 answer
2k views

Can we Have two Http Mock Callouts in a single test class method

In My Method making two callouts in a single transaction Get Access Token For that API --> GetAccessToken Execute Payment When i ran the test class getting following error 08:50:00:839 ...
user avatar
0 votes
1 answer
400 views

http callout `Client credentials are missing` by using Basic Auth

I am trying to get the access token by calling PayPal API,I Am getting Client credentials are missing response. public static HttpResponse GetAccessToken() { Http http = new Http(); ...
user avatar
0 votes
1 answer
746 views

Apex rest service issue with HTTP Post method when i Access from Postman

i created Apex rest service and @HttpPost method , i am able call POST method & got data in request body successfully from workbench. but i had issue with when i try to access from Post man. i ...
user avatar
  • 2,547
0 votes
1 answer
4k views

SSJS HTTP.Post throws error instead of returning status code

I am banging my head against the HTTP.Post function. The documentation says: Performs an HTTP POST using the provided information against the passed URL. The function returns a JSON object ...
user avatar
  • 476
0 votes
1 answer
73 views

salesforce Apex class - Http Post json

This is kind of new to me - I need to make apex http post call and to set the body as json. My json is constructed in the following way: { "request": "request", "ID": "reqId", "getString": { ...
user avatar
  • 139
1 vote
1 answer
417 views

How Do I Send an HTTP POST API Call Through a Script Activity Using Basic Auth?

I have seen a few posts about how this can be done using oauth, but I need to use basic auth and I can't seem to get it to work. Below is an example of the code I'm using. <script type="javascript"...
user avatar
  • 143
0 votes
2 answers
855 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 ...
user avatar
  • 1
2 votes
1 answer
705 views

SSJS HTTP.Post ValidEmail with requested Access Token

I am trying to make an API request in SFMC to validate email addresses, which requires first to get the Access Token. I was able to request the access token, but then the next HTTP.Post request I do ...
user avatar
  • 41
0 votes
1 answer
300 views

HTTP Post response error - "Value was either too large or too small for an Int32."

I am trying to retrieve a portion of the response related to a template-based email via a Cloudpage. I am attempting to get the "items" portion of the response. I get the following error: Value was ...
user avatar
2 votes
1 answer
551 views

Unable to process HTTP return codes except 200

We are having an integration with an external REST API which we are invoking from a SSJS script hosted on a cloudpage. We have tried couple of ways to invoke the API Call - Script.Util.HttpRequest &...
user avatar
  • 61
0 votes
1 answer
1k views

dynamic json body as http post request

public class RequestWrapper { public static GetUrlRequest GetUrlRequest; public class OrderDetails { public String txnId; public String custOrder; public ...
user avatar
  • 261
0 votes
1 answer
2k 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?
user avatar
0 votes
1 answer
64 views

caseId property is not shown in response received from a external service to Salesforce [closed]

I am making a POST callout from salesforce to another service and case is one of the objects of JSON which i am sending (see below) "case": { "caseId": "00000212", "status":"", "statusReason"...
user avatar
  • 391
0 votes
1 answer
225 views

POST to an external API from visualforce page

I am using OpenCTI in Lightning to enable click to dial. I want to click on the phone number and call an external API to make the dial. I have a visualforce page as CTI Adapter. When the page loads ...
user avatar
  • 153
0 votes
0 answers
496 views

Test class For http Post

i wrote unit test code and got 52% code coverage and struck with following error: System.NullPointerException: Attempt to de-reference a null object. Please correct me where i wrong i am new tp ...
user avatar
  • 27
1 vote
2 answers
661 views

How to expose REST API to external users -- how do they authenticate and authorize to create lead in Salesforce [closed]

I am a bit confused. The requirement is that we need to create a REST API in Salesforce that has one POST method. Right now, I have been testing it with POSTMAN tool in 2 steps: Making a POST request ...
user avatar
  • 555
0 votes
3 answers
19k views

How to send Post request to Rest API with XML data

I have created a rest API(apex class) in Salesforce. I have multiple nested tags in xml that comes via API request. I am wondering how do I define my post method in apex that could handle the request. ...
user avatar
  • 555
0 votes
1 answer
2k views

Apex Callout HTTP POST with Named Credentials error [closed]

I am constructing something wrong, in the POST request. Please advise. Step 1: Created Named Credential called Stock_Check_For_Materials Step 2: Created Apex Controller as below Continuation con = ...
user avatar
  • 141
0 votes
1 answer
429 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 ...
user avatar
  • 125
0 votes
1 answer
170 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 ...
user avatar
  • 2,116