Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest]

The REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

2
votes
1answer
448 views

Error doing callout to a site with GoDaddy certificate

When we try to send some data to an external web service (REST, POST, JSON), we get the next error: System.CalloutException: sun.security.validator.ValidatorException: PKIX path building failed: ...
2
votes
0answers
79 views

Using the REST API, how can I tell that a user has blocked OAuth access vs revoked OAuth access?

It seems that I get the same authentication error message the token is invalid. Is there a way I can tell the difference as the vendor? Note that I am not referring to an Apex app. My app is purely ...
2
votes
1answer
5k views

400 Bad Request in Response

I have been using working on an Applicaion in angularjs, and While getting response of 2nd request for the token, I am getting following an error. Illegal Request You have sent us an Illegal URL or ...
2
votes
2answers
658 views

Salesforce rest query “join”

So I would like to know if a domain is in three or more tables Normally I would do something like this to get one row SELECT c.Email, a.Website, l.Email as leadEmail FROM Contact as c ...
1
vote
1answer
317 views

Rest uri using Workbench

How can i create a child record in Rest URI. For example how can I create a Contact for Account using Rest URI in Workbench. Your help is much appreciated.
1
vote
1answer
5k views

JSON Parsing of REST response

I am trying to integrate our Salesforce with Yodlee. I have been successfully able to send and recieve REST response to their test server. My issue is with the REST response body. Their REST response ...
1
vote
2answers
1k views

can we query SOSL using REST API?

can we query SOSL using REST API? As we can do with SOQL like this : /services/data/v37.0/query/?q=
1
vote
3answers
4k views

Consume SFDC REST Service through Mulesoft ESB

I wanna consume a REST service exposed by Salesforce, right now I'm using a Sandbox instance and using Anypoint Studio to create my flow, I would like to know what's the best practice to implement it. ...
1
vote
2answers
102 views

Dynamic JSON Body in HTTPPost Ampscript

I am trying to set dynamic JSON parameters in an ampscript HTTPPost. When attempting to insert those parameters it only returns the actual ampscript function and not the data that was supposed to be ...
1
vote
1answer
2k views

Best way to parse JSON Response from Google Maps?

I've written something that will get the longitude and latitude from a Google Geocode Callout. The response we get from a generic callout looks like this: { results=( { ...
1
vote
1answer
45 views

Restforce Assistance

