Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [sfrestrequest]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
69 views

"message": "JSON request body must be an object at [line:1, column:2]","errorCode": "JSON_PARSER_ERROR"

I attempted to send an HTTP request and transmit a JSON to the Salesforce REST API in the following manner, but encountered the following error: Error: [ { "message": "JSON request body ...
yukichia's user avatar
1 vote
2 answers
1k views

Apex Callout Issue - System.HttpResponse [Status=Moved Permanently, StatusCode=301]

I am trying to make a callout to an open public api. When I tested it on Postman, it is giving me the expected response. But when I tried it on the Apex class, the response is giving me the following ...
Argen Turatbek's user avatar
7 votes
1 answer
42k views

{"error":"invalid_grant","error_description":"authentication failure"}

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":"invalid_grant","error_description&...
nekmancer's user avatar
0 votes
0 answers
84 views

Apex callout yields "Ending position out of bounds: -1" error

This is my vf page <apex:page controller="AccountRest"> <apex:sectionHeader title="Accounts" subtitle="List View"/> <apex:pageBlock> <apex:pageBlockTable value=...
Lokesh Malviya's user avatar
1 vote
1 answer
4k views

Apex Rest - Api error handling HTTP status codes

I am trying to handle multiple error codes in my REST service. Can anyone guide me if I am doing this correctly. try { if(Limits.getDmlRows() < Limits.getLimitDmlRows()){ ...
John M's user avatar
  • 33
2 votes
1 answer
5k views

to remove null value from the JSON response

I need help with sorting/cleaning up a json object. I have a global class for calling out responses with 4-5 objects. Consider this example (for sample with 2 objects), My requirement is that I have ...
AjaySFDC's user avatar
  • 618
0 votes
0 answers
107 views

entityFields="*" returns record ={}

Using signed request to run canvas app through a vf page. If entityFields=" * " is specified for the contact vf page, then the returned record is coming as empty. It works perfectly fine for all the ...
Danish's user avatar
  • 165
0 votes
1 answer
1k views

HTTP 400 Bad Request trying to create a bulk API job using RestTemplate

Am trying to use spring RestTemplate to create a bulk API job. Below is the code HttpHeaders headers= new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.add("sforce-enable-...
vemuri abhiram's user avatar
6 votes
1 answer
4k views

RestContext.request.RequestBody encoding/decoding %5D

I have a REST service which is receiving the encoded body of a post request, and I'm not able to decode the body into a valid json string for parsing. I also don't have much control over the ...
Greg J's user avatar
  • 175
1 vote
1 answer
840 views

Is salesforce apex rest parameter name case sensitive?

Let's consider the following rest request url for example https://login.salesforce.com/services/apexrest/paramcheck?User_ID=013456 Is parameter 'User_ID' case-sensitive? Can I use 'user_id' instead ...
Logesh9788's user avatar
1 vote
0 answers
123 views

Rest API - Duplicate products and partners are added to opportunities

I'm trying to add 2 products and 2 partners to an existing opportunity through REST API. Even though both products and partners are different, they have the same name and product code in SFDC. ...
Tara's user avatar
  • 11
5 votes
2 answers
4k views

Tooling API execute anonymous results

I am trying to run an execute anonymous statement using tooling API. I am running a very simple System.debug('test'); Now the issue is as this is a GET request, the response that I get is like this ...
SEuser's user avatar
  • 1,855
7 votes
2 answers
6k views

What IP is my Salesforce calling from in my REST call?

I wrote a REST service to call another system from Salesforce. They have firewalls up and such and I instructed them to Whitelist the Salesforce force suggested IPs at Salesforce IP Address to ...
dphil's user avatar
  • 6,185
1 vote
2 answers
138 views

Checking syntax of SFRestRequest

I am unable to get a response back ("didloadresponse" doesn't fire) from SFRestRequest and I am not sure why. Is the syntax of _queryParams correct?
Bartley's user avatar
  • 5,277
1 vote
1 answer
148 views

Identifying the callback to a SFRestRequest delegate

Is it possible and safe to set the SFNetworkOperation tag in the method initiating the request, and then read it back in the delegate method, to distinguish which request was made? Or is there a ...
Bradley Thomas's user avatar
5 votes
1 answer
11k views

"Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://login.salesforce.com/services/oauth2/token" [closed]

I am following web-server authorization flow for establishing the connection between one org to another org. as a 1st step i have get authorization code,when i am proceeding to 2nd step, getting above ...
Ankuli's user avatar
  • 670
0 votes
0 answers
40 views

is it possible to return the results of a report using the analytics api via SFRestRequest method?

I have built an app using the Salesforce Mobile iOS SDK V2.0 and I would like to be able to display the results of certain reports to the user. Is it possible to return the results of a report using ...
Bartley's user avatar
  • 5,277
2 votes
2 answers
304 views

how can I make a copy of the SFRestRequest block?

I need to know how I can make a copy of the SFRestRequest block in my iOS app built with the Salesforce Mobile SDK 2.0 so that I can not only call once out to salesforce with a SOQL query from one of ...
Bartley's user avatar
  • 5,277