Jump to content

Product list and details as JSON


Recommended Posts

Hi,

I am trying to make a web request to a site made with Prestashop (v.1.7.3 with dummy content) in order to show the list of products and the product details (including images) within a table view of an iOS app I am currently prototyping using SWIFT 4. 

No intention so far to put new products nor make purchases through the app, just mirror the shop in the app.

I have checked the Prestashop Web Services documentation, created an auth key and I have found that it is possible to get the products in JSON format using an url formatted as:

http://access_key@my_website.com/api/products?output_format=JSON

What I get is the following JSON file:

{"products":[{"id":2},{"id":4},{"id":8},{"id":1},{"id":16},{"id":17},{"id":18},{"id":6},{"id":7},{"id":9},{"id":10},{"id":11},{"id":15},{"id":19},{"id":3},{"id":5},{"id":12},{"id":13},{"id":14}]}

It seems something like a dictionary, with only the identifiers of each product. 

Now I am stuck, since I do not know how to extract more info about each product from this JSON file. The Prestashop Web Services documentation is not very clear and it is basically php oriented.

Thanks for any suggestion or reference to study!

  • Haha 1
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...