question

kelvin avatar image
kelvin asked kelvin commented

Unable to assign different System Role to employee via Rest API

Just realized that we can't change employee's role using REST API. Is this a bug or we need different API call?


curl --request POST \
  --url 'https://sandbox.dev.clover.com/v3/merchants/WSXVX2XS45NCM/employees/VEDM3VSM65Y1J?access_token=xxxxx' \
  --header 'content-type: application/json' \
  --data '{"role":"EMPLOYEE","name":"Yangxue","pin":"444444"}'
Employees
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered kelvin commented

You need to set the "roles" property (array), not the role property:

{
   "roles":[
      {
         "id":"2B61VFG7PQ4H8"
      }
   ],
   "name":"Yangxue",
   "pin":"444444"
}

A little tip for you, we utilize the REST APIs in our dashboards. So if you are ever having issues with a specific request many times you can go to the dashboard, manually update the data you are interested in, and then view the request in your browser's debug console.

1 comment
10 |2000

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

kelvin avatar image kelvin commented ·

Thanks. This API must be updated. It used to work with single Role field for system Role.

0 Likes 0 ·
David Marginian avatar image
David Marginian Deactivated answered kelvin commented

Have you tried not specifiying the pin or specifying a different pin in the request?

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