hello i'm trying this guide but it fail all time
https://github.com/ubahnverleih/WoBike/blob/master/Beam.md
To login, I need to get OTP code but i can't access to it
curl -d "phoneNumber=[phonenumber]countryCode= [countrycode]" \
-H "Content-Type:application/json" \
-H "User-Agent:escooterapp/latest-app-version;ios" \
-X POST https://gateway.ridebeam.com/api/auth/phoneverification
but it sends message like this
{"success":false,"message":"There was some error","response":{},"error":"","data":{}}
i don't know why this fail is my code grammarly wrong?
CodePudding user response:
The tutorial and the curl command say it's an application/json and you are passing an incorrect format in the data. Pay attention at the beginning of the command curl -d ...
Correct:
curl -d '{"phoneNumber":"<phone-number>","countryCode":" <country-code>"}' \
-H "Content-Type:application/json" \
-H "User-Agent:escooterapp/latest-app-version;ios" \
-X POST https://gateway.ridebeam.com/api/auth/phoneverification
Wrong:
curl -d "phoneNumber=[phonenumber]countryCode= [countrycode]" \
-H "Content-Type:application/json" \
-H "User-Agent:escooterapp/latest-app-version;ios" \
-X POST https://gateway.ridebeam.com/api/auth/phoneverification
Execution:
curl -d '{"phoneNumber":"123123123","countryCode":" 55"}' \
-H "Content-Type:application/json" \
-H "User-Agent:escooterapp/latest-app-version;ios" \
-X POST https://gateway.ridebeam.com/api/auth/phoneverification
{"message":"PhoneVerificationServiceErrorDomain","messageKey":1,"messageArgs":"{"status":400,"message":"Invalid parameter
To
: 55123123123","code":60200,"moreInfo":"https://www.twilio.com/docs/errors/60200"