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

HTTP API with Custom Header #160

Open
nrohrbach opened this issue Nov 27, 2023 · 1 comment
Open

HTTP API with Custom Header #160

nrohrbach opened this issue Nov 27, 2023 · 1 comment

Comments

@nrohrbach
Copy link

Hi there

I try to access the Validator using the HTTP API. On the GBFS feed side a custom Header is required (Authorization=[email protected])

How do I set a custom header in the options of your HTTP API?

Best regards
Nico

Hi Alban,

Thanks for reaching out! You can absolutely use the API, just note that it is not 100% production ready and may break. We also only have a limited number of requests available (125k/month). How often do you plan on requesting per day? We would ask that you include a user email in the header like so: User-Agent: <email_address>. There are no explicit permissions required on our end to give you access to the API, you should just be able to use it. Here is an example of how to use it with a curl command:

curl --location 'https://gbfs-validator.netlify.app/.netlify/functions/validator' \
--header 'accept: */*' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://dubai.publicbikesystem.net/customer/gbfs/v2/gbfs.json",
    "options": {
        "freefloating": false,
        "docked": false,
        "version": null,
        "auth": {
            "type": null,
            "basicAuth": {
                "user": null,
                "password": null
            },
            "bearerToken": {
                "token": null
            },
            "oauthClientCredentialsGrant": {
                "user": null,
                "password": null,
                "tokenUrl": null
            }
        }
    }
}'

Long term, we are planning to move the validator to something a more stable platform requiring API tokens in order to properly scale the tool.

Originally posted by @josee-sabourin in #95 (comment)

@richfab
Copy link
Contributor

richfab commented Dec 4, 2023

Hello @nrohrbach,
Thank you for this question!
Unfortunately, passing a custom header to validate a GBFS feed that requires authentication is not currently supported in the validator HTTP API.
The code of the validator is open source so please don't hesitate to contribute to it if you have the resources.
Thank you for your engagement in the GBFS community!

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

No branches or pull requests

2 participants