On Mon, Mar 27, 2023 at 9:52 AM Masakazu Yasumoto
<
myasu...@outlook.com> wrote:
> I'm a CS student and new to the V3 API. I'm struggling to use the API key provided. When I make an API request, where do I specify the API key? Is it included in the url? I tried something like:
>
https://api-v3.mbta.com/stops&api_key=my_api_key
>
> But it didn't work. I'm creating an Android mobile application using Java. I can access the API without the key but I would like to make more than 20 calls a minute.
>
> I'm using JSONObjectRequest and StringRequest class
The separator for the query string is a question mark (?) not an
ampersand (&), so you probably want
https://api-v3.mbta.com/stops?api_key=my_api_key but most client API
libraries for HTTP have support for marshalling query strings from a
map, so if the Android one does, you should use that and let it take
care of all the punctuation, escaping, and string concatenation for
you.
Tom