I'm new to ruby and I've managed to connect my SalesForce app via oauth. I was following a couple of examples in Restforce. And I made the following query: accounts = $cliente.query("select id from ...
1
vote
1answer
2k views

Creation of a Public API

In my company's existing CRM system we have a lot of public APIs that are accessible to everyone in the web (kinda like Flickr APIs). We are planning to shift our CRM into Salesforce in the near ...
1
vote
2answers
153 views

How to be able to process a large JSON response?

We're calling an external REST service from Salesforce and are receiving a JSON response of more than 45 MB. Has anyone attempted anything like this?
1
vote
1answer
31 views

JWT authentication without a username?

I'm working on a managed package that needs to allow an external web service to call an Apex REST endpoint within the package. As far as I'm able to gather, the best route is to use OAuth2 JWT ...
1
vote
4answers
429 views

How to update a record in a trigger with value from a REST API?

When an account is saved I need to update it with value from a REST API. I though my approach would work but I'm getting the following compilation errors. Method does not exist or incorrect signature:...
1
vote
2answers
79 views

Existing Test Class - Getting 500 error

Why would I get an 500 error on this test class? I am troubleshooting someone else's test class and am only getting five out of nine methods passing with all four failing methods failing on the ...
1
vote
1answer
486 views

Rest call with same salesforce org - [Status=Unauthorized, StatusCode=401]

Can some one please guide me where I am going wrong. For some reason i have to invoke the same instance. But i am getting [Status=Unauthorized, StatusCode=401] Error when I Debug. public class ...
1
vote
3answers
533 views

Trailhead : HTTP Post Issue : JSON does not contain correct case sensitive keys

I am using Chrome Extension (Advanced REST client) to mock sending/receiving my HTTP payload. Request Screenshot Response Screenshot I am following exactly as per the guidelines given in that ...
1
vote
1answer
1k views

Callouts in triggers not currently supported? [duplicate]

I'm getting an error when I am call non void method from REST API class. Trying to add the Rest Response id in contract object. trigger RestAPIcalloutTrigger on Contract (after insert , after Update) ...
1
vote
1answer
3k views

Solving issues of System.HttpResponse[Status=Method Not Allowed, StatusCode=405]

I am trying to use REST in posting/inserting List of Account records from an origin org (OrgA) into a target org (OrgB). I have this error of "[45]|DEBUG|RESPONSE_BODY : System.HttpResponse[Status=...
1
vote
2answers
1k views

Error Message for web service call?

I am trying to write a valid error message for when certain lists/calls return empty, without having to remove 'void' from my class, what is the best practice/syntax for this task? I know I can remove ...
1
vote
1answer
305 views

Retrieve a list of all JobID done in Marketing cloud

I want to know if you can retrieve the list of all jobID via a REST or API call, I found nothing in the official doc so does anyone have a trick to get this list? There should be a way, because if you ...
1
vote
2answers
232 views

Salesforce Marketing Cloud REST vs SOAP API

This quetion is related to marketing cloud APIs. I need to perform below tasks on marketing cloud via API. Create a Data Extension Create a Query activity Run query activity Retrieve data from Data ...
1
vote
1answer
1k views

Create PDF from the created record and save it as attachment

Good day everyone. I am trying to create a pdf from a newly created record. I search in the internet and I find this link : https://jungleeforce.wordpress.com/2014/06/11/generate-a-pdf-and-attach-it-...
1
vote
2answers
170 views

Apex Rest Web Service Error - List index out of bounds

All, I have seen this problem documented numerous times but have yet to find a fix that will address my situation. I am trying to either update an existing case or create a new on based on SOQL look ...
1
vote
1answer
2k views

RestResource Annotation - What is the urlMapping To?

I have never worked with Rest Resource classes before and am trying to debug one from a previous developer. I am looking at: @RestResource(urlMapping='/CompanyData/*') and am unsure what CompanyData ...
1
vote
2answers
2k views

ErrorCode 180008 - Unable to queue Triggered Send request. There are no valid subscribers

I'm trying to send an email by ET rest api in Java. I already successfully sent a SMS and got a token in response, but an error is triggered with emails. Here is the JSON I send : { "To": {"...
1
vote
1answer
846 views

Accessing Apex rest class with OAuth 2.0 with Named Credential authentication mechanism

I have been trying to implement Oauth 2.0 in my org and my requirement is to use Named credentials only when making a apex callout. I am using Named credentials, Oauth, Connected Apps and auth. ...
1
vote
1answer
296 views

JSON deserialise doesn't give the full string

When deserializing a JSON string to List<Object> using JSON.deserializeUntyped( resParams ) the list received is incomplete: {Address=null, BillingAddress=2509, CompanyId=632, County=null, Fax=...
1
vote
1answer
345 views

How to Use Reserved Keywords in a REST Resource?

I have configured Plivo SMS in my org. Sending and logging outbound messages is no problem. I have configured a Plivo app to direct inbound SMS to my rest resource to create an inbound record (custom ...
1
vote
1answer
189 views

Authenticating REST Users

I'm working on extenral service that will use REST API. The service will make a login to Salesgforce every day and will run REST queries. From this article, it seems that I need to use OAuth2 - ...
1
vote
1answer
346 views

Datetime representation in SOQL executed via REST API

I am trying to execute below SOQL using Salesforce REST API using Postman services/data/v36.0/query?q=Select Id from Opportunity where CloseDate < 2016-07-31T04:17:54 But I am getting below ...
1
vote
1answer
130 views

Attempt to de-reference a null object in rest test class

I'm writting a test class for a rest class, and I'm getting a System.NullPointerException: Attempt to de-reference a null object and Class.RESTCommande.getCodeCommande: line 28, column 1 ...
1
vote
2answers
4k views

ExactTarget Triggered Send is not processing any messages

I have created a triggered send in Exacttarget which I am calling via APIs (SOAP and REST). While trying out the REST APIs I ran into two errors after which the triggered send has stopped processing ...
1
vote
3answers
6k views

convert json to string

Trialhead Apex REST Callouts challenge https://developer.salesforce.com/trailhead/apex_integration_services/apex_integration_rest_callouts Hi i am very new to salesforce and has statred learning ...
1
vote
1answer
121 views

Authenticated Outbound Calls

I am sending an outbound call when an update is done in account. I am using REST Service and sending data as json from salesforce to my API. Now how do i authenticate this call. APEX Class public ...
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(...
1
vote
1answer
517 views

405 response code when trying to callout to Google

Here is my code for callout. Http http = new Http(); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); req.setEndpoint('https://google.com?q=...
1
vote
1answer
764 views

Salesforce APEX REST calls to Marketo

I'm trying to use the HTTP Callout methods provided in Apex to 1. Get a token from Marketo 2. Use this token to create three leads in Marketo using the REST API However, it doesn't seem to be ...
1
vote
2answers
206 views

How to identify what type of request is coming

I have a class with @restresource. To which a request is coming to insert the record. How can we identify what kind of request is coming in. Is it XML or JSON format. Is there any way to identify ...
1
vote
2answers
1k views

Display dashboard in VF Page

I want top display dashboard in VF page. When I am trying to do it using blank window appear. <apex:iframe src="/01Z28000000Hdzo" > Right now I am doing as per follows. Page - <script ...
1
vote
1answer
164 views

Calling ToolingAPI to save an AuraDefinition using PATCH via JavaScript possible?

I'm trying to save an AuraDefinition from within a native Visualforce app. Therefore I following @MartyC. suggestion here: Lightning ToolingAPI BETA Documentation As an unfortunate PATCH requests ...
1
vote
1answer
72 views

REST Request - AWS Access Key ID and AWS Secret Access Key [closed]

I am reading this document Authenticating Rest Requests The first paragraph says .. Every non-anonymous request to S3 must contain authentication information to establish the identity of the ...
1
vote
1answer
38 views

Third party wants to call Salesforce.Can we use named credentials in this case

i have a use case where Some code has been written in salesforce and Third party wants to call it.They are calling using rest like this. https://xxx.com/services/oauth2/token?grant_type=password&...
1
vote
1answer
34 views

HttpGet and Callout: is not a valid Salesforce ID for the type

I get Item's list from 1 organisation and want to insert them like Another Items in 2 organisation. But it try to insert it with Id. How can I fix that? Error: System.DmlException: Insert failed. ...
1
vote
1answer
461 views

How to use HttpGet service to get a list of objects and create them?

I have a callout method which helps to get an list of objects from another salesforce-organisation. But how can I convert this list into objects on callout's organisation side? And how can I do this ...
1
vote
1answer
320 views

Test for HttpPost service: how to take JSON body for test?

I have a HttpPost methods. And I really don't know how to test it correctly. My methods: public static App__c ParseRequest(RestRequest req) { App__c app = new App__c(); String body = req....
1
vote
1answer
374 views

BULK API V43 Pass Date/Time Value

I am trying to make a PUT call via fiddler passing in Content-Type: text/csv. I am able to pass in all fields, however it fails on one of the fields that requires a date/time value. I am passing in ...
1
vote
1answer
23 views

Is there a rest api that check the api calls limit without consuming an api call?

I wanted to check my daily api requests, with /services/data/v37.0/limits/. It consumes an API call. How do I check one without consuming an API call?
1
vote
2answers
267 views

updating json response salesforce

{ “FirstName” : “Foo”, “LastName” : “Bar”, “Address” : { “city” : “Pune”, “state” : “Maharashtra”, “country” : “India” } } My issues is to fetch the "city" value from the above json ...