Skip to main content

Questions tagged [curl]

cURL is a computer software project providing a library and command-line tool for transferring data using various protocols.

Filter by
Sorted by
Tagged with
9 votes
1 answer
33k views

What is the use of setting OAuth Callback URL as https://login.salesforce.com/services/oauth2/success?

I'm using Salesforce developer account and trying to obtain OAuth access token using curl and it returns 500 Server Error giving the message specified in [1]. Used curl command is curl -v -H "Content-...
DarRay's user avatar
  • 239
8 votes
1 answer
7k views

Error using Session Id auth with cURL following REST documentation

Problem: trying to authenticate to a dev org using Session Id authentication and cURL fails when following the REST API Dev doc. The example in the doc provides the following, which fails (Quick Start ...
Adam's user avatar
  • 4,368
6 votes
1 answer
7k views

Novice Question: making a cURL callout from Apex to a 3rd party app?

I'm only familiar with REST and SOAP as API standards, and I'm a novice in general, so pardon my lack of understanding of most of these concepts. I have a web form on a third party heroku app that I ...
smohyee's user avatar
  • 3,856
5 votes
1 answer
2k views

Connected App built in SANDBOX has access to PROD

I created a ConnectedApp in my Sandbox environment (see below img for settings details). I noticed that I can use the consumer key and secret from my sandbox connected app to attain a PRODUCTION ...
Eric Luu's user avatar
  • 890
5 votes
1 answer
2k views

Bypassing RemoteAccessAuthorizationPage when using a remote application?

Hey guys I had a dream last night about a huge issue in our ability to aggregate data. After setting up a remote app, using PHP to "CURL" into login.salesforce.com for authorization, we hit the ...
ehime's user avatar
  • 530
4 votes
1 answer
3k views

Access token generation through curl

Org: Developer org. I faced a strange issue. I was generating the access token by providing client id, client secret, username and password. I used 2 following cURL commands : curl https://login....
Rohit's user avatar
  • 733
4 votes
2 answers
2k views

BULK API cURL commands to GET 100k records from Account

curl "https://xxx.salesforce.com/services/data/v35.0/query/?q=SELECT+Id,+Name,+Phone+FROM+Account" -H "Authorization: Bearer <access token> " But this only fetching 2000 records. I need all ...
ish's user avatar
  • 39
4 votes
0 answers
1k views

Salesforce Bulk API v2.0 INVALID_SESSION_ID

Following the Salesforce Bulk API v2.0 documentation at: https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/walkthrough_upload_data.htm https://developer.salesforce.com/...
Sebi's user avatar
  • 213
4 votes
0 answers
923 views

Unsupported Content Type while using curl

We are currently working on with bulk api to load json data's into salesforce.But unfortunately we are not able to load it and getting error as unsupported content type does salesforce currently ...
Priyalakshmi's user avatar
  • 1,456
3 votes
2 answers
15k views

How to Session ID for a curl request?

I'm trying to call and test CURL function for REST curl -H "Authorization: Bearer sessionId" "https://ap1.salesforce.com/services/apexrest/Account/0019000000xxxxH" I tried curling with no session ...
MnZ's user avatar
  • 3,200
3 votes
2 answers
1k views

Help converting this cUrl to Apex?

I've already read and re-read the other posts here and here about cUrl to Apex. Those both dealt with only one parameter in the body of the request. This cUrl seems a bit trickier -- I can't seem to ...
PatMcClellan__c's user avatar
3 votes
1 answer
1k views

curl post request to marketingcloud REST API is returning InvalidOrMissingTo

Same request works from POSTMAN but I'm getting in troubles when trying curl. curl -d @al.json -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer ...
mario ruiz's user avatar
3 votes
2 answers
1k views

Salesforce REST API with PHP, INVALID_SESSION_ID after successful authentication

I connected my web app to salesforce and successfully followed all the steps in the web server OAuth flow to get an access_token and related info: https://developer.salesforce.com/docs/atlas.en-us....
newUserName02's user avatar
3 votes
1 answer
1k views

ExactTarget REST API - Getting issues with /contacts/ and /campaigns/

I'm new with ExactTarget APIs, I'm using Php curl to request the ExactTarget REST API. Basically, I tried to create a contact: $array = array( 'contactKey' => '[email protected]', 'contactId' ...
DevCRMconsult's user avatar
3 votes
2 answers
33k views

How to request rest api after getting access token. php & curl

I am able to authenticate with salesforce and receive a token using php & curl, below. However my next step is to use the token id to query salesforce (e.g objects) and i am not getting anything ...
Aisha Kigongo's user avatar
3 votes
2 answers
6k views

Sending data from PHP to Salesforce using CURL

I have to send the data from PHP to Salesforce and save the data in Salesforce. I have tried with the following code: $curlurl = "https://www.mysalesforce.com/services/apexrest/Contact?email={$...
Chetan's user avatar
  • 31
2 votes
1 answer
2k views

Why isn't curl getting the session id?

curl -v https://test.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=" -d "client_secret=" -d "username=" -d "password=" I've tried this with instance name instead of test ...
fourq's user avatar
  • 2,111
2 votes
1 answer
2k views

OAuth Password Authentication for curl

I've seen this question on here numerous times, but none of the solutions I've found have helped. I'm trying to authenticate via curl. I set up a connected App, and retrieved the Client Id and ...
Ray Dehler's user avatar
  • 1,753
2 votes
2 answers
16k views

Obtain enterprise WSDL via curl

I am trying to obtain enterprise WSDL by accessing https://cs15.salesforce.com/soap/wsdl.jsp?type=* URL via curl. For this, I have obtained access token through OAUTH2 method via the following curl ...
SSK's user avatar
  • 361
2 votes
1 answer
2k views

Using curl to make a REST API call

I need to call a rest API service in Saleforce from an external client. This application logins in Salesforce with the SOAP standard login service and then has to call some custom services. The ...
DarkSkull's user avatar
  • 1,779
2 votes
3 answers
1k views

How to use the REST API to get array from the Opportunity Object in JSON format from the Opportunity object using SOQL?

I'd just like to get an array of the opportunity data within Salesforce Visualforce so that I can manipulate it in Javascript. Below is the query that I'd like to use to pull in the array: select ...
Chris's user avatar
  • 287
2 votes
1 answer
1k views

Using curl to download zip reports

I am attempting to use curl (or any other viable alternative) to download a zip report from SalesForce, but I seem to be unable to do so. I am using syntax: curl -o my_file.zip 'https://login....
raphnguyen's user avatar
2 votes
1 answer
719 views

Salesforce and CURL

I am a new Salesforce developer. I got an assignment where I have to get connected to an API using developer_id;developer_key The documentation says, Developer authentication involved sending a ...
TSCAmerica.com's user avatar
2 votes
0 answers
39 views

Standard content version api is storing the binary content as is in the object without converting it as actual file [duplicate]

I am trying to upload a file >50MB to Salesforce Content version object with reference to the Standard ContentVersion API API Ref: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/...
sf developer's user avatar
2 votes
0 answers
54 views

Posting Pdf to chatter via bulk api?

Which object should we use to post data's to chatter?I am trying to post a pdf file to a chatter object using curl. What is the name of the object that we should specify in txt file? <?xml ...
Priyalakshmi's user avatar
  • 1,456
1 vote
2 answers
667 views

Rendering Email Thumbnail in Hub

Is it possible to make a cURL POST for an email thumbnail preview using the Authorization: Bearer header to a URL like this: https://www.exacttargetapis.com/guide/v1/emails/12345/EmailThumbnail ...
Tom Reed's user avatar
1 vote
1 answer
884 views

How to pass API endpoint URL containing \ to

I'm trying to pass the given URL to the setEndpoint method, but I'm getting an error. This particular API URL contains backslash and maybe that's the problem because the code works fine with other ...
Sneha Jagtap's user avatar
1 vote
1 answer
6k views

Pretty Print cURL output (both JSON & XML) in Dos

Is it possible to pretty print cURL output (both JSON & XML) in Dos. I tried to search this, but options are available for Unix types systems only. Thanks for your answers. RSN
Rajendra Singh Nagar's user avatar
1 vote
1 answer
522 views

Can I get a refresh_token using cURL from the command line, or in Salesforce.com itself?

I have a web server which uses Salesforce's REST API from PHP. It needs permanent access, to occasionally do things like create opportunities, accounts, and other objects. I don't want to store my ...
Jamin Grey's user avatar
1 vote
2 answers
10k views

salesforce rest api invalid session id error when using access token

I am trying to retrieve data from salesforce using the REST api and CURL in PHP. I perform the authentication request and receive an 'instance_url' and 'access_token' but after performing a query ...
RealGigex's user avatar
  • 175
1 vote
2 answers
1k views

cURL request equivalent to HTTP request in APEX

Scenario: Hello, I have a cURL string which needs to be converted to Http request to be called from apex. Problem: I am getting 400 Bad Request Error cURL: curl https://test.sagepay.com/api/v1/...
Mansoor's user avatar
  • 11
1 vote
1 answer
3k views

Get html source code with cURL in salesforce

Is there any way to get html source code of external url using cUrl or rest api. As in php we can get by using following code. $ch = curl_init("http://www.example-webpage.com/file.html"); curl_setopt(...
MIX DML's user avatar
  • 2,442
1 vote
1 answer
520 views

cURL Error 51 when Posting to Force.com

I have a form on my WordPress website that collects additional information from Leads. I want this information added to an existing Lead record, so I made a WordPress plugin that initializes a cURL ...
Matthew's user avatar
  • 133
1 vote
1 answer
1k views

Can I Upload Remote PDF File to Account via PHP?

Been searching for awhile but haven't been able to find any examples.. I'm trying to upload a remote PDF file to an Account record in SF using PHP cURL / Json, is that possible and if so do you have a ...
AJK's user avatar
  • 193
1 vote
1 answer
1k views

windows curl authentication error

I'm doin a tutorial o REST connections to Salesforce, and in the Curl connection, i keep having an authentication error. URL: https://trailhead.salesforce.com/content/learn/modules/...
Luis Aguiar's user avatar
1 vote
1 answer
295 views

Download Attachment using php is not working for xlsm files

I'm using the below php code to save the Attachment to my server. public function getAttachmentFileFromSalesForce($fileName, $fileBodyUrl) { try { $authCode=''; $...
Mûhámmàd Yäsår K's user avatar
1 vote
3 answers
2k views

Converting from cURL to Http request Method in Salesforce

Kindly suggest me where I'm I going wrong, It works perfectly fine in cURL but when i try doing in in salesforce I'm facing all these Issues This is My cURL curl -H "Authorization:Bearer 7512d7f8-...
Sharat's user avatar
  • 1,029
1 vote
1 answer
4k views

why i am getting this error when sending data through curl

Error: call to URL https://cs31.salesforce.com/services/apexrest/CreateLoan/ failed with status 400, response HTTP/1.1 400 Bad Request Date: Sat, 27 Feb 2016 09:22:27 GMT Set-Cookie: BrowserId=...
Priyanka Gurav's user avatar
1 vote
2 answers
228 views

Force.com Rest API checking refresh_token if still valid or not

I am currently developing who requesting a rest api from salesforce. I am successfully getting a refresh_token as a response of my authorization with php curl. I want to know if is there any way to ...
Danryl Tigol Carpio's user avatar
1 vote
2 answers
3k views

Having problems with authenticating to my custom REST class

I keep getting 401 Not Authorized errors when I call my resource with a REST test tool like the Advanced REST client. I'm supplying an access token taken from a curl call to the salesforce login ...
akarnid's user avatar
  • 1,852
1 vote
0 answers
192 views

Single Logout (SLO) API - 400 Bad Request - Illegal character VCHAR='='

This is as part of Single Logout (SLO) implementation. The need is to logout Salesforce Experience Cloud Site when user logsout from java based application. To implement this, below Salesforce ...
Vasanth Subramanian's user avatar
1 vote
1 answer
7k views

CURL command with --data-raw JSON, Unexpected character error [closed]

Hi I need to send JSON format through the CURL command but I am getting an error. curl --request POST "https://app.io/api/graphql?accountId=Xzg" --header "x-api-key: WHpnV=" --...
user105835's user avatar
1 vote
0 answers
1k views

sObject Collections - Update Multiple Records via REST using PATCH - Bad Request 400

I am trying to use the Salesforce sObject Collections REST API resource that was released in Spring '18. Per the Salesforce Documentation, this should be a PATCH request, however when I try to call ...
Laslos's user avatar
  • 111
1 vote
0 answers
2k views

error=invalid_client_id for authentication

I have enabled the Contacts app in SF to be connected and have the consumer and secret keys. Following the steps in https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/...
sam452's user avatar
  • 111
1 vote
1 answer
2k views

Bulk Api:Storage limit exceeded

I am performing bulk api operations to load account records into salesforce using curl.I have a separate CSV file to do that job which consist of 5000 records.when I try uploading it, only 3500 ...
Priyalakshmi's user avatar
  • 1,456
1 vote
1 answer
308 views

Include the -u CURL parameter in HTTP Request in apex

I want to make a request from salesforce to a CURL definition like this: curl https://sandbox-api.openpay.mx/v1/mzdtln0bmtms6o3kck8f/customers/ag4nktpdzebjiye1tlze/charges \ -u ...
Edgar's user avatar
  • 1,279
1 vote
0 answers
1k views

Call Salesforce Apex Rest Post Method using PHP

The aim of this code is to call post method apex rest using php curl. But I am getting an error of response [{"message":"Unexpected parameter encountered during deserialization: Last Name at [line:1, ...
Danryl Tigol Carpio's user avatar
0 votes
1 answer
3k views

Persistant INVALID_AUTH_HEADER with curl on macos

I'm using curl to connect to a Salesforce org with OAuth (I'm following this tuto and get stuck at step 3): 1) Perform a User Agent OAuth request to get the session data below: { "access_token"...
fredbe's user avatar
  • 135
0 votes
1 answer
997 views

JSON with backslash for CURL. Not able to generate Apex request class

I have a request JSON that other system has given to use. It looks like below: { \"list\": [ { \"m1\": \"tval\", \"fill\": { \"tool\": \"4535\" }, \"respfield\": ...
SfdcBat's user avatar
  • 4,839
0 votes
1 answer
4k views

Calling a flow through REST api returns "http body is required" error

I'm trying to initiate a flow through the REST api using PHP: $url = "https://myInstance.salesforce.com/services/data/v40.0/actions/custom/flow/EndCourse_and_Semester_Notification"; $headers = array(...
RealGigex's user avatar
  • 175