1
votes

I am testing my app for the first time, just trying to get basic info via the API but am getting an error: 422 Unprocessable Entity, "validation_failed".

What am I missing here? I have tried it with both sandbox-api.uber.com and with api.uber.com.

getting back:

code: "validation_failed" fields: {start_longitude:Required, start_latitude:Required} start_latitude: "Required" start_longitude: "Required" message: "Invalid request"

  var uberServerToken = "XXXXXXXXcEE0cHbwhKiF_sl_ZUYvEHHO_f6U6dr" ;
  $http({
    url: "https://api.uber.com/v1/estimates/time" ,
    headers: {
        Authorization: "Token " + uberServerToken
    },
    data: {
        start_latitude: setLat,
        start_longitude: setLon
    },
    success: function(result) {
      console.log(result);
    }
  });
1
Ok, so I went back to developer.uber.com and verified the settings on my registered app. Two things I had to add into my app profile: 1) my app is an android app, I added "localhost" as my redirect url - is this correct? And "localhost/policy.html" as my Privacy Policy URL - both were required by the app uber profile/registration process. 2) After entering the above info into my app profile, I am now getting a "503 Service Unavailable" error in my debug console for my app. I am stuck trying to figure out how to connect to retrieve Uber products, times, prices for 4 days now - rolinger
Well, look like #2 isn't an issue, seems the server api.uber.com was just slow or temporarily not responding. HOWEVER, I am back to getting the "422 Unproccessable Entitty: validation_failed" What in the world am I doing wrong? - rolinger

1 Answers

0
votes

You need to provide an access token for the request. Grab the access code from the user, exchange that for an access_token, and provide the access_token with each request to Uber's API.

Link: https://developer.uber.com/v1/auth/