Q: how to make call to apex rest api? im trying to make rest api with apex and i created class with the developer console
but i not understand to wich url i send the request
i also have accsess token.
i just want to see im getting some response.
@RestResource(urlMapping='/test/*')
global class OyeCodeRestAPI {
@HttpGet
global static Customer__c doGet() {

        RestRequest req = RestContext.request;

        RestResponse res = RestContext.response;

        //String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);

        Customer__c result = [SELECT Id, Name From Customer__c];

        return result;

    }
}`


A: To verify the Rest API, you can follow below steps,


*

*Navigate to https://workbench.developerforce.com/login.php.

*For Environment, select Production. For test orgs it will be sandbox.

*Select the latest API version from the API Version drop-down.

*Accept the terms of service, and click Login with Salesforce.

*To allow Workbench to access your information, click Allow.

*Enter your login credentials and then click Log in to Salesforce.

*After logging in, select utilities | REST Explorer.

*In Workbench, select GET.Enter the URI /services/apexrest/test (This would be RestResource Name)

*Click Execute.


Also, check trailhead module for REST Service

Namespaces in Apex REST Endpoints

Apex REST methods can be used in managed and unmanaged packages. When
  calling Apex REST methods that are contained in a managed package, you
  need to include the managed package namespace in the REST call URL.
  For example, if the class is contained in a managed package namespace
  called packageNamespace and the Apex REST methods use a URL mapping of
  /MyMethod/*, the URL used via REST to call these methods would be of
  the form
  https://instance.salesforce.com/services/apexrest/packageNamespace/MyMethod/.

