I need to call apex rest service from salesforce mobile sdk-android. I can execute the soql query by calling RestRequest.getRequestForQuery() method. How to call apex service from RestRequest class?


Below code worked for me. I created an apex rest service and called the service from index.html using force.js

var fetchRecords = function (successHandler) {

    force.apexrest('/services/apexrest/MyRestService', successHandler, function(error) {
        alert('Failed to fetch data: ' + error);

And this is how the function was called

fetchRecords(function(data) {


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.