Add a group member
Changed onAdd a teacher or student to a group. Only a group owner can add members. If no user exists for the submitted email, the application creates one and adds it to the group.
If a user already exists for that email, that person is emailed an invitation and becomes a member only once they accept it, because joining a group places the account under the institution's administration. An invitation expires after 14 days.
Both outcomes answer 201 with success: true and the same body shape. Read status to tell them apart: added means the membership exists now; invited means an invitation was sent and no membership exists yet. On invited, data.id is null — there is no group member to address, so it cannot be passed to edit-member or remove-member. data.user is the real account that was invited, and data.role and data.limit are what the membership will carry once accepted.
A client that ignores status keeps working, but will believe a member exists when only an invitation does. To confirm, read the group's members with GET /api/v1/groups/{id}/.
Exception: if the existing account's email is an LMS login rather than a real address (no @), no invitation can be delivered, so the member is added directly and status is added.
Request
- Base URLhttps://plagiarismcheck.org
- AuthAPI key in header X-API-TOKEN
Path parameters
Numeric group ID.
Request body application/x-www-form-urlencoded
Example request
{
"email": "student@example.com",
"role": "student",
"name": "Student Name",
"limit": 100
}Response
The request succeeded. status says whether a membership was created (added) or an invitation was sent (invited). The body shape is the same either way; on invited there is no group member yet, so data.id is null.
Example response
{
"success": true,
"status": "invited",
"data": {
"id": 3132945,
"role": 2,
"limit": 100,
"created_at": 1512638171000,
"user": {
"id": 3132945,
"name": "John Doe",
"email": "student@example.com",
"created_at": 1512638171000,
"updated_at": 1512638171000,
"allowed_languages": [
"en"
],
"balance_type": 1,
"avatar": "https://randomuser.me/api/portraits/lego/1.jpg",
"is_email_verification_needed": true
}
}
}Changes
- breaking
the
//response's property format changed fromemailto no format for status - info
added the optional property
//to the response with the status - info
added the optional property
to the response with the status
- breaking