One way to get the list of roles is to make a successful Login request to Suitetalk, also known as Netsuite Webservices.
This will return a list of all available roles.
You can find more information about this in the API documentation.
There is also a REST role service that can retrieve all accounts, roles, and domains available for a user.
You can use the following URL: https://rest.netsuite.com/rest/roles.
Make sure to include the necessary headers in your request. Please note that access to this service requires Netsuite login credentials.
To view the Roles list within Netsuite, go to Setup > Users/Roles > Manage Roles.
However, if you are looking for a workaround, you can create a saved search on the employee record with the role in the search column (group) and then use the search API to get the search results.
Here is an example of how to retrieve the roles list using code:
$nsroleObject = new RecordRef();
$nsroleObject->internalId = $roleId ? $roleId : $this->_accountInfo['nsrole'];
$passPort = new Passport();
$passPort->email = $this->_accountInfo['nsemail'];
$passPort->password = $this->_accountInfo['nspassword'];
$passPort->account = $this->_accountInfo['nsaccount'];
$passPort->role = $nsroleObject;
$loginRequest = new LoginRequest();
$loginRequest->passport = $passPort;
$result = $this->netsuiteService->login($loginRequest);
if (!$result || !$result->sessionResponse->status->isSuccess) {
return false;
}
// If the login is successful, update the roles list
$this->_wsRoleList = $result->sessionResponse->wsRoleList->wsRole;
By following these instructions, you will be able to retrieve a list of roles available in Netsuite and use them for your provisioning solution.