Jump to content

Join several WebService Calls


wiggly

Recommended Posts

Hello, I want to join multiples webservice calls.

 

For example, when I call to: /api/products/1, webservice returns several data, one of this ... id_default_combination. I would like to get that combination information when I call to /api/products/1. I mean only one call to the webservice, not 2.

 

Is it possible?

 

Thank you very much!!

 

Best regards!

Link to comment
Share on other sites

  • 10 years later...

Because people still get to this post even though it is old (it is one of the first in google), here is the solution:

To receive the data for several entries of one resource, you are calling the URL without an ID, as example:

/api/products/

On this you can add several additional parameters to limit what you receive, with the 'filter' keyword. If you need a list of specific IDs, you can request:

/api/products/?filter[id]=[1|2|3|5|10]

And last you add what data you want to receive, with the 'display' keyword. You can use either 'full' or a list of fields to return, like this:

/api/products/?filter[id]=[1|2|5|10]&display=full
/api/products/?filter[id]=[1|2|3|5|10]&display=[id,name]

For a full list of capabilities using 'filter' and all available keywords, see: https://devdocs.prestashop.com/1.7/webservice/tutorials/advanced-use/additional-list-parameters/

Edited by innovacy (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 5 months later...

Well, if you look at the way you calling that, you got your answer. If it's the url determining the resource you requesting, then no, you can't pack several URLs in one HTTP request. You can ask for several entries of the same resource, with the help of filters, but you cannot do different resources in the same HTTP GET request.

Edited by innovacy (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...