Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Cloud Endpoint work in Google APIs Explorer but not on Android (Bad Request)
    primarykey
    data
    text
    <p>I can't understand why my endpoint works perfectly fine in Google APIs Explorer and not on Android.</p> <p><a href="https://developers.google.com/apis-explorer/?base=https://prncts.appspot.com/_ah/api#p/pronocities/v1.0.1/pronocities.content.get?id=aghzfnBybmN0c3IJCxIBZBj5zAMM&amp;_h=1&amp;" rel="nofollow">https://developers.google.com/apis-explorer/?base=https://prncts.appspot.com/_ah/api#p/pronocities/v1.0.1/pronocities.content.get?id=aghzfnBybmN0c3IJCxIBZBj5zAMM&amp;_h=1&amp;</a></p> <p>In fact it almost works as I can see that the call is made to my GAE endpoint server side and that the user perfectly authentified via OAuth.</p> <p>There seems to be something wrong in the way the data is sent back to the phone.</p> <p>Here are the logs I get on the phone :</p> <pre><code>07-28 15:12:53.305: W/System.err(3034): com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request 07-28 15:12:53.305: W/System.err(3034): { 07-28 15:12:53.305: W/System.err(3034): "code": 400, 07-28 15:12:53.305: W/System.err(3034): "errors": [ 07-28 15:12:53.305: W/System.err(3034): { 07-28 15:12:53.305: W/System.err(3034): "domain": "global", 07-28 15:12:53.305: W/System.err(3034): "message": "java.lang.IllegalArgumentException: name cannot be null or empty", 07-28 15:12:53.305: W/System.err(3034): "reason": "badRequest" 07-28 15:12:53.305: W/System.err(3034): } 07-28 15:12:53.305: W/System.err(3034): ], 07-28 15:12:53.305: W/System.err(3034): "message": "java.lang.IllegalArgumentException: name cannot be null or empty" 07-28 15:12:53.305: W/System.err(3034): } 07-28 15:12:53.305: W/System.err(3034): at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:111) </code></pre> <p>The object sent back is a really simple POJO as you can see in Google APIs Explorer.</p> <p><strong>EDIT1:</strong></p> <p>Android side code mostly taken from the TicTacToe example :</p> <pre><code>settings = getSharedPreferences("PronoCities", 0); credential = GoogleAccountCredential.usingAudience( this, "server:client_id:&lt;myid&gt;.apps.googleusercontent.com"); setAccountName(settings.getString(PREF_ACCOUNT_NAME, null)); Pronocities.Builder builder = new Pronocities.Builder( AndroidHttp.newCompatibleTransport(), new GsonFactory(), credential); service = builder.build(); </code></pre> <p>Any help will be greatly appreciated.</p> <p>François</p> <p>Using google-api-client-1.15.0-rc librairies and running on a Samsung Galaxy S3 / Android 4.1.2.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload