Hi all, Actually the request method works *all the time* with the "path" argument composed of the values of "path" and "name" as declared in the @ApiMethod annotation...
I don't know what I did wrong the last day.... Maybe it was due to some problems with the AppEngine platform itself, since I was receiving either 404 errors or 503 errors. Or most probably I was missing something. Sorry if I wasted the time of the readers! On Saturday, May 28, 2016 at 5:02:38 PM UTC+2, Renaud Tarnec wrote: > > Hi, > > I have a web application which calls several AppEngine Endpoints with the > Google API JavaScript client library. > > I am currently changing this application from callback mode to promises > mode, as recommended by Google ( > https://developers.google.com/api-client-library/javascript/features/promises#using-promises) > > and I am encountering a problem. Note that the app works well with the > callback mode. > > My problem with the promises mode is to find what is the correct path > argument to use when calling the request method: > > JavaScrit code: > > var params = {'webSafeKeyParent’: > ‘neN4fm15xW52b2ljZXMtb19saW5lmlYLEglBY1NFwpRpdHkYgICAgQj97AoM’}; > gapi.client.request({ > 'path': ' > https://myappenginename.appspot.com/_ah/api/customerApi/v1/?????????', > 'params': params > }).then(function(response) { > // Handle response > }, function(reason) { > // Handle error > }); > > Endpoint definition in "customerApi": > > @ApiMethod( > name = "listByParent", > path = "customerByParent/{webSafeKeyParent}", > httpMethod = ApiMethod.HttpMethod.GET, > scopes = {Constants.EMAIL_SCOPE}, > clientIds = {Constants.WEB_CLIENT_ID, > com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID}, > audiences = {Constants.ANDROID_AUDIENCE}) > public List<Customer> listByParent(final User user, > @Named("webSafeKeyParent") final String webSafeKeyParent, @Nullable > @Named("cursor") String cursor, @Nullable @Named("limit") Integer limit) > throws UnauthorizedException { > > > For few of my endpoints it works by including in the path argument of the > JavaScript request method, the values of "path" and "name" as declared in > the @ApiMethod annotation. > > i.e. for the above endpoint, the following path works: > https://myappenginename.appspot.com/_ah/api/customerApi/v1/ > customerByParent/listByParent > > Strangely enough this does NOT work for some other endpoints of the same > kind. > > I've also tried with the paths displayed under "Request" when you query > the endpoints with the APIs Explorer but without success.... > > Is there any detailed documentation for calling AppEngine endpoints with > promises? I have not found any. Do you have some advice to share please? > > Thanks in advance, > Renaud > > PS: I've published the same post in the "Google API JavaScript Client" > group > > > > > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/84c5b33e-d665-4d57-ad40-5f6a4c7a9405%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
