Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Creating an API server

You must define an API server that uses the API or APIs you have created. To define an API server:

  1. Create a separate module, for example, services.py (you can use any name you want). The following sample shows what you would need to add to this file:

    import endpoints
    
    import your_api
    
    application = endpoints.api_server([your_api])
    

    where your_api is the name of the API you are exposing. Notice that if the API is implemented in several classes, your_api is the collection of classes, as described in Creating an API Implemented with Multiple Classes .

  2. In your app.yaml file, map the API server you just created to the endpoints location as follows:

    handlers:
    # Endpoints handler
    - url: /_ah/spi/.*
      script: services.application
    

    where services is the file name you used for your API server module. Notice that the endpoints path is always /_ah/spi relative to the application.

  3. Set the runtime to Python 2.7, since Endpoints is no longer available in the Python 2.5 runtime:

    application: your-app-id
    version: 1
    runtime: python27
    api_version: 1
    
  4. Add Endpoints to the Libraries section of app.yaml , since the Endpoints library is not included by default:

    libraries:
    - name: endpoints
      version: 1.0
    

    Note that you can specify the desired Endpoints library version. (Currently, the only version available is the GA version, 1.0.)

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.