Skip to content

ndi.cloud.api.admin.addOrganizationMemberByEmail

 ADDORGANIZATIONMEMBERBYEMAIL Add a user to an NDI Cloud organization by email address (admin only).

    [B, ANSWER, APIRESPONSE, APIURL] = ndi.cloud.api.admin.addOrganizationMemberByEmail(CLOUDORGANIZATIONID, EMAIL)

    Looks the user up with ndi.cloud.api.admin.findUserByEmail and then
    calls ndi.cloud.api.admin.addOrganizationMember. The user must already
    have an NDI Cloud account; this does not send an invitation. Requires
    an account with administrator rights.

    Inputs:
        cloudOrganizationID - The organization's id.
        email               - The user's email address (exact, any case).

    Outputs:
        b           - True if the user was found and added, false otherwise.
        answer      - On success, the organization with its updated member
                      list (see ndi.cloud.api.admin.getOrganization). On
                      failure, the error from whichever step failed.
        apiResponse - The ResponseMessage of the last call made.
        apiURL      - The URL of the last call made.

    Example:
        [ok, org] = ndi.cloud.api.admin.addOrganizationMemberByEmail(orgId, "person@example.com");
        if ok, disp(org.memberEmail'); end

    See also: ndi.cloud.api.admin.addOrganizationMember,
              ndi.cloud.api.admin.removeOrganizationMemberByEmail