ubahnverleih / WoBike

Documentation of Bike Sharing APIs 🚴🛴🛵
948 stars 131 forks source link

Voi: 401 error #279

Open dr-who123 opened 3 months ago

dr-who123 commented 3 months ago

Hi,

I had a working scraper for Voi, but since some time I am getting 401 errors when connecting to the API. I even tried it with a new token generated from browser stack, but even the simple access token request returns a 401 error:

import requests

token = "ey..."

body = {"authenticationToken": token}

r = requests.post("https://api.voiapp.io/v1/auth/session", json=body)

print(r)

Does anyone know how to fix this? Thanks a lot!

BastelPichi commented 3 months ago

You need the following headers:

    "user-agent": "okhttp/4.12.0",
    "x-app-version": "3.231.0",
    "x-request-id": "whatever"

other endpoints might need them too now.

JimmyZhan1213 commented 2 months ago

I am currently experiencing the same problem. When I visit the link https://api.voiapp.io/v1/auth/verify/phone directly, it prompts a 404 page. When I change v1 to v2, the page prompt changes to 405. However, after the code r = requests.post("https://api.voiapp.io/v2/auth/verify/phone", json=data, headers=headers), I try to print the r.text and r .status_code contents and what comes up is 401. I don't know how to do the latest version of validation and would sincerely appreciate your help. I'm not sure if it's related to the content of the header, currently my header is: headers = { "x-app-version": "3.231.0", "x-os": "Android", "x-os-version": "28", "model": "Pixel 3a XL", "brand": "google", "manufacturer": "Google", "x-app-name": "Rider", "user-agent": "okhttp/4.12.0", "x-request-id": "whatever" }

BastelPichi commented 2 months ago

I am currently experiencing the same problem. When I visit the link https://api.voiapp.io/v1/auth/verify/phone directly, it prompts a 404 page. When I change v1 to v2, the page prompt changes to 405. However, after the code r = requests.post("https://api.voiapp.io/v2/auth/verify/phone", json=data, headers=headers), I try to print the r.text and r .status_code contents and what comes up is 401. I don't know how to do the latest version of validation and would sincerely appreciate your help. I'm not sure if it's related to the content of the header, currently my header is: headers = { "x-app-version": "3.231.0", "x-os": "Android", "x-os-version": "28", "model": "Pixel 3a XL", "brand": "google", "manufacturer": "Google", "x-app-name": "Rider", "user-agent": "okhttp/4.12.0", "x-request-id": "whatever" }

This wont work for obtaining an token. See this issue.