How to create a new KMC User using APIs

This is the code to create a new partner, but I want to create a new kmc user under a partner account using the APIs. I would appreciate any assistance/guidance

I found a sample script here (https://github.com/kaltura/php-api-examples/blob/master/SampleAddUser.php) to add a new user and I seemed to get it working. I had to modify it a little. It seems to add the user correctly, but the user does not show up in kmc at all.

Removed the script. See last post.

So I have tried quite a few versions of the script and even though the user is being created according to my kaltura apache logs, the user does NOT show up in KMC and they are unable to login. It should also be noted that the user never receives a confirmation email either.

Another question I have regarding this: How would I add the ability of the script to assign the new user to a role? For example I want every new user created with this to have the Content Uploader Role.

Thank you ahead of time for any assistance.

I was able to get the script working. I used the API Tes Console to experiment with and found that there were two different ways to add a user. One using $user = new KalturaUser(); and the other using $user = new KalturaAdminUser();. Using the first seems to add a user, but the user does not show up in KMC and they are unable to logon, so I do not understand at all what this actually accomplishes. Using the second does exactly what I wanted. The relevant code is below

$user = new KalturaAdminUser();
$user->id = 'robp102175';
$user->screenName = 'Rob';
$user->email = 'myemail@email.com';
$user->status = KalturaUserStatus::ACTIVE;
$user->password = 'Password1';
$result = $client->user->add($user);

Hello,

KMC is admin-user, user is end user that could be used for playback for example.
if the account doesnt require end-users login, then it could be used for playback reports.

Hope that clarifies things,

@rpelletier,

Like @jess mentioned, in Kaltura there are two types of users:

  1. End-User (KalturaUser) which represents a publisher’s end-user. Think of a site like Netflix, a consumer watching videos on Netflix would be an end-user.
  2. Admin-User (KalturaAdminUser / KalturaUser.isAdmin=true) which represents a publisher’s Administrator. In a site like Netflix that would be the Netflix personnel who has a god-like view to manage the content, organize the library, set permissions, configure settings, etc. In the Kaltura world, that would be the users who have access to the KMC (Kaltura Management Console).

Some relevant resources to review -

  1. The API training presentation
  2. Kaltura’s API Authentication and Security
  3. User service - Kaltura API Docs
  4. More API guides at the Knowledge Center API Guides binder

Thank you both, this explains it perfectly.

@rpelletier,

Glad it is now clearer:)
BTW, since you now have a working script, I invite to make a pull request to https://github.com/kaltura/php-api-examples so that others may enjoy it as well.

Thanks,