Stack Exchange Network

Stack Exchange network consists of 174 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 [httppost]

The tag has no usage guidance.

0
votes
1answer
30 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
0answers
13 views

Upload PDF from Files (Content Document) to External Server using REST API

I have a requirement where every new PDF uploaded under Files for Accounts should be automatically posted to an External Server using REST API. Any resources on how this can be done?
0
votes
1answer
30 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
2answers
40 views

How can I send an error from HttpPost to Callout if ExternalID is the same?

I still can't send to my Callout right status code. I have an Item object in Org2 that I can post from Org1 (in Org1 is Tool object that passes its fields to THIS (Item) object). Item has ExternalID ...
0
votes
1answer
31 views

How to send error from HttpPost to Callout if ExternalID is the same?

I have an Item object in Org2 that I can post from Org1 (in Org1 is Tool object that passes its fields to THIS (Item) object). Item has ExternalID field that takes the ID from Tool. How can I send an ...
1
vote
1answer
125 views

Test for HttpPost service: how to take JSON body for test?

I have a HttpPost methods. And I really don't know how to test it correctly. My methods: public static App__c ParseRequest(RestRequest req) { App__c app = new App__c(); String body = req....
0
votes
1answer
26 views

Callout REST HttpPost: how to create an object with all fields?

I wrote my Callout, but it create an object only with Id. How can I create an object with all fields? HttpPost: public static App__c ParseRequest(RestRequest req) { App__c app = new App__c(); ...
0
votes
1answer
23 views

Can we use a map in HttpPost to make our code shorter? (too many fields and we can add more in future)

Can we use a map? And how to do that? Too many fields here already and we can add more in future. @HttpPost global static Ticket__c postT(String title, String whattime, String whatdate, String ...
0
votes
1answer
25 views

How to to foresee External ID in HttpPost?

When we post a Box record we also send it an External Id from another side. How to to make it in HttpPost method? I have an object1 in Org1. In Org1 are all my callouts. object1 has a button POST. ...
2
votes
1answer
29 views

Why am I not able to parse valid XML straight from the Salesforce Documentation, but JSON works fine?

On this particular page: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm About halfway down, you'll see a method which I have included in my class @...
0
votes
1answer
19 views

Endpoint can not be null issue in scheduled batch callout job

I struggle with execution of HttpRequest POST in my Scheduled Batch job. I have written Test and Mock classes to test the callout itself (without Batch job) and it returns http code 200. My debug ...
1
vote
2answers
98 views

HTTP Callout Error using form data format

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,"Message":...
1
vote
1answer
118 views

HTTP POST Request with @future and schedulable

I need to create a schedulable Apex job which will send Sales Order Number from Case Object to my integration platform Web Service as JSON. This will be re-mapped and sent to another system, re-mapped ...
0
votes
1answer
124 views

Getting Error while try to get Salesforce OAuth access token from SFMC cloudpages ssjs httppost?

Actually I try to get access token of salesforce DC from salesforce MC by SSJS Httppost I need to create a record in salesforce object From Salesforce marketing cloud pages <!doctype html> &...
2
votes
0answers
24 views

Sending an HTTP request with an imported WSDL with the string 'http://0X'

I have a WSDL that i consume imported as an Apex class. One of the methods receives one String param that is the account website, and one of our users inserted a website that starts with 'http://06'. ...
0
votes
1answer
28 views

How to create HTTP end-point which accepts POST data in Salesforce

I need to create a HTTP end-point for receiving transaction notifications from a payment gateway. How would I create a HTTP end-point which accepts POST requests with a variable set of parameters. ...
0
votes
1answer
246 views

Salesforce Rest API patch operation - Bad Request

I'm trying to invoke a PATCH operation on our organization's Salesforce API. The url is correct (format - https://xxxx.salesforce.com/services/data/v43.0/sobjects/Classification__c/objectid?...
-1
votes
3answers
430 views

REST API Connection - Alternative to use from Javascript to Http call

What is the easiest way to have a HTTP call from a JavaScript to create records in Salesforce? I have almost no experience with API connections, but with apps from the app store such as formassembly ...
1
vote
2answers
521 views

HTTP POST callout not showing response body

I am making a HTTP POST callout from Salesforce. I am getting a HTTP 200 response code from the remote server but I am not getting the response body in the response. However, when I am using the same ...
2
votes
1answer
433 views

@IsTest - How to get the RestContext.response from @HttpPost if the post method is not returning [duplicate]

I created a @HttpPost API end point called SampleAPI that doesn't return an object. Instead I am populating RestResponse like so: @RestResource(urlMapping='/SampleAPI/*') global class SampleAPI{ ...
1
vote
1answer
49 views

@HttpPost test will not run - Method does not exist or incorrect signature: void doPost(String,

Just started with Apex last week so very new. Building a @RestResource to pick up webhooks sent from an external DB. Code has been tested and working as expected in Sandbox. Can not get the unit ...
0
votes
1answer
111 views

Trying to turn HTTP 'POST' to 'PUT'; Desire Upsert, Not Just Insert

I originally had the following trigger and REST-callout class that functioned properly: trigger SendOpp_Trigger on Opportunity (before insert, before update) { for(Opportunity o : Trigger.new){ ...
2
votes
1answer
232 views

Test Method for @HttpPost RestResource is not returning expected results

I have been looking all over the boards and found some useful posts regarding testing rest services, but even after spending the last 2 hours trying to implement many of those ideas, I still am stuck ...
0
votes
1answer
50 views

Apex Post not accepting setBody

public static HttpResponse getIntegratedInfoFromExternalService(String WebURL , String key) { Http h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint(WebURL); ...
0
votes
1answer
335 views

Send Bulk SMS by calling Twilio API using http callout

I'm using Twilio to send SMS through salesforce. I'm able to send the sms by calling http callout to Twilio API. but, Now I've send bulk sms, when I inserting bulk record in salesforce. I'm ...
0
votes
0answers
39 views

How to Eliminate @HttpPost Race Condition

I have a custom API that accepts incoming @HttpPost requests from third parties. The POST request inserts a new complex custom object that may contain one or more Contact records. There is a race ...
0
votes
2answers
322 views

INVALID_SESSION_ID error when external app is calling GETmethod on salesforce

I have created webservice class with Get method. I have created Connected app and I have consumer key and consumer secret.But I don't have knowledge on how to use it. When external app is calling ...
2
votes
1answer
85 views

HTTPPost2 send form data

How could I post data to a url with Content-Type: multipart/form-data I doing this, but it reports error to me: SET @httpPostCallStatus = HTTPPost2( "https://url-post-data", "multipart/form-...
0
votes
1answer
73 views

Pass value to a visualforce controller from a HTTP Post

I have an iframe that uploads video recordings to a server, when the recording is complete we receive back a call telling us that the video has been uploaded, I am trying to expose a notification on ...
0
votes
1answer
444 views

Testing a REST Service POST method question

I am confused about some of the information in the developer Guide regarding setting up a REST Service POST method. I've set up my service similarly to the following example from the Developer Guide: ...
1
vote
1answer
2k views

A testclass for @RestResource @HttpPost

I have a @HttpPost method in @RestResource class: @RestResource(urlMapping='/Something/*') global with sharing class HttpClass { @HttpPost global static String updateCustomObject() { //Fetching ...
0
votes
0answers
160 views

Create a record in custom setting using Rest Api in different org

I am trying to create a record in custom settings ,But not able to get proper output. public with sharing class RestApiExample { //Login Domain May be test, prerellogin.pre String LOGIN_DOMAIN = '...
19
votes
3answers
8k views

Session_ID_Remove Issue in API callouts in Salesforce

I have below code to get session id of another org and to connect it. Problem I am facing is not able to see session id . HttpRequest request = new HttpRequest(); request.setEndpoint('https://...
0
votes
1answer
383 views

AMPScript to get AccessToken failing

I am using below AMPScript to retrieve access token for my subsequent REST calls but it is failing with "Bad Request" %%[var @con,@body,@body1,@auth,@output,@response,@res,@callstatus ]%% %%[SET @...
1
vote
1answer
206 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 ...
0
votes
2answers
298 views

AMPscript HTTPPost2 function to make an SOAP API call

I'm trying to use HTTPPOST2 function to make an SOAP API call. Here is what my code looks like %%[ var @output,@respheader,@payload,@endpoint,@callstatus,@callresponse set @endpoint = '...
0
votes
1answer
33 views

Modifying HTTP Call for Scheduler to Upload Dashboard Images

I have created the HTTP method using this post. But I'm unsure of how to test it out. Say if I run this in the Developer Console for testing how Can I link it to taking the image out of the Salesforce ...
1
vote
1answer
109 views

HTTP GET method Error

I'm trying to retrieve my VisualForce Page that I have already Render as a PDF using my Apex Class so I can store the page as a PDF inside the document folder. But, I keep on having an Error when ...
3
votes
1answer
477 views

REST SERVICE - Unexpected parameter encountered during deserialization

its all perfect! why is this happening? the same endpoint and JSON works in workbench but not in my java code: REST API : @RestResource(urlMapping='/RestTest/*') global with sharing class ...
1
vote
2answers
360 views

HTTPPOST request in Salesforce is failing when I run in JDK 7 but works fine in JDK 8

I am receiving a two different response for below HTTPPOST request based on the JDK version. On JDK 1.7 it says BAD Request, I am not able to understand the difference in those two responses. Could ...
0
votes
1answer
55 views

Serialized JSON for POST to server not taking

I am following this simple example List<Account> accounts = [SELECT id, name FROM Account LIMIT 2]; String accountsJSON = JSON.serializePretty(accounts); I am trying to replicate this exactly ...
3
votes
1answer
312 views

Multipart Post to Attachment

I am trying to send a binary file in Java to Salesforce '/sobject/Attachment' endpoint. Below is the code I am trying to use, but I keep receiving a 400 error. Any idea as to what the solution is? ...
1
vote
1answer
519 views

insert mutlitple records using restapi apex

I hv 2 salesforce instances & I am inserting multiple account records from source to orgnz. The access token part is working , but I do not understand how to pass multiple account records. In ...
9
votes
2answers
775 views

ID query string parameter call to RestResource results in error

I'm looking to set up a RestResource endpoint that accepts some URL parameters and creates a lead record. Here's the basic gist of my code: @RestResource(urlMapping='/createLead/*') global with ...