If you prefer Postman, Matthias Zeis wrote about it!
I’m just writing a little plugin and for some reason the API is not returning the seo_urls on a product – once I fiddled out the reason for that hopefully I write another blog post.
But for the moment I need to debug the Shopware 6 API and the result. Copying over the API call from Safaris Network tab as cURL and calling it again and again on the console (to not mix it up with all the other AJAX calls, especially the message queue consume, etc.) is a little annoying, because if you take too long this happens:
{
"errors":[
{
"code":"9",
"status":"401",
"title":"The resource owner or authorization server denied the request.",
"detail":"Access token could not be verified",
"meta":{
"trace":[
[...]
],
"file":"\/var\/www\/html\/vendor\/league\/oauth2-server\/src\/Exception\/OAuthServerException.php",
"line":243
}
}
]
}
So to make it easier it would be cool to have a client which automatically takes care of Authorization and because I couldn’t find a blog post for me, here is one!
I’m using Paw. Paw is awesome and a lot of fun. You can do SO MUCH with it and I didn’t even touch the surface.
How to configure Shopware?
Create a Shopware Integration.
Settings > Integrations > New

After clicking the button, you get the following form, enter the best name you can come up with, for testing purposes just use “Administration” as role, so you can do anything and copy Access key ID and Secret access key!
Important! The credentials only work if you click “Save integration”!

If you don’t create the user locally and/or not for testing purposes, think extensively which access the user needs to give him as less permissions as possible.
Once this is done we can configure Paw!
How to configure Paw?
Create a new Paw project. Under Auth you find OAuth 2 and there you configure the following:

Once configure (and assuming you saved the configuration on the shopware backend ;-)) you can now click on “Get Access Token” and you should be greeted by:

One click on Use Acccess Token and you can start using the API by entering it in the top field:

Hope it works for you!
Good luck and happy coding!