Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrestaShop 9 API first user guide #1293

Merged
merged 10 commits into from
Jun 6, 2024

Conversation

kpodemski
Copy link
Contributor

@kpodemski kpodemski commented May 21, 2024

This article aims to show the basics of using the new API.

There were some issues I encountered during writing this article:

  1. I couldn't access /api-client/{apiClientId} endpoints.
  2. I couldn't list products using "{{api_url}}products/search/humm/10/PLN" error:

"If no employee is assigned in the context, cart ID must be provided to this method.".

  1. When I delete the customer group, there is no response at all apart from the status code 204 (no content).
  2. When I retrieve a resource that doesn't exist, the status is 500, and the HTTP code is 404.
  3. No endpoint to list all the customer groups in unfortunate.

@jolelievre
Copy link
Contributor

jolelievre commented May 21, 2024

@kpodemski FYI the n. 3 When I delete the customer group, there is no response at all apart from the status code 204 (no content). is on purpose
What would you expect? There is no data to return since it doesn't exist anymore, I believe it's a common convention fo rest APIs 🤔

@kpodemski
Copy link
Contributor Author

@jolelievre thanks, in this example I think 204 no content should be all right, when it comes to soft-delete, I guess we should handle status code 200? 🤔

Copy link
Contributor

@coffrep coffrep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @kpodemski a very great article, thanks so much for putting it together. I went on and added just a few edits and approving on my end.

content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
content/news/posts/2024/meet-prestashop9-api.md Outdated Show resolved Hide resolved
Co-authored-by: Patrick Coffre <103060695+coffrep@users.noreply.github.com>
@jolelievre
Copy link
Contributor

@jolelievre thanks, in this example I think 204 no content should be all right, when it comes to soft-delete, I guess we should handle status code 200? 🤔

We didn't handle soft delete so far but that makes sense, but maybe soft delete will be handled via an update request 🤔 Unless we create a dedicated command for soft delete, but we don't have this kind of command so far AFAIK

Copy link
Contributor

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kpodemski

All good for me, maybe you want to improve a few last things (like missing links maybe). Let us know when it's ready if you need another review

@kpodemski kpodemski merged commit 290b270 into PrestaShop:master Jun 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants