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.

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 ...
0
votes
3answers
391 views

Why is my Connected App status 'Pending'/'Unpublished changes'

I am trying to enable the REST API. I created a new 'Connected App' on the Apps page. It seemed to work initially (?) but now that I changed the Callback URL it seems to be stuck in the 'Unpublished ...
22
votes
2answers
4k 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 ...
8
votes
3answers
3k views

Custom REST Service HTTPS error

I am building an apex REST service to be hosted on a public site using the approach outlined here (basically hosting a REST service on a site allows you to perform actions against it without ...
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(); ...
8
votes
2answers
19k views

Can somebody explain what is a REST API wrapper?

Can somebody explain what is a REST API wrapper? How should it look like? When would we actually need it? Can we call them as DTO's? Please give some usecases, examples or links.
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 ...
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 ...
2
votes
1answer
548 views

Force.com REST API refresh_token not working?

I am working with force.com REST API using PhoneGap, JQuery mobile By using REST-API tool kit if found it in Github. I am using ChildBrowser for authentication. What i am doing is first i am logging ...
2
votes
2answers
414 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 ...
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 ...
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 ...
30
votes
1answer
24k 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 ...
2
votes
3answers
450 views

Mobile SDK retrieve deleted records

I am using Salesforce Android SDK version 1.3.1. I am trying to query all Contacts (deleted as well). But no matter what I do, I don't seem to be able to retrieve the deleted records, meaning those ...
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 ...
29
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....
1
vote
1answer
2k views

java desktop example user agent flow OAuth

We would want to use the user agent flow for our desktop application that we connect to Salesforce via the REST API. Does anyone have somewhere a working java example of this or point me in the good ...
6
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+...
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 ...
2
votes
1answer
156 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 ...
4
votes
3answers
39k 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....
5
votes
1answer
302 views

Force usage of sessionId when accessing REST service

Is there a way to force clients of REST service to use their sessionId to access a REST service ? I can currently access this URL without any sessionId https://ddddddd.force.com/services/apexrest/...
20
votes
2answers
31k views

Rest API Vs SOAP API in Salesforce [closed]

Can any one explain me what is REST API and SOAP API. Also the example scenarios where these can be used ?
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 ...
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
2answers
1k views

Parse Pathparam equivalent in restService

I want to create REST URLs like /contact/{contactId}/test/{testId} and want to pull out the variable conatctId and TestId using a PathParam equivalent from Jersey in Apex RestService code. How do I ...
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.
6
votes
3answers
8k views

Measuring Size Of output JSON of REST API?

I need to get my size of the JSON going as response.I am using recent REST API's of salesforce using apex annotations like @HTTPGET .Can someone please point me out how will i see the size of output ...
3
votes
1answer
408 views

import converted lead with depending objects (meetings, calls, emails, notes)

I am trying to import a converted lead using REST/SOAP API-s. While I am able to create already converted lead, I am not able to attach all its depending object like notes, meetings etc because lead ...
11
votes
3answers
6k 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 ...
2
votes
1answer
833 views

When using Salesforce APIs with a Web Server Flow, are you tied to the original user who authenticated?

The question is a bit of a mouthful. This has to do with the various Salesforce APIs - I want to try to use the web server flow as it will mostly be service to Salesforce communication that happens ...
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 ...
6
votes
1answer
2k views

Password & Security Token for external users

I'm using the Salesforce iOS SDK to connect to database.com as the backend for an iOS app we are building. The problem is we need database.com access to be transparent to the user. They shouldn't ...
4
votes
1answer
3k 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"; ...
8
votes
2answers
749 views

Do Chatter Desktop & Chatter Mobile Apps Use the Chatter Connect API?

I may be firing in the dark but I want to know some insights into how the Chatter Desktop and Chatter mobile apps (such as iOS & Android) work. Do these tools use Chatter Connect API? I ask this ...
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 ...
10
votes
2answers
9k views

Can you use the LIKE operator in SOQL queries via the REST API?

As the title states, can you use LIKE in SQOL queries via the REST API? Even with this basic query: select Id from Account where BillingState like 'VIC%' I'm getting an error back: REST ...
9
votes
1answer
3k views

Authenticate 3rd party Application with OAuth2

The PHP getting started guide for interacting with Force.com seems to indicate that a user always needs to reauthenticate for each session with OAuth2, and that's my understanding of the protocol as ...
3
votes
2answers
2k views

Setting Type of Event or Task via SOAP/REST API

I am looking at Object Reference for Event and Task sObjects and seeing that both have Type and Subject. I wanted to use Type as one of meeting, call, email and Subject as event/task title. But, if I ...
7
votes
3answers
562 views

Is it okay to use a single admin user when logging into the API or do I need to use individual user accounts?

I'm working with a client to develop a PHP based application that has its own login system and content but throughout the application there will be interactive forms which will collect data that we'd ...
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?
23
votes
5answers
5k views

Most API call efficient way to retrieve all attachment bodies

I need to download the binary body of all the attachments in my organization. I'd like to do so with the least amount of API calls. It is my understanding that the SOAP API returns a single attachment ...