The Magento Rest Api can't delete a customer or categorie.
The Magento Rest Api Swagger Documentation is not correct.
The Magento Rest Api using JSON doesn't always giveback JSON.
Magento ver. 2.1.7
will result in: "xd5yb9n...." copy the token and add in the next request
-- Verify that you have a HTTP 200 result with valid JSON data.
-- Verify that the data contains customer with id: 6
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Error 404: Not Found</title>
<base href="http://keen-webshop.nl/errors/default/" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="*"/>
<link rel="stylesheet" href="css/styles.css" type="text/css" />
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
<main class="page-main">
<h1>404 error: Page not found.</h1>
</main>
</body>
</html>
Hi @RogerKeulen, thank you for raising this. Can I just check that the account attached to the token used in the authentication has the right permissions set to delete customers.
Hi David !
Did not expect you here.... :-)
Yes, ofcourse....
I'm using the Rest-Api with the bearer token. (username + password from backend-user)
When i go to the backend of magento and lookup the user 'roger', i see the role assigned: Administrator.
When i lookup the role-resources for 'Administrator' it says: 'all'
And i checked: role-users that the user: 'roger' is in the list and active.
Also i logged into the backend with this user: 'roger' and then deleted the 'customer group' that my unit tests had created it says: You deleted the customer group.
Have the same problem with categories and customers.
All the DELETE tests are failing, but GET and POST are working fine.
Ps: If you want/need i can give you credentials and the real url. It's just a test shop for testing the Magento 2.1.7 Api.
Hi David,
I tried it now on a other test webshop: Magento 2.2 Release candidate 3 and it works just fine.
Is there a test you can advice me to do, so i can check if it's installation/configuration related ?
For now i'm using the 'other' Magento installation for writing my integration tests. If they all 'pass' and do what i expect them todo. I can use them to try to understand what is going wrong with my Magento 2.1.7 installation.
Oh that is interesting, annoying but interesting. Apart from the version of Magento is there anything different between the two installations?
I have seen a few times that if the entity load fails the API will give a 404. I can only recommend using xdebug to step through the process and see what happens.
I can only recommend using xdebug to step through the process and see what happens.
Yes, that's my plan. I will write my tests first using the latest version of Magento (2.2 Release candidate 3) and then when i'm shure everything works like expected. Switch to the older version 2.1.7 and try to debug it. I will post my findings in a new issue with more details, if i can see what is going wrong.
You can close this issue as "unresolved".
Most helpful comment
Hi @RogerKeulen, thank you for raising this. Can I just check that the account attached to the token used in the authentication has the right permissions set to delete customers.