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
0answers
30 views

Intermittent TLS handshake failure on calling REST API

I have the following script that repeatedly queries the Salesforce REST API: #!/bin/bash set -e curl -vv -sSL -G -D - -o /dev/null -XGET \ -H "Authorization: Bearer <TOKEN>" \ -...
0
votes
1answer
30 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
1answer
20 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
1answer
57 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
1answer
27 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=''; $...
1
vote
1answer
202 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
1answer
45 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
1answer
426 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
1answer
50 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
1answer
884 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
2answers
339 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
1answer
319 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
0answers
411 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
0answers
402 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
2answers
212 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
1answer
206 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
0answers
740 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
2answers
802 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 ...
4
votes
1answer
789 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
1answer
1k 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
0answers
49 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
1answer
382 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
1answer
33 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
2answers
200 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
1answer
4k 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 ...
0
votes
2answers
6k 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 ...
2
votes
1answer
544 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
1answer
627 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/...
2
votes
2answers
973 views

Slow REST API return for first call of day (30s+)

I asked this question on the SF developer site, but didn't hear back. Hopefully, somebody here has seen this before, and can help me out. We have boiled it down to a few cURL calls for ...
0
votes
1answer
211 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
1answer
986 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
1answer
282 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
1answer
824 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
3answers
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
2answers
964 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
1answer
2k 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
2answers
171 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
0answers
37 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
1answer
148 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
0answers
609 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
1answer
243 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
2answers
847 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
1answer
1k 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
1answer
598 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 ...
0
votes
1answer
737 views

Problem getting AUTH Token

I'm trying to get an Auth Token (using PHP) and having trouble getting back the authorization code so I can make the next call and get the Auth Token. I set up a connected APP in the console and have ...
1
vote
0answers
707 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
1answer
522 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 ...
2
votes
1answer
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 ...
4
votes
1answer
1k 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....
2
votes
2answers
7k 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 ...