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-api]

REpresentational State Transfer (REST), or RESTful, web services provide interoperability between computer systems on the Internet. The Salesforce REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

46
votes
5answers
11k views

How to call a Salesforce REST URL from Lightning Component?

I want to call a Salesforce REST URL from a Lightning Component. Specifically, I'm trying to call this Analytics API URL: /services/data/v32.0/analytics/reports. I see the following error in the ...
21
votes
2answers
19k views

How can i integrate one SFDC org to another SFDC using Rest Api

I am trying to integrate one Salesforce org to other org by using Oauth setup, I wanted to use use consumer key and consumer secret key in my REST class to connect with the org, after connection part ...
30
votes
1answer
5k views

Can I have a public APEX REST API?

Can I have a public APEX REST API e.g. APEX REST api that is accessible without authentication?
9
votes
2answers
6k views

screen scrape Salesforce with REST GET call from Apex

Consider this code snippet from my answer to rao's question: String requestUrl = '/services/data/v26.0/sobjects/User/describe'; Http http = new Http(); HttpRequest req = new HttpRequest(); req....
7
votes
4answers
6k views

SessionID problem in Schedule Batch class

I have my below batch code and i need to schedule it daily at 12.00 AM. The batch runs but nothing gets done due to the session ID problem. How to solve this problem. public class updateCurrencyBatch ...
13
votes
2answers
10k views

Updating multi currency rates from Apex

I just looked in the Salesforce.com documentation for a way to update currency rates using Apex, but I have a vague feeling that this is not possible using standard features. I noticed that a couple ...
0
votes
2answers
539 views

Need to pass Field api name and its value in API call using field set [closed]

Need to make the requested body for Rest POST call in which key(API name) and value both go dynamically in JSON format. API name comes from field set and its value come from the database using query. ...
23
votes
2answers
5k views

Callout loop not allowed error

I have an APEX REST POST method that is being called from an external system 'A'. Processing this POST I need to callout to another external system 'B' and based on its response continue with my ...
15
votes
2answers
12k views

PATCH request using Apex HttpRequest

I'm looking for a way to create an HttpRequest in Apex using a POST method. When I do it, I hit this error: { "message": "HTTP Method 'POST' not allowed. Allowed are HEAD,GET,PATCH,DELETE", "...
6
votes
2answers
2k views

How do invoke an apex method of one org, from another org?

I have already connected both orgs using REST API web-server flow. What should I use, Tooling API? APEX REST? How do I connect them?
7
votes
1answer
7k views

Test class Rest Webservice parameters

I´m having problems with url parameters (req.requestURI) in my test class. This is my code. REST CLASS: @RestResource(urlMapping='/Accounts/*') global class StoreController { @HttpGet ...
5
votes
1answer
1k views

Get Preview of Email with AMPscript Using Rest API

Im trying to get the SendPreview rendering of an E-Mail with Contact Data from an Dataextension. The E-Mail includes AMPScript. I tryed the following route: https://www.exacttargetapis.com/guide/v1/...
9
votes
1answer
5k views

Whats the Actual meaning of ALL ROWS in SOQL?

I did the following 1)Deleted a record in sfdc and then ran the query using ' ALL ROWS' keyword and i could see that as per the documentation that data from recycle bin is also retrieved with ...
4
votes
1answer
1k views

Error: Compile Error: Invalid field Campaign for SObject Lead

I created Rest post method for inserting new lead record but in lead Sobject there is Campaign Lookup filed name is 'Campaign' but when i save this method i got the error "Error: Compile Error: ...
14
votes
2answers
6k views

REST API without Connected App

I have to design an external app which will retrieve information from Salesforce. Any user can install this app and use it. This app will use rest API to access information from Salesforce. I cannot ...
31
votes
1answer
25k views

Writing Test Classes for Apex RestService

I was writing test classes for my apex Rest Service that i had built for an ipad app. I noted very interesting things while experimenting.Before anything i just did a google and found an interesting ...
10
votes
3answers
12k views

How to Insert/Update multiple records in a single Force.com REST API call?

We can use the Force.com REST API to perform DML operations. I want to know if there is a way that we can insert/update more than 1 record using a single REST API call.
1
vote
1answer
842 views

Retriving all Active picklist values of all recordtypes

Can you please guide me best way to retrieve all active picklist values of all recordtypes of object. Can it be possible through API or any Apex Script. I want something like below and i will write ...
8
votes
3answers
2k views

Is it possible to pass sObjects to the REST api

I only found solutions that pass objects or primitiv datatypes to the REST API, so do I need to pass these to rebuild my sObject or is it possible to pass it as an sObject JSON? I tried to, but I can'...
2
votes
1answer
3k views

How do you convert a Lead via the REST API?

Am a bit new to Salesforce, integrating with our existing systems which uses Python, so I'm making use of the simple_salesforce module. It's working great, except I cannot figure out how you convert a ...
2
votes
2answers
1k views

Affinity token missing from SessionId call

I've recently tried using the Live Agent Rest API and I am unable to even establish a session. I'm following the official online documentation, and according to it when I do the initial SessionId call,...
4
votes
2answers
2k views

REST API Methods in AMPScript or SSJS

Is there any way via AMPScript or SSJS to utilize HTTP methods outside of GET and POST? I have had no problem utilizing these two via the HTTPPost() and HTTPGet() functions, but have not found any ...
11
votes
3answers
7k views

How to Search Workflow Rules or Validation Rules etc in Apex i.e. Metadata Search via Apex?

Recently I'm working on building something for developers/administrators - a handy 100% force.com app allowing to search metadata. Currently this app allows you to quickly search (from sidebar) custom ...
6
votes
3answers
12k views

Exporting Data From Salesforce - REST or SOAP?

We have a requirement where we need to export records from salesforce tables into our application programmatically. I am reading on the various API's for data integration from salesforce mainly SOAP ...
15
votes
4answers
7k views

How can I add an @mention when creating a FeedItem via APEX?

I have found that this can be done via the Chatter API, and that there is a pilot program (http://developer.force.com/cookbook/recipe/connect-in-apex-pilot) to bring this to APEX, but I am not ...
11
votes
4answers
5k views

Is it possible to insert multiple records in Salesforce using cURL at the same time?

I am using cURL to insert data into salesforce. It works with single record but I need to insert multiple records at a time. Is it possible to do so and is it possible via a REST interface?
7
votes
1answer
2k views

Customer Community login using REST API

I want to login a customer community user using rest api or at least using soap api. I have created a user using the REST API. To create the user, first I created one contact with account and ...
6
votes
4answers
12k views

How to save Base64 image data as salesforce attachment

We are integrating an IOS app with salesforce and need to upload image data by apex rest class. we packed image base64 data and other data into JSON string, then send it. Now we get the JSON data in ...
10
votes
1answer
8k views

Understanding Rest Apex and Webservice Limit

I'm implementing a webservice exposing an Apex Class. I was reading understanding execution governors and limits and I dont see clear enough the limit for my @RestResource. I only found some ...
9
votes
1answer
2k views

Can't invoke @InvocableMethod via the REST API

I've been trying to use the new Spring '15 functionality related to Invocable Actions / @InvocableMethod / @InvocableVariable using the current documentation: https://www.salesforce.com/us/developer/...
11
votes
1answer
3k views

Setting up a Public REST API

I found a different question asking, "Can I have a public APEX REST API?" which led to a blog post explaining how to setup a public site to expose a REST API: Create your REST API in Apex as normal ...
6
votes
2answers
4k views

Accessing the Salesforce API for the first time… using python

Really early days for me learning to use the API as well as Python. The code below Authenticates and passes back the token correctly - but I have no idea how to pass the session ID in the code after.....
5
votes
1answer
3k views

How to connect to Salesforce REST API without OAuth? How does Jitterbit do it?

So what I read everywhere is that, in order to connect to Salesforce via the API, you'll have to authenticate using OAuth. But this involves creating a Connected App, which is 'cumbersome' for normal ...
5
votes
2answers
10k views

OAuth 2.0 Username-Password Flow Problem - unsupported_grant_type

I am trying to implement OAuth 2.0 Username-Password Flow and below is my code and debug log - any help is appreciated. Http httpProtocol = new Http(); HttpRequest request = new HttpRequest(); ...
3
votes
1answer
3k views

Chatter REST Api User Photo Example

I'm looking for an example that uses the Chatter REST Api to upload a User Photo. The documentation explains the syntax, but they don't give an example of the HTTP form data to POST. Elsewhere in ...
2
votes
3answers
577 views

What to use for performing operations on multiple records at once, Apex REST class or Bulk API?

I need to insert/update/delete a variable number of records at a time from a webapp (so from javascript), are there reasons to choose the Salesforce Bulk API over writing a custom Apex REST class to ...
1
vote
2answers
3k views

Call Apex REST service from JS on same org VF page - how to get instanceUrl and authToken?

I have an Apex class implementing a simple REST GET method @RestResource(urlMapping='/myrest/*') global class MyResService { @HttpGet global static CustomObject__c doGet() { .. } } ...
0
votes
2answers
826 views

rest API for Querying on Account

I am new to APIs'. I have a requirement as follows. 1) Account has a field called entity ID which is unique. 2) Other system will use my API to query for the Accounts which have entity ID. So how to ...
18
votes
3answers
13k views

Salesforce: Any API for getting user information?

I am trying to find a way to get the information about the salesforce enterprise user from his auth_token. I want to find the username, email address and role(admin/user) from the auth-token. ...
17
votes
2answers
2k views

Create Community User through REST API

I am using the nForce library with node.js. Everything seems to be right and we perform CRUD on the Case object. However when we try to create a User using an external account with "Delegated ...
8
votes
2answers
2k views

How does Salesforce handle wildcards in a REST urlmapping property

I have a question about the urlmapping property on a REST class. For the moment I have 3 REST classes with following urlmappings: REST1.cls @RestResource(urlmapping='/invoices/*/') REST2.cls @...
8
votes
1answer
2k views

How to properly allow non-user/client login for external apps with the REST API?

So, I've been given the task of writing a web application for constructing and submitting quotes for my company. First off, I'm brand new to SalesForce, and I'm understanding it better and better ...
7
votes
3answers
7k views

Is it possible to send an email via the REST API?

I'm looking to send emails through the REST API, specifically through Restforce in Ruby, but I can't find any resources on this. I am finding my resources about the sendEmail function, and how to set ...
3
votes
2answers
942 views

MessageDefinitionSends Rest API successful response but never sends email

I'm getting a successful response (202 code with empty response body), but my email neither sends nor looks to be queued. POST to https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/...
9
votes
5answers
3k views

Is there any documentation about using Client ID / Token with REST API to access Group and Professional Editions?

I have seen information about using Token with SOAP API, but REST API documentations doesn't say anything about it. Did anybody find useful hints on getting Token to work with Rest API?
5
votes
2answers
4k views

REST API: How to retrieve active values for picklist?

I am trying to access just the "Selected" picklist values for a field using the REST API via the databasedotcom Ruby gem. In the normal SFDC interface, a user can navigate to "Campaigns > Record ...
4
votes
1answer
1k views

how to host attachments outside of salesforce

Does anyone have experience hosting attachments outside of salesforce? I have a customer portal that allows file uploads via an authenticated sites user and it could potentially be a large number of ...
4
votes
1answer
2k views

Creating Visualforce Page Using Tooling API

i was trying create a visualforce page from Developer Console using Tooling API ( REST Service ). I checked the documentation it doesn't clarify about the parameters which needs to be present. ...
3
votes
2answers
1k views

How do I create a contact through the marketing cloud REST API?

Every request I make to SFMC's API for contact creation seems to result in a 500. I am following the documentation provided to us and I have included the example requests below. The only thing I could ...
1
vote
2answers
1k views

What Python library is recommended for pulling large amounts of data?

Our company has Gigabytes of email send data (Sends, Sent, Emails, Opens, Subscribers, etc). We would like to maintain a local relational database of all this Send data. Our current attempt uses the ...