In my scratchorg I've got:

global without sharing class RestTest {
    global static String test() {
        return 'cat';

And in workbench I've tested this by calling GET on /services/apexrest/namespace/Test/ and it returns successfully.

So now I want to call this same end point from the mobile sdk. Presumably using the net.sendRequest method from react-native-force.

But I'm not exactly sure on how to use it. I've got sendRequest('/services/apexrest/namespace/Test/', '', resolve, reject, 'GET'); Which I think? is correct. but I'm not sure on what should be in the 2nd parameter (path).

I've also tried variations such as:

sendRequest('/services/apexrest', '/namespace/Test/', resolve, reject, 'GET');

I've also tried:

        false//not requires auth
  • What kind of mobile app are you building? I'm assuming hybrid given your code sample?
    – Matt Lacey
    May 28, 2020 at 23:49
  • @MattLacey yep react native for both ios and android
    – Aequitas
    May 28, 2020 at 23:50
  • @KrisGoncalves thanks for your input, unfortunately adding the api version does not work (with and without slash). I still get the same "URL no longer exists" error
    – Aequitas
    Jun 1, 2020 at 0:00


You must log in to answer this question.

Browse other questions tagged .