cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How call the API ws410 in hybris?

Former Member
0 Likes
1,040

Hi, I have created a webservice and for that I used the ycommercewebservices template. Now in my custom webservice I have to call the API https://localhost:9002/ws410/rest/customers, but I get authorization errors. I know that Hybris web services authentification mechanism is based on OAuth. So I checked if the implex file salmpledata-oauthclients.impex was imported. And then when I want to get a token using Postman, the following error appears:

{ "error": "unauthorized", "error_description": "Bad credentials" }

My user is correctly assigned to webservicegroup. Do you know if there is any configuration that I missed?.

Thanks and best regards, Aldo!

alt text

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Hi Satish,

If your end point is secured, that requires authentication and token generation before accessing the endpoint. Looking at the response, it seems the /customers requires you to authenticate the user.

You can get access_token with https://localhost:9002/authorizationserver/oauth/token and pass client_id, client_secret, grant_type(as password in most cases), username & password.

and while accessing your endpoint use /customers?access_token=

Hope it helps!

Cheers
Anil

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Aldo,

Can you please let me know, like 'How did you get rid of the authentication error?'. Is it the problem with the access token expiration or refresh?

Former Member
0 Likes

Hi Aldo, add the following user group to your integration user :

customersupportmanagergroup

Former Member
0 Likes

Hi Victor, Thank you for getting back to me. I have added the user group customersupportmanagergroup to my user, but error still appear.

Regards, Aldo