Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ServiceManager.EnrollUser(int userId, int serviceId, int? organizationId = null )

Returns

Task

API

...

Implementation Notes

Internal users must not be associated with any organizations.

POST
/api/v1/services/{idserviceId}/enrolluser?userId={userId}&organizationId={organizationId}

Parameters

Parameter

Description

Parameter Type

serviceId

Service for which the user will be enrolled to

Path

userId

User to enroll

Query string

organizationId (Optional)

The optional id of the organization

Query string

Returns

On success, 200 Ok

If UserManage.GetByPermissionServiceOrg returns null, 422 Unprocessable Entity

On error, 400 Bad Request

On authorization error, 403 Forbidden

Parameters

  • userId: User to enroll

  • serviceId: Service for which the user will be enrolled to

  • organizationId: The optional id of the organization

Returns

200 OK

Example

Code Block
languagec#
int myServiceId = 12345
int myOrganizationId = 323;

_serviceManager.EnrollUser(CurrentUser.Id, myServiceId, myOrganizationId);

// No organization
_serviceManager.EnrollUser(CurrentUser.Id, myServiceId);

...