title: Use gapi.client javascript to execute my custom Google API
body: <p>I have a service that is successfully deployed to Google Endpoints and it is accessible through browser.</p>
  
  <p>Now I am trying to load Google API javascript client library to call my services using javascript.</p>
  
  <p>As far as I know, I should do this</p>
  
  <pre><code>gapi.client.load([MY_APP_NAME], 'v1', function() {
     var request = gapi.client.[API_NAME].[SERVICE_NAME].[METHOD]();
     request.execute(function(jsonResp, rawResp) {...});
     );
  </code></pre>
  
  <p>But I always get an exception at run time complaining about <b>gapi.client.[MY_API_NAME]</b> is undefined. I do the same thing with any Google API (such as Plus) and it works fine. For example, If I load 'plus' API, I will have access to gapi.client.plus... and I can call methods.</p>
  
  <p>Am I missing something? All samples and documents are about Google Service APIs and I could not find a sample for custom APIs (the one that developers write).</p>
  
  <p>I even tried gapi.client.request with different paths (absolute path and relative path) but I get 404 - Not Found error in "status".</p>
  
  <pre><code>var request = gapi.client.request({'path':
  'https://[APP_NAME].appspot.com/_ah/api/[SERVICE_NAME]/v1/[METHOD]'
  , 'method': 'GET'});
  request.execute(function(jsonResp, rawResp) {...});
  
  
  var request = gapi.client.request({
  'path':'/[SERVICE_NAME]/v1/[METHOD]',
  'method': 'GET'});
  request.execute(function(jsonResp, rawResp) {...});
  </code></pre>