Skip to content

HTTP API with Custom Header #160

@nrohrbach

Description

@nrohrbach

Hi there

I try to access the Validator using the HTTP API. On the GBFS feed side a custom Header is required (Authorization=gbfs@bfe.admin.ch)

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions