You need to sign in to do that
Don't have an account?

(REST) Could not find a match for URL
Hi All,
I've been stuck with this error for 2 days already.
I've been trying to test a fairly simple REST code in my workbench. But for some weird reason(s), it always show this error (attached)
Here's my code:
Of all the articles I've checked, they all point me into 1 direction and it hasn't worked either.
So I was thinking that it might be something that I setup or forget to setup before I had my class created?
Appreciate your help on this.
I've been stuck with this error for 2 days already.
I've been trying to test a fairly simple REST code in my workbench. But for some weird reason(s), it always show this error (attached)
Here's my code:
@RestResource(urlMapping='/v1/accounts/*') global with sharing class SampleREST{ @HttpGet global static AccountWrapper doGet() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; AccountWrapper response = new AccountWrapper(); response.acctList = [SELECT Id, Name FROM Account]; response.status = 'Success'; return response; } global class AccountWrapper{ public List<Account> acctList; public String status; public String message; public AccountWrapper(){ acctList = new List<Account>(); } } }
Of all the articles I've checked, they all point me into 1 direction and it hasn't worked either.
So I was thinking that it might be something that I setup or forget to setup before I had my class created?
Appreciate your help on this.
Is there any namespace defined in your org? If yes, then you will have to access your rest resource using:----- /services/apexrest/namespace/v1/accounts
All Answers
Is there any namespace defined in your org? If yes, then you will have to access your rest resource using:----- /services/apexrest/namespace/v1/accounts
Weirdly enough, I have done that yesterday but it didn't work. But now it's working!
Thanks man!