If you'd like to add users to a Site License, but don't want to do it manually through the Piano dashboard, you can use our Piano API endpoint below.
Please follow these steps:
-
Prepare a list of users, that you'd like to add to any site license/s
-
Add a site licensing user to the specific contract (i.e. create a user in a contract) via this endpoint:
/publisher/licensing/contractUser/create -
Redeem access through the contract for this specific user via this endpoint:
/publisher/licensing/contract/redeem -
Now repeat point 2. and 3. for each user from your list
For creating contracts & licenses via API, you can use the below endpoints:
/publisher/licensing/contract/create
/publisher/licensing/licensee/create
Please keep in mind that users cannot be granted access to the same resource twice.
You can get the manager_uids as explained here.