Questions tagged [curl]
cURL is a computer software project providing a library and command-line tool for transferring data using various protocols.
70
questions
0
votes
0
answers
62
views
OAuth 2.0 Refresh Token Flow for Renewed Sessions
I'm trying to get access token as described here -> https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_refresh_token_flow.htm&type=5
Everything works fine as long as I send ...
1
vote
0
answers
138
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 ...
0
votes
2
answers
1k
views
{"error":"unsupported_grant_type","error_description":"grant type not supported"} on executing curl command
I know this must have been posted here and I've tried the solutions I've searched across the web but I am still getting the error
{"error":"unsupported_grant_type","...
-1
votes
1
answer
4k
views
Salesforce authentication failure
I am trying to POST to the API Endpoint https://login.salesforce.com/services/oauth2/token
as shown in the screenshot
this is the first step towards authentication which is failing and giving an error ...
0
votes
0
answers
1k
views
Curl - JSON_PARSER_ERROR Unexpected character
getting the following error using curl with salesforce, I'm trying to update a record. Have I formatted this wrong or am I missing something
Many thanks for your help
curl https://##url##/services/...
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=" --...
0
votes
0
answers
575
views
connection to salesforce with curl, no response
As a followup of windows curl authentication error, i'm doing the tutorial on https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_webservices?trail_id=...
1
vote
1
answer
875
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/...
0
votes
1
answer
767
views
"Session expired or invalid' when I send.a get request for data
I am a front-end dev trying to hook a salesforce api to one of my apps.
For practice (yesterday) I created a new connected app and used the below to fetch some data and it worked
curl https://tahina-...
0
votes
1
answer
573
views
Token request sends a redirect instead of token or error
I have trial Enterprise account and I can successfully obtain a token with the below curl.
curl -v https://eu31.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=...
0
votes
1
answer
409
views
Convert cUrl to rest in Apex?
I have a curl request which I have to convert to a rest request in Apex. This is the request:
curl https://api.stripe.com/v1/subscriptions \
-u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
-d customer=...
1
vote
1
answer
266
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='';
$...
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 ...
1
vote
1
answer
422
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 ...
0
votes
3
answers
2k
views
Calling REST APIs from PHP with curl
I've successfully received an access token thru the API, but no matter what I do I keep getting this "INVALID_SESSION_ID". Does this mean the access key is invalid? I've tried lots of suggestions from ...
0
votes
1
answer
206
views
SFMC API call to 3rd party when unsubscribing
We're using a 3rd party for a refer a friend service that also has a subscriber status. We'd like to link a user's unsubscribe to the 3rd party service when a user unsubscribes through the profile ...
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"...
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 ...
0
votes
1
answer
753
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\": ...
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/...
1
vote
0
answers
982
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 ...
0
votes
2
answers
581
views
Trying to run a sql activity thourgh a curl SOAP request - SoapAction incorrect?
If I manual trigger/run the activity the destination Data Extension is being filled correctly. However when try a SOAP request using curl, nothing happens... I've tried 2 different SoapAction values. ...
1
vote
1
answer
736
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 ...
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/...
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 ...
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 ...
0
votes
1
answer
3k
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(...
0
votes
0
answers
87
views
Update a Record's Fields in Production Org from External Website w/o Salesforce Login
I have a form on my WordPress website that collects additional information from customers. I want this information added to an existing record of MyCustomObject. To do this, I will need to make a ...
1
vote
1
answer
504
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 ...
0
votes
1
answer
141
views
Populate Primary Point of Contact Field ( Business Account ) from Contact Object
I am using PHP cURL to populate data in the Customer, and the Account Object. I am working to link the two objects together via Contact Role. In which object field do I need to assign a value to in ...
0
votes
2
answers
475
views
How to create a business account with the REST API
I can create a person account using the REST API, but I can't seem to find any documentation on how to create a business account. I imaging that the post items you send need to include something extra ...
0
votes
1
answer
6k
views
Authorization PHP Curl returns Login page instead of token
I am trying to use PHP curl to authenticate my app's user, but instead of authenticating with OAuth it returns the actual html login form as a response. Why? I don't want to redirect the user over and ...
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 ...
3
votes
1
answer
965
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 this_is_a_valid_token" -X ...
0
votes
1
answer
896
views
Username/password authentication curl attempt failture
I'm trying to get an access token using following curl:
curl --data grant_type=password&client_id=Y&client_secret=Z&username=A&password=B+C
https://login.salesforce.com/services/...
0
votes
1
answer
304
views
Posting Jenkins build status to SFDC via rest API chatter
We are trying to explore how we can post Jenkins build status to SFDC via Rest API Chatter. Tried below steps
Generated Access Token
curl -X POST --form client_id=...
0
votes
1
answer
2k
views
Convert cURL to Salesforce APEX rest api
Hoping someone could help with this little problem I am having, I have a cURL that works just fine, but what I need is an Salesforce APEX / Rest API / HttpRequest instead. Here is my cURL:
curl -X ...
0
votes
1
answer
359
views
Where to find an example of using cURL, PHP, and a pick list value to select another field?
Can someone give an example, or a link to an example, of using PHP and cURL to select a column's value based on a pick list value?
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 ...
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-...
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/...
1
vote
1
answer
3k
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=...
1
vote
2
answers
193
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 ...
2
votes
0
answers
50
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 ...
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 ...
4
votes
0
answers
899
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 ...
1
vote
1
answer
295
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 ...
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....
1
vote
1
answer
2k
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(...
2
votes
1
answer
685
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 ...