0

I am communicating with a JSON API by sending requests using URL'sin the browser. The Endpoint returns information about football matches. It has a parameter named league_id which shows me information about a specific league. Example:

https://football.domain/api/?action=league_id=1

However i want to get results for more then one league in one request

I have tried :

https://football.domain/api/?action=league_id=1&league_id=2

However the api only shows me the results for one of the the leage_id parameters (League_id=2)

is their a correct format i need to use for specifying multiple values for one parameter?

1 Answer 1

1

If the API supports multiple values for a single query parameter they'll most likely be comma separated.

Eg,

...ID=1,2,3...

Although, there is no "default" support for supplying multiple values for a single parameter as this is something the API provider needs to specifically encode.

If you are able to do it, the docs for the API will say so. They'll likely say something like " input is a comma separated list of IDs".

If they don't, then you're not able to do this and instead will need to make multiple calls.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.