question

niranjan avatar image
niranjan asked Miguel Deactivated commented

How to fetch user defined roles from Android APP using the V3 REST API?

Hello All,

I am trying to fetch the user defined roles using the Clover "V3 REST API"(/v3/merchants/{mId}/employees) from within my Android Application.

I am using the "expand" parameter with "roles" value. This returns a "401 Unauthorized error" however if I do not give the expand parameter I am getting all the employee information but without user defined roles. I will be great if anyone can help me with the solution for this issue.

Thanks in advance.

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

op27no22 avatar image op27no22 commented ·
I am getting this exact same issue. Was there any resolution to this?
0 Likes 0 ·
Miguel avatar image Miguel op27no22 commented ·

@op27no22, have you made sure your app has the correct permissions. If you have an android app and have updated the permissions after the initial install, you will need to uninstall and reinstall for the new permissions to be granted.

0 Likes 0 ·

1 Answer

Mike M avatar image
Mike M answered

I am unable to reproduce your issue in receiving the 401 Unauthorized Error when using a roles expansion. If an expand parameter requires additional permissions to access that additional field, you should be receiving a 403 Forbidden and an error message saying: Invalid permissions for expandable fields.

I just was able to test the roles expansion successfully using only merchantread and employeeread permission set. The user-defined roles will show up in the roles field, as opposed to the default role field that reflects the systemRole, which a user-defined role is built on top of.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community