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.

5
votes
3answers
6k views

Serialize Class to JSON with correct sObject API field names

I want to use the standard Force.com REST API to create a case remotely from another Salesforce instance in my instance. I want to populate two fields on creation: "Subject" and "txt_UserId__c". ...
3
votes
1answer
4k views

Salesforce: API to get info of all enterprise users using admins auth token?

Is there a way from the SOAP/METADATA API to get the all the registered users of an enterprise using an API call with the admin's auth-token? I only require the email address, name and role of the all ...
2
votes
1answer
4k views

Use COUNT_DISTINCT(field) on REST SOQL API query

I'm currently trying to run the following SOQL query using the REST API: SELECT Id, accountId, COUNT_DISTINCT(accountId) FROM Contact WHERE Phone LIKE '%" + CLI + "' OR HomePhone LIKE '%" + CLI +...
2
votes
1answer
6k views

How to handle REST API JSON response

Is there a good practise, to get the Ip out of the rest JSON response: { "id" : "001D000000IqhSLIAZ", "errors" : [ ], "success" : true } What I do: HttpResponse res = h.send(req); if(...
3
votes
1answer
672 views

REST API - Can I authenticate an Android app without having the client id/secret?

Anyone know if it's possible to authenticate with SF from an external app (ie an Android app, or a Java application) without the client having the "Client Key" and the "Client Secret?" I'd rather ...
0
votes
0answers
541 views

unable to create user with REST api email

Hi I am using REST API to create new USER, when i am extracting the meta data using the /services/data/v20.0/sobjects/User/describe the label for 'Email' field is shown as 'E-mail' whereas on ...
6
votes
1answer
1k views

Insert new objects via REST using an external ID

Here is my situation: I have created a custom object called "CSB" with fields: source_xml__c => Text IPN__c => text Salesman => Lookupfield to "User" In the "User" object there is a custom ...
1
vote
2answers
411 views

Custom Logging, how to bypass Limit Exceptions

I'm developing a custom log system for Blackbox Testing. The goal is to log everything until transaction ends or an exception is thrown - even if apex throws a Limit Exception and rolls back all ...
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'...
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 ...
1
vote
1answer
418 views

Salesforce Two Factor Authorization in VPN and JIRA

I want know how to do two factor authentication for VPN and JIRA in salesforce. while I am trying to access the JIRA webservice(REST API) link from browser, I can able to see the values in JSON ...
1
vote
1answer
240 views

OAuth scope requirements for whitelisted ISV REST API

I'm looking at building some additional integration between salesforce and a third party server as part of an ISV project, working across all editions including group and professional. Currently the ...
0
votes
1answer
181 views

SOAP Equivelant of RESTs /chatter/users/me/conversations?

Title pretty much says it, I know that in REST we query private conversations using the above endpoint /chatter/users/{ID}/conversations, but I'm not sure where to look for the same thing in SOAP. ...
0
votes
0answers
54 views

Access REST API in Visualforce [duplicate]

In a Visualforce page, how can I invoke a custom REST API that is built in Salesforce (this org is same org in which the VF is in). This is how I access the REST API in workbench using REST Explorer ...
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() { .. } } ...
1
vote
2answers
2k views

Authentication Bearer in SOAP API?

UPDATE I created the below answer which allows you to use a REST application connection to (from there on) work on the SOAP API without needing to use SOAP's Login method, but instead relies ...
1
vote
1answer
1k views

is it possible to do Describesobject for multiple sobjects via rest api?

Im trying to describe all the sobjects in my organization and fetch some information from each of them. When I use the partner wsdl, I can give something like this in c# DescribeGlobalResult dgr = ...
8
votes
1answer
4k views

REST API: How to update active values for picklist?

I need to update the Picklist values for a custom field on a custom object. I have already populated the Available Values via the Enterprise and Metadata Java APIs, but now I need to move the newly ...
1
vote
0answers
230 views

Using createDate in the REST API

I'm just curious if there is a way to use between in the the REST api? Something like curl -v https://na15.salesforce.com/services/data/v27.0/chatter/feed-items/me/comments -H 'Authorization: Bearer ...
3
votes
1answer
776 views

Drag & Drop Upload Images to documents - Security Problems

We have developed a Drag & Drop multiple Image Upload with Html5, jQuery and the REST API. We are wondering what are the problems that this feature can bring up in the security review. Let me ...
7
votes
4answers
8k views

restful call to external analytics API via visualforce/apex

So I'm trying to access Woopra analytic's restful API via apex/visualforce. I am wondering a couple of things: 1) The API returns a JSON object via the usual POST/GET method... would it be best to ...
1
vote
2answers
1k views

Rest API Session ID SOAP Partner Connection

I have a REST access token and would like to use that access token in my PartnerConnection ConnectionConfig to make a Bulk API call. It does not seem to work as I get an message to set my Service ...
9
votes
1answer
312 views

Retrieve twitter handle from contact

I am just getting started with Salesforce. I have enabled social contacts and linked one of the contacts to a Twitter account. I can view the Twitter information on the contacts page from the ...
2
votes
2answers
12k views

REST API vs RESTful web services [duplicate]

I am listening few words frequently. Those words are "REST API" and "RESTful Web-Services". But I am not able to figure out what to use when while conversing with team. Are there any significant ...
14
votes
1answer
16k views

How can I return JSON object from REST service?

I used JSONGenerator to generate a customized JSON String. I know I can return sObject or String using Salesforce REST. But now I am sure I do not want to return sObject because I want the customized ...
21
votes
1answer
4k views

SOQL query to load Task returns nothing, but I see task in UI

I am trying to load all tasks of a contact via SOQL query: SELECT Id, Subject FROM Task WHERE WhoId = 'contactId' This query returns only partial list of Tasks. I.e. in UI I see tasks directly ...
5
votes
1answer
5k views

Access Tooling API via REST from Apex class

While still having this question open I found out about the new Tooling API and tried to access an ApexClass members via the Rest Explorer in the Workbench and could get it to run. How would I be ...
2
votes
0answers
141 views

Obtaining users data after accepting / allowing a Chatter Application

I'm slowly on the road to completing my PHP application, the final piece to my knowledge is figuring out how, after a user accepts the use of an Application (I think I'm using a remote app atm), to ...
2
votes
1answer
63 views

What are the correct scopes to use for different applications?

I am writing a desktop application (or several) to access mail, contacts and chat via the REST api (User-Agent Flow) What are the correct and minimal scopes to use for each of these individually or ...
2
votes
1answer
463 views

Getting a per-application/anonymous client id for REST API

I want to get a desktop app to access the REST API. I currently have set up a connected app and am using that personal client id. Is there a way to get some kind of partner/anonymous client id so ...
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 ...
3
votes
1answer
381 views

How does Chatter Desktop work without needing to be set up as a Connected App

To access the REST api from an external app you need to configure the account for remote access, get a consumer id etc. Why does the Chatter Desktop app not require this? Presumably it is just hard-...
2
votes
2answers
570 views

Salesforce OAuth and Client Network Configuration Changes

Can this be true that if we use Salesforce OAuth to grant login to a desktop app, then after validating and receiving tokens -> access, refresh etc) if client workstation switches Internet Connections ...
2
votes
2answers
9k views

Rest API Parameters are not getting passed to method

I defined rest API method as follows - @RestResource(urlMapping='/verifyaccount/v1/*') global class VerifyAccountService { @HttpPost global static String VerifyAccount() { ...
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
2answers
8k views

Can we create multiple @Http Methods (REST) annotations of the same type in a single class?

In REST API, can we create multiple @Http Methods (for e.g. @HttpGet) annotations of the same type in a single class? i have a need where i need to write more than one get method in the same class? is ...
0
votes
1answer
1k views

how to call the more then one methods using HttpGet annnotation in apex class [duplicate]

Possible Duplicate: Can we create multiple @Http Methods (REST) annotations of the same type in a single class? I want to call both methods from external system. Using Rest Methods global with ...
2
votes
1answer
157 views

database.com nodes different from force.com?

In Salesforce orgs we have nodes based closeness from geographic locations, like if I register for org from India it will put me on Asia-Pacific(ex. AP1), same happens for other locations like North ...
2
votes
2answers
422 views

Secure Communication from Managed Package Subscriber Org to LMO (License Management Org)

Unfortunately, my managed package needs the ability to enforce a limit that isn't a user license. Therefore, I need my managed package, installed in subscriber orgs, to ask my LMO (License Management ...
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 ...
1
vote
1answer
1k views

Why would this Chatter REST Api Http POST return a 500 Server Error?

I'm using C#.Net to (upload) POST a new User Photo to Salesforce. Using Fiddler I'm able to monitor the HTTP activity to and from my computer. Here's the raw data I'm sending in the POST (with ...
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 ...
7
votes
2answers
5k views

Is it possible to store and reuse a refresh token ad infinitum?

I want to be able to insert records into a custom object on behalf of users from my web app without their direct involvement aside from their initial granting my app permission to do so. The events ...
5
votes
1answer
6k views

REST API query to get all accounts which have child records?

/services/data/v26.0/query?q=select+a.Id,+(select+c.Id,+c.FirstName,+c.GUID__c,+c.LastName,+c.Middle_Name__c,+c.Phone,+c.Email,+c.Professional_Role__c,+c.HCP__c+from+Contacts+c)+from+Account+a +where+...
4
votes
3answers
42k views

JSON String in response shows up with quotes

I use a REST Apex service and return String from the method. The client call to the REST API returns with qoutes around the reqult like this example: "...result.." and also with \" inside the result....
2
votes
2answers
21k views

REST API design with sessionID in the request header

1st question: I am designing a REST API in Salesforce with sessionId as a required field in the request header for all calls after logging in. Is this even required in Salesforce ? I was forced to do ...
1
vote
1answer
4k views

Creating user via API

I am trying to build a database.com app, and goal is to user Database.com light users ($10/100). I want to give a signup screen for new users. Regarding this I checked available API options SOAP API ...
2
votes
1answer
2k views

Attaching image to chatter post using Chatter rest API

I want to add image to the content which I am posting to chatter. I am using chatter rest api but not able to do it.. Any kind of help will be greatful. I am using below code for uploading image ...
4
votes
1answer
4k views

Image upload to chatter post

I am trying to send image to chatter post from my Android app and I am using below code to do this. String url ="https://ap1.salesforce.com/services/data/v25.0/chatter/feeds/news/me/feed-items"; ...
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?