Questions tagged [rest]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
77 views

Calling REST APIs based on a session established via a community login

I'm currently dealing with an authentication issue with two different Salesforce REST API endpoints. We are trying to consume the API from inside a Visualforce page in a Salesforce community. To do ...
2
votes
2answers
51 views

Which endpoints are supported for OAuth2 token authorization?

Documentation says that for OAuth2 token authorization URL like login.salesforce.com should be used For authorization: https://login.salesforce.com/services/oauth2/authorize For token requests: https:...
2
votes
1answer
69 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&...
2
votes
1answer
367 views

Composite Api Objects and Referencing RecordTypes

Is there anyway to reference an account recordtype by Name when creating an account using Composite API which has recordtypes? I am hoping there is a way so I don't need to do a get request to get a ...
2
votes
1answer
813 views

How to consume REST service created in salesforce

I created a rest service in salesforce as below: @RestResource(urlMapping='/v1/accounts/*') global with sharing class REST_Account_Service_V1{ @HttpGet global static Account doGet(){ ...
2
votes
1answer
454 views

Chatter REST API Limit

Is there any way to increase the Chatter REST API limit of one poll per minute is a hard limit and cannot be increased? We built a connected app using REST from a 3rd party portal application and ...
2
votes
1answer
705 views

REST SERVICE - Unexpected parameter encountered during deserialization

its all perfect! why is this happening? the same endpoint and JSON works in workbench but not in my java code: REST API : @RestResource(urlMapping='/RestTest/*') global with sharing class ...
2
votes
1answer
1k views

apex REST WEB SERVICE : Unexpected parameter encountered during deserialization: startdate at

I have a few json's that I'm posting with the access-token as header, when I send two parameters I get a status message from my rest api successfully, but when I send more than 2 parameters I get the ...
2
votes
1answer
52 views

Speed difference between Connected App created on Developer Edition vs Enterprise Edition

We use a Connected App to allow our clients (from different organizations) to authorize and provide our platform API access to their data. Our original developer set this Connected App up on our ...
2
votes
1answer
234 views

Simulate/fake long running REST request

I want to simulate / fake a long running transaction context - does anyone have any code which I can use to artificially extended my transaction context in a controlled way? Thanks
2
votes
1answer
38 views

Save error: Constructor not defined: [Sample11.EventData].<Constructor>(Id, Datetime, Datetime, String)

I'm trying to expose user related events using REST API but I get the error at line 33. Why? Error Line: EventData eveData = new EventData(eve.Id,eve.StartDateTime,eve.EndDateTime,eve.subject); ...
2
votes
1answer
137 views

Authorization for APEX Webservice

We're writing an internal Apex REST webservice to accept POST requests from an external system to call. The kink here is that we cannot control the process in which the external system calls our ...
2
votes
1answer
756 views

Twilio/Apex: receiving messages through a controller

I'm totally stuck trying to receive SMSs from Twilio into SF. I can send out fine. This is what I've got so far, and all it returns is an invalid_session_id error. @RestResource(urlMapping='/textlead/...
2
votes
3answers
567 views

How long does it take a create/update/delete to complete with the REST API?

The logic for my code is: look for a Lead with a specific email; if none exists, create a Lead with that email address. The problem is that this code is running pretty frequently for the same email ...
2
votes
1answer
1k views

Web Service limits for inbound calls to managed package

I am developing an AppExchange managed package intended for multiple organizations. I have a web-service in the managed application which I will invoke from my java based server to achieve few ...
2
votes
2answers
32 views

RestResource extracting array from JSON packet

I am currently receving a JSON packet from an external server and placing the values in variables for further use. The JSON packet has an array that can and will grow depending on the amount of assets ...
2
votes
1answer
233 views

Difference between Authorization Code and Access Token [closed]

Can you please explain the difference between authorization code, access token and bearer token? I've been looking for this on Google but didn't clear things for me. From REST API dev guide all I ...
2
votes
1answer
657 views

How to get instance name/key via API

Is there a way to get the instance name of a Salesforce organisation (like na41) via the REST API in a reliable way? I've looked at existing resources available and they do not seem to expose that. I ...
2
votes
1answer
2k views

Getting OAuth access token for my Marketing Cloud App in App center

I have created an App in Marketing Cloud in App center, as off now the app summary page gives me Cilent Id, Client Secret and Application Id for my App. But, I also need OAuth token for connecting my ...
2
votes
1answer
564 views

Wave REST API returns BAD REQUEST ERROR 400

public class SendWaveUsingRESTAPI { private final String clientId = 'xxxx'; private final String clientSecret = 'xxx'; private final String username = 'xxxxx'; private final String password = '...
2
votes
1answer
1k views

can we execute webservice from developer console

@RestResource(urlMapping='/Merchandise/*') global with sharing class MerchandiseManager { @HttpGet global static Merchandise__c getMerchandiseById() { RestRequest req = RestContext....
2
votes
1answer
627 views

How to create trigger for DatedConversionRate object

We're using multicurrency in our project. DatedConversionRate has been updating every day by external process. The requirenment is to update CurrencyType records with most relevant rates. At the ...
2
votes
1answer
105 views

Return a response after calling a REST point created on salesforce, while the REST point is calling a @future method

I have crated a RESTful endpoint on my sandbox. When it is called with the proper input it creates a new contact and then decorates a custom response class I created for that purpose and at the end it ...
2
votes
1answer
417 views

Assignment rule always auto fire with no reason

I got a project which needed to setup an public community as an endpoint to receive JSON messages (URL post method). My community home page got a restful apex class to receive message and process it ...
2
votes
1answer
3k views

System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set while deseriliasing json Payload

> I have resolved the issue updating answer for my own question thanks for response Stack-exchange great help everytime : > > > 1.Malformed JSON: Expected '[' > > Answer:...
2
votes
1answer
858 views

JSON.deserialize with arrays with one to many elements

I am consuming a REST service with APEX. Here is a response sample: { "createQuoteOutput": { "response": { "quoteNumber": 945, "temporaryQuoteNumber": "T8652" }, "...
2
votes
1answer
759 views

Rest Response Data Styling

I am using a Force.com site to expose a Visualforce page which calls out to the Stripe API via Javascript for a financial transaction. It's all working perfectly, but I am new to REST and can't quite ...
2
votes
1answer
40 views

Reg : Sending Response for insert records

i wrote a rest service i am inserting 2 fields if i get any null value for any field i have to send the JSON response to the third party server can any one suggest me where i have to change my service ...
2
votes
1answer
29 views

Number of Execution Contexts during Callouts

I am trying to understand how execution context works with respect to callouts. Use case : Whenever an Account's status is updated to "Ready for Integration", a REST callout will happen towards an ...
2
votes
1answer
60 views

How to get employee count via joins

I am trying to write a function that returns a list of companies and how many employees are under that company but am unable to figure out how to do this in a single request. Given: search term = "...
2
votes
1answer
956 views

REST API cc and bcc for Triggered Send

Does anyone know if CC and BCC was ever added as capabilities to the SFMC REST API for Triggered Send e-mails? The last question I could find here... Exact Target Triggered Send using REST API, ...
2
votes
1answer
366 views

Apex Rest API Public Web Service Cannot See Data?

I saw how to implement public REST API with Salesforce, Can I have a public APEX REST API? https://developer.salesforce.com/blogs/developer-relations/2012/02/quick-tip-public-restful-web-services-on-...
2
votes
1answer
2k views

Webcallout through proxy

We have a webservice they is being moved to a proxy. It works when calling it by normal means (using Advanced REST Client plugin), but when calling from Salesforce we get an 'Unable to Tunnel through ...
2
votes
3answers
1k views

How to get SObject type from object Id using REST API?

I have an object id that is a "parent id" of a specific Attachment object (e.g., b3KD0000119wDTlMAN). I'd like to understand what type this object belongs to, to query for it's details. It can also be ...
2
votes
1answer
922 views

Is it possible to add rich textbox with image via rest?

I'm wondering whether it would be possible to add text with image to rich text area field by rest. How should be done and how would i have to make such a request?
2
votes
1answer
1k views

Exact Target Rest Auth API

I'm trying to call the exact target auth api for the first time. I'm getting a 407 Proxy Authentication Required. Can you please let me know where I'm going wrong. I'm using the following call ...
2
votes
1answer
713 views

Can you call a REST service from Eclipse?

Can we call a rest service from Eclipse? We can call REST service from workbench to test whether its working fine or not. If you want to see the logs, we wont be able to see the whole log in ...
2
votes
1answer
404 views

GET method for download WSDL

I want to download wsdl file programmaticaly, using my Web JavaScript application. First I do Oauth login and get all tokens. Then I try to download WSDL file using JavaScript: var xmlHttp = ...
2
votes
1answer
770 views

How do I prepare Salesforce to accept HTTP request from an external system?

A text messaging system we're integrating with includes a feature that sends an HTTP request to a URL with message receipt data but I'm not sure how to prepare our Salesforce to deal with it in the ...
2
votes
1answer
115 views

Is it Possible to define the Subject/Body of a Message at Send Time?

Is there a way to send a completely dynamic message through ExactTarget? We would like to create a "template" email, and then if at all possible, specify the subject and body of the email/message ...
2
votes
1answer
290 views

Adding object through REST API not appearing on chatter?

So my problem is that when i create an item, for example a new contact, which is related to an Account, the action of creating that object doesn't get shown on the chatter feed for that account. I ...
2
votes
1answer
35 views

is it possible to save data of my customized application in visual force workbook to my own database with out using salesforce database

I created one application in salesforce.com.That application contains create,Update,delete,GetList buttons.Is it possible to save data in to mysql database(my local database) when user clicks these ...
2
votes
0answers
33 views

LWC - Retrieving WAVE Dataset information

I'm trying to make a callout to /services/data/v45.0/wave/datasets in a lightning web component. I can successfully make the callout for the running user in apex using UserInfo.getSessionId() but ...
2
votes
1answer
33 views

POST a record from Org1 to Org2 with JSON and Map

I need to post created record from Org1 to Org2. I want to "put" my JSON into Map and just "open" Map in another Org. Needed result: fields from new Org1 Object's record = fields from new Org2 Object'...
2
votes
0answers
97 views

How can I update a User Record from a custom AuthProviderPlugin's getUserInfo() method?

I am trying to integrate Salesforce with Jira using a Named Credential and oAuth 2.0. The Named Credential requires a Custom Auth. Provider which requires an AuthProviderPluginClass. The ...
2
votes
0answers
40 views

Cannot insert Contact with REST API if a Lead with the same e-mail address exists

I noticed in the UI that when I try to insert a contact with an e-mail address that a lead already has, I get a warning (before I click save and insert the contact) saying that this is a possible ...
2
votes
0answers
323 views

REST API - Issue connecting JS app when CORS and Remote Site are both setup properly

I cannot connect to Salesforce to automatically create accounts from my javascript app. I continue to get the error: "Failed to load https://login.salesforce.com/services/oauth2/token: No 'Access-...
2
votes
1answer
656 views

Sending batch rest api request from apex

I need to get multiple data from salesforce. To get the resource i call the endpoint as shown below. public String getData(Id docId) { HttpRequest request = new HttpRequest(); request....
2
votes
0answers
227 views

Bug? FieldDefinition is Createable via Tooling API

I found this question very interesting: Programmatically Determine Which Objects Allow Lookup References to Them? In my naiveté, I thought perhaps this question could be answered by using the Tooling ...
2
votes
1answer
978 views

Apex REST API escaped quotes

I'm trying to build a slack integration with an apex rest endpoint. and I need to get a message in a format such as below. Normally I would create an object and return the object, however slack uses ...