Skip to Content

Simulators

Team members

A team’s member list shows who belongs to the team and each member’s roles. Load the teams_launch_hub scenario and list the team’s owners:

H='Authorization: Bearer placeholder-token'
J='Content-Type: application/json'
curl -s -o /dev/null -w '%{http_code}\n' -X POST "$RYSTIC_URL/_rystic/scenario" -d '{"name":"teams_launch_hub"}'
# -> 204
MEMBERS="$RYSTIC_URL/v1.0/teams/3dd52548-ef0b-41b9-896b-e62254b098ed/members"
curl -s "$MEMBERS" -H "$H" | jq -c '[.value[] | {displayName, roles}]'
# -> [{"displayName":"Priya Nair","roles":["owner"]},{"displayName":"Hannah Weiss","roles":[]},{"displayName":"Aiko Tanaka","roles":[]},{"displayName":"Diego Santos","roles":[]},{"displayName":"Marcus Feld","roles":["owner"]}]
curl -s -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=roles/any(r:r eq 'owner')" | jq -c '[.value[].displayName]'
# -> ["Priya Nair","Marcus Feld"]

A member with an empty roles list is a plain member. $filter reads one property, roles, through any or all with eq.

Make a member an owner

A PATCH with roles changes the member’s role, and the owner filter follows:

HANNAH=$(curl -s "$MEMBERS" -H "$H" | jq -r '.value[] | select(.displayName == "Hannah Weiss") | .id')
curl -s -X PATCH "$MEMBERS/$HANNAH" -H "$H" -H "$J" -d '{"@odata.type":"#microsoft.graph.aadUserConversationMember","roles":["owner"]}' | jq -c '{displayName, roles}'
# -> {"displayName":"Hannah Weiss","roles":["owner"]}
curl -s -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=roles/any(r:r eq 'owner')" | jq -c '[.value[].displayName]'
# -> ["Priya Nair","Hannah Weiss","Marcus Feld"]

List everyone but the owners

A not around any lists the plain members (unconfirmed: not yet checked against Microsoft Graph):

curl -s -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=not(roles/any(r:r eq 'owner'))" | jq -c '[.value[].displayName]'
# -> ["Aiko Tanaka","Diego Santos"]

Differs from Microsoft Graph: roles/all(r:r eq 'owner') also lists members whose roles list is empty, where Microsoft Graph lists only the owners.

curl -s -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=roles/all(r:r eq 'owner')" | jq -c '[.value[].displayName]'
# -> ["Priya Nair","Hannah Weiss","Aiko Tanaka","Diego Santos","Marcus Feld"]

Test a refused list query

The member list returns 400 for these queries:

Queryerror.code
roles eq 'owner', outside any or allBadRequest
$orderby=rolesBadRequest
$count=trueempty
curl -s -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=roles eq 'owner'" | jq -c '.error.code'
# -> "BadRequest"
curl -s -G "$MEMBERS" -H "$H" --data-urlencode '$orderby=roles' | jq -c '.error'
# -> {"code":"BadRequest","message":"The query specified in the URI is not valid. The $orderby expression must evaluate to a single value of primitive type."}
curl -s -G "$MEMBERS" -H "$H" --data-urlencode '$count=true' | jq -c '.error | {code, message}'
# -> {"code":"","message":"The query specified in the URI is not valid. Query option 'Count' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings."}

Differs from Microsoft Graph: the two BadRequest refusals have a different error.message from Microsoft Graph’s.

Differs from Microsoft Graph: a filter on displayName, a ne comparison and an or that joins a roles clause with a displayName one return 400, where Microsoft Graph returns 200.

curl -s -o /dev/null -w '%{http_code}\n' -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=displayName eq 'Priya Nair'"
# -> 400
curl -s -o /dev/null -w '%{http_code}\n' -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=displayName ne 'Priya Nair'"
# -> 400
curl -s -o /dev/null -w '%{http_code}\n' -G "$MEMBERS" -H "$H" --data-urlencode "\$filter=roles/any(r:r eq 'owner') or displayName eq 'Aiko Tanaka'"
# -> 400

Differs from Microsoft Graph: $orderby on another property, such as displayName, returns 400 BadRequest with the roles message. Microsoft Graph returns 400 with an empty error.code and says the OrderBy option is not allowed.

curl -s -G "$MEMBERS" -H "$H" --data-urlencode '$orderby=displayName' | jq -c '.error'
# -> {"code":"BadRequest","message":"The query specified in the URI is not valid. The $orderby expression must evaluate to a single value of primitive type."}
Last updated on