0 votes
in Salesforce by (11.9k points)

I have created a RESTful service on Force.com using Apex below is my code.

global with sharing class RestWebservice {
  global static String helloWorld(){
    return 'HelloWorld';

I am trying to access my RESTful services using below url:https://ap1.salesforce.com/services/apexrest/helloWorld/

In response i am geting:

HTTP/1.1 404 Not Found

Date:Thu, 18 Jul 2013 07:35:44 GMT





    "message": "Could not find a match for URL /helloWorld/",

    "errorCode": "NOT_FOUND"



Below is my class snapshot:

 enter image description here

enter image description here

how can i resolve this issue ? Any help is appreciated.

1 Answer

0 votes
by (32.1k points)
edited by

When you put an * (asterisk) in the end (@RestResource(urlMapping='/helloWorld/*')) you need to write an ID or something else. What you are trying to accomplish i guess is more like this


And then make this call

curl -H "Authorization: Bearer sessionId"  "https://instance.salesforce.com/services/apexrest/helloWorld"

Welcome to Intellipaat Community. Get your technical queries answered by top developers !