Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid request for Bolt (Europe) #225

Open
MiteEnBois opened this issue Sep 14, 2021 · 12 comments
Open

Invalid request for Bolt (Europe) #225

MiteEnBois opened this issue Sep 14, 2021 · 12 comments

Comments

@MiteEnBois
Copy link

I am trying to use the sms verification, but the parameters on the confirmation is apparently invalid. I am using the parameters explained in the .md, but it just doesnt work
This is the parameters that are supposed to work

{
  "phone_uuid" : "<UUID>",
  "verification" : {
    "confirmation_data" : {
      "code" : "1234"
    }
  },
  "phone" : "<phone number, non url-encoded>"
}

this are my parameters, just about the same

{
    "phone_uuid": "UUID",
    "phone": "phonenumber",
    "verification": {"confirmation_data": {"code": "1234"}},
}

and this is the response i get
{"code":702,"message":"INVALID_REQUEST","validation_errors":[{"error":"Is not object","property":"verification","children":[]}]}

My guess is that it misses a parameters somewhere, but i dont know what.

@pedrohsroque
Copy link

I think you forgot the phone parameter in the body
{
"phone_uuid" : "29537f13-1234-1234-1234-40d6d297025e",
"verification" : {
"confirmation_data" : {
"code" : "1234"
}
},
"phone" : "+5531999999999"
}

@MiteEnBois
Copy link
Author

Nope i had it, it was just in another order. I tried your parameters and ended up with the same error

{"code":702,"message":"INVALID_REQUEST","validation_errors":[{"error":"Is not object","property":"verification","children":[]}]}

@pedrohsroque
Copy link

@MiteEnBois those parameters are just an example, they are not expected to work,

You also need to do the previous step, try this 2 bodys, the sms code will be sent to this:
https://receive-smss.com/sms/4915207955279/

POST https://user.bolt.eu/user/register/phone
{
"phone" : "+4915207955279",
"preferred_verification_method" : "sms",
"phone_uuid" : "cff09d97-4954-41b7-bd37-d8061ad3ff30",
"appsflyer_id" : "1234567890123-1234567"
}

POST https://user.bolt.eu/user/confirmVerification/
{
"phone_uuid" : "cff09d97-4954-41b7-bd37-d8061ad3ff30",
"verification" : {
"confirmation_data" : {
"code" : "9760"
}
},
"phone" : "+4915207955279"
}

@MiteEnBois
Copy link
Author

i was already doing this, and it worked, but inputing the code didn't change anything, and with your parameters it still doesn't work. I can show you my python code if you want, maybe its as simple as a typo somewhere

import requests

URL = "https://user.bolt.eu/user/register/phone"
PARAM = {
    "phone": "+447901614024",
    "preferred_verification_method": "sms",
    "phone_uuid": "cff09d97-4954-41b7-bd37-d8061ad3ff30",
    "appsflyer_id": "1234567890123-1234567"
}

r = requests.post(url=URL, data=PARAM)
print(r.text)

URL = "https://user.bolt.eu/user/confirmVerification/"
code = input("SMS Code : ")
PARAM = {
    "phone_uuid": "cff09d97-4954-41b7-bd37-d8061ad3ff30",
    "verification": {
        "confirmation_data": {
            "code": code
        }
    },
    "phone": "+4915207955279"
}
r = requests.post(url=URL, data=PARAM)
print(r.text)

URL = "https://rental-search.bolt.eu/categoriesOverview"
PARAM = {
    "lat": "50.0000",
    "lng": "10.0000",
    "version": "CI.23.0",
    "deviceId": "352229114789661",
    "deviceType": "iphone",
    "device_name": "iPhone12,3",
    "device_os_version": "iOS15.0",
    "language": "en"}
r = requests.get(url=URL, params=PARAM)
print(r.text)

The last code block is the requests to get all scooter data in the area, and it doesnt work because i cannot send the verification code, as seen below.
and this is the console output:

{"code":0,"message":"OK","data":{"verification":{"method":"sms","confirmation_data":{}},"resend_confirmation_interval_ms":20000}}
SMS Code : 1872 
{"code":702,"message":"INVALID_REQUEST","validation_errors":[{"error":"Is not object","property":"verification","children":[]}]}
{"code":503,"message":"NOT_AUTHORIZED"}

Obviously i used the web phone thing you linked and used the real code sent by the api, but i still got the same error !

@pedrohsroque
Copy link

pedrohsroque commented Sep 24, 2021

try this on the post request:
r = requests.post(url=URL, json=PARAM)
since the body is a json

@MiteEnBois
Copy link
Author

aaaaaah, that was it, thank you!

@MiteEnBois
Copy link
Author

Great, now i cannot get authorized.
I tried doing the get request from https://rental-search.bolt.eu/categoriesOverview, with the same deviceid from the previous requests, even after the verification is validated and returns the needed data. I used the uuid that you included in your example, with my phone number, but i guess it doesn't work
I have no idea how the deviceid and the other device parameters are used, i dont know what i am supposed to get, i have an android and they dont seem to have a "UUID" like iphones do. I am confused as to why my requests are denied even tho i use the same parameters. I guess its another python mishap, but i am really guessing

Here is the code for the last request

URL = "https://rental-search.bolt.eu/categoriesOverview"
PARAM = {
    "lat": "50.00000000",
    "lng": "10.00000000",
    "version": "CI.24.0",
    "deviceId": "cff09d97-4954-41b7-bd37-d8061ad3ff30",
    "deviceType": "iphone",
    "device_name": "iPhone12,3",
    "device_os_version": "iOS15.0",
    "language": "en"}

r = requests.get(url=URL, params=PARAM)
print(r.text)

The verification code is the same as before
I used the same syntax as another working get request, but maybe i messed up somewhere
I tried re-validating with other phone numbers, other uuid, but nothing worked, i just get a code 503 "NOT_AUTHORIZED"

@pedrohsroque
Copy link

@MiteEnBois now we are at the same point:
#211

@LukeStonehm
Copy link

Good day chaps.

The solve here is very simple. The requests to https://rental-search.bolt.eu/categoriesOverview require what Bolt calls "Basic" authorization.

Include the header Authorization with the value Basic <token>.
The token value is also simple to generate:
Base64 this combo -> <phone-number>:<deviceId>
Example: +27124212211:cff09d97-4954-41b7-bd37-d8061ad3ff30 - when Base64'd = KzI3MTI0MjEyMjExOmNmZjA5ZDk3LTQ5NTQtNDFiNy1iZDM3LWQ4MDYxYWQzZmYzMA==

Example command I used from the terminal on Ubuntu: echo -n "+27124212211:cff09d97-4954-41b7-bd37-d8061ad3ff30" | base64.

I'll create a PR for Bolt EU so that this info can help others.

@ossings
Copy link

ossings commented Dec 1, 2021

Can confirm that this worked for me, thank you @LukeStonehm

@Embretr
Copy link

Embretr commented Jun 8, 2022

I tried running the code excactly as described here (with my own info of course), but i get this response when trying to register my phone:

{"code":702,"message":"INVALID_REQUEST","validation_errors":[{"error":"Is required","property":"version"},{"error":"Is required","property":"deviceId"},{"error":"Is required","property":"deviceType"},{"error":"Is required","property":"device_name"},{"error":"Is required","property":"device_os_version"},{"error":"Is required","property":"language"}]}

has the API changed so this doesnt work anymore, or am I just doing something wrong?

@BastelPichi
Copy link
Contributor

Please close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants