Google Cloud Endpoints: Endpoint Request Parameters (Resource Containers) Empty when Deployed
<p>I have an app for Google App Engine.  The backend uses Python and the front-end uses JavaScript.  The app works as expected locally and the API Explorer works as expected when deployed.</p>

<p>However, the API does not work with the front-end as expected when deployed.  The issue is that the cloud endpoint methods that take arguments ("Resource Containers") from requests receive "empty" requests -- the arguments given to the requests from the JavaScript front-end disappear.</p>

<p>Here is an example.</p>

<p>JavaScript API call:</p>

<pre><code>var id_resource = {'resource': {'user_google_id': "-1"}};

gapi.client.word_match.get_user_from_google_id(id_resource).execute(function(resp) {

    console.log(resp); // THE API CALL 'LOSES' THE 'user_google_id' WHEN DEPLOYED: THIS LOGS AN ERROR ("Object {code: 404, data: Array[1], message: "No user with the id "None" exists.", error: Object}") WHEN DEPLOYED, BUT LOGS THE CORRECT USER INFO LOCALLY
    if (!resp.code) {

        self.user(new User(resp));
    }
});
</code></pre>

<p>Cloud endpoint:</p>

<pre><code>REQUEST_BY_GOOGLE_ID = endpoints.ResourceContainer(user_google_id=messages.StringField(1),)

@endpoints.api(name='word_match', version='v1', allowed_client_ids=['the id'],
    auth_level=endpoints.AUTH_LEVEL.OPTIONAL_CONTINUE)
class WordMatchApi(remote.Service):
    """Game API
    """
    @endpoints.method(request_message=REQUEST_BY_GOOGLE_ID,
                      response_message=UserForm,
                      path='getuser',
                      name='get_user_from_google_id',
                      http_method='POST')
    def get_user_from_google_id(self, request):
        """Get a user by the user's google account ID
        """

        logging.info(request) // THIS IS THE ISSUE: LOGS "&lt;CombinedContainer&gt; user_google_id: u'-1'&gt;" locally, but just "&lt;CombinedContainer&gt;" when deployed.
        logging.info(request.user_google_id)

        user = User.query(User.google_id == request.user_google_id).get()

        if not user:
            message = 'No user with the id "%s" exists.' % request.user_google_id
            raise endpoints.NotFoundException(message)

        return user.to_form()
</code></pre>

<p>Where did the user_google_id go in the request when deployed? Why does Python think there is nothing there?</p>

<p>I got it working.  The main fix was based on <a href="https://cloud.google.com/appengine/docs/python/endpoints/create_api" rel="nofollow">this documentation</a>.  I "defined a message class that has all the arguments that will be passed in the request body", then defined the resource container used in the request message to include that class.</p>

javascript python google-app-engine google-cloud-endpoints