GetByUser() [OrganizationManager]

Get a list of organizations by user Id

Description

Get a list of organizations for a user.

Package Details

Interface

IOrganizationManager

Syntax

await OrganizationManager.GetByUser(int userId, int? serviceId)

Returns

Task<IEnumerable<Organization>>

API

GET
/api/v1/users/{id}/organizations

GET
/api/v1/users/{id}/organizations?serviceId={serviceId}

Parameters

Parameter

Description

Parameter Type

Parameter

Description

Parameter Type

id

User Id

path

serviceId (optional)

Service Id

Query string

Returns

On success, 200 Ok

On error, 400 Bad Request

On authorization error, 403 Forbidden

Example

var userId = 1; var organizations = await _organizationManager.GetByUser(userId);
var userId = 1; var serviceId = 2; var organizations = await _organizationManager.GetByUser(userId, serviceId);