Prestashop: Modernize PS API / webservice to support Json

Created on 28 Jul 2019  路  10Comments  路  Source: PrestaShop/PrestaShop

Could be usefull if prestashop supported modern json, instead of only having the difficult XML web service.

Improvement TBS WS

Most helpful comment

write a 100% new API (probably REST instead of SOAP) that will be documented and tested

Should be the best option, both API (SOAP & REST) can live together. It'll be easier to improve, document, and test the new one, when the old is untestable.

All 10 comments

Hi @thbl,

The API only supports XML on input but supports JSON output if you choose so:

http://[email protected]/api?output_format=JSON

Ping @PrestaShop/prestashop-core-developers what do you think about supporting Json?

Thanks!

@khouloudbelguith yea i know about the JSON output parameter, but don't find it usefull as there is no input.
Also why is the API named webservice in prestashop ? (maby a rename would be a good ide)
Think new PS users will search / look for API not webservice, and even the endpoint is called api

Another improvement could be to take into the consideration of the Accept header which is an industry standard and developers would not be confused about this quirky Prestashop API

@khouloudbelguith @marionf @colinegin any news on this ?

What do you think @eternoendless @PrestaShop/prestashop-core-developers ?

Reworking the API is in the PrestaShop roadmap (see https://github.com/PrestaShop/PrestaShop/projects/1#card-13082456) but it's a massive rework.

Currently it is very hard to add improvements (including full JSON handling) to it because it has almost no documentation, there is no specs (neither functional nor technical) and zero tests ; so it's very hard to do any modifications to it without breaking something.

So when we'll start this topic, we will have to either

  • write a complete documentation and testing net for current API before being able to modify it
    or
  • write a 100% new API (probably REST instead of SOAP) that will be documented and tested

This makes it impossible to work on this topic as a side-project, it needs to be a primary project scheduled into a version such as 1.7.8 or 1.7.9

write a 100% new API (probably REST instead of SOAP) that will be documented and tested

Should be the best option, both API (SOAP & REST) can live together. It'll be easier to improve, document, and test the new one, when the old is untestable.

This is in my opinion it's a : Must Have.

I'm thinking also on an JWT Authenticated API, and Endpoints to GET the Current Logged User Data. Examples:

  • /api/user (returns MY Logged customer data)

    • /api/user/address (return MY Logged customer data) .

Ping @PierreRambaud the prestashop-issue-bot delete the labels that you added :sweat_smile: I believe you need to choose one of them. Cloud you please add one of them for this issue.

PS: I add TBS label for now :wink: feel free to change it.

Thanks in advance!

You're right, I missed something, the TBS label si the good one :sweat_smile:

Was this page helpful?
0 / 5 - 0 ratings