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?

  • I am stuck with the same thing. Here I am talking about Native code and not javascript
    – sud007
    May 8, 2020 at 13:38

1 Answer 1


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) {

  • I think OP has asked about the Native java/kotlin API from SDK to do so.
    – sud007
    May 8, 2020 at 14:22

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.