wiggly Posted September 3, 2011 Share Posted September 3, 2011 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 More sharing options...
innovacy Posted March 10, 2022 Share Posted March 10, 2022 (edited) 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 March 10, 2022 by innovacy (see edit history) 2 Link to comment Share on other sites More sharing options...
LucasV Posted September 7, 2022 Share Posted September 7, 2022 HI @innovacy, And is it possible to get more information in one API GET request? For example, I would like to get all invoice data in one api instaid of using multiple /api/order_invoices/5 /api/order_details/5 /api/order_details/5 Link to comment Share on other sites More sharing options...
innovacy Posted September 8, 2022 Share Posted September 8, 2022 (edited) 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 September 8, 2022 by innovacy (see edit history) Link to comment Share on other sites More sharing options...
LucasV Posted September 8, 2022 Share Posted September 8, 2022 Okay, clear thanks. Relatively new to API, and I'm setting up a connection with Pabbly (zapier alternative). To have less requests, I'll have to use the MSQL connection then. Thanks for your reply. Lucas Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now