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
0 votes
1 answer
907 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
786 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
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
0 answers
75 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
149 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
1 answer
647 views

Having Trouble with Force.com REST API oAuth2 Authentication

I am experimenting with Pat_Patterson's "Interact with the Force.com REST API from PHP". I am using PHP Version 5.6.3 , and I already registered my app via Setup->Create->Apps->Connected Apps. I setup ...
0 votes
2 answers
2k 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","...
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"...
-1 votes
1 answer
5k 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=" --...
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 ...
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/...
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
0 answers
622 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
931 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
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 ...
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 ...
0 votes
1 answer
590 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
429 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
2 answers
657 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 ...
1 vote
1 answer
268 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
441 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
1 answer
214 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 ...
4 votes
1 answer
2k 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....
0 votes
1 answer
795 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
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 ...
0 votes
2 answers
616 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. ...
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 ...
1 vote
1 answer
773 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/...
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 ...
1 vote
1 answer
297 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
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 ...
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
1 answer
145 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
0 answers
90 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
509 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
2 answers
480 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 ...
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={$...
3 votes
1 answer
982 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
307 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 ...
1 vote
0 answers
983 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, ...
0 votes
1 answer
368 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?
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-...
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 ...
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 ...