node.js - Making request to uber sandbox api not changing anything -


i'm using uber api make requests sandbox. specifically, i'm using node-uber library here:https://github.com/shernshiou/node-uber

when try set surge multiplier, using following code snippet:

 uber.products.setsurgemultiplierbyid('90475b1e-382e-437f-a50f-d9ac28c150c8', 2.2, function (err, res) {   if (err) console.error("error" + err);   else console.log("surge success" + res);   }); 

and make request:

uber.requests.create({   "start_latitude": lat,   "start_longitude": longitude,   }, function (err, res) {     if (err) console.error(err);     else console.log(res);   }); 

i see in response surge multiplier still 1.0

what doing wrong? , also, uber sandbox supposed hold state between put request sandbox , request call uber? how save state me? based on auth token?

thanks!

i don't think you're doing wrong! sandbox mode supposed keep track of "state change" (request status, product status). api keeps track of associating specific state either:

  • the server_token: surge multiplier , driver's availability changes trigger /products endpoint. can use oauth or server_token access it.
  • an oauth access_token: request status changes trigger /requests endpoint. endpoint requires being accessed valid oauth aacess_token after authentication.

as issue you're reporting: after investigation, created issue report on github. i'm contributing node-uber project , i'll submit bugfix today. update answer accordingly. stay tuned!

update: pushed out update node-uber. v0.9.6, issue should fixed. let me know otherwise! code above, you'd need expect http 409 error (because surge_multiplier > 2.0) coming requests.create method.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -