Memberships

A membership defines the kind of association between a class and a student or teacher

Get Students for a Class

get
/v2p0/classes/{class_id}/students

This endpoint retrieves all students belonging to a class as specified by class ID.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Path parameters
class_idintegerRequired

Unique identifier for class.

Query parameters
include_archived_studentsbooleanOptionalDefault: false
Responses
200

Success

application/json
get
/v2p0/classes/{class_id}/students
GET /v2p0/classes/{class_id}/students HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

Success

{
  "student_ids": [
    10193652
  ],
  "student_levels": {
    "10193652": "SL"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "per_page": 100
  }
}

Get all Memberships

get
/v2p0/memberships

This endpoint retrieves all members for each class (students, teachers and admin). It returns for each user the class ID, user ID, user role in the class and other details.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Query parameters
class_ids[]integer[]Optional

The list of class IDs to select membership for

modified_sincestringOptional

A timestamp to filter the modification date of results.

deleted_sincestringOptional

A timestamp to filter the deletion date of results.

pagestringOptional

An integer defining which page to display.

per_pagestringOptional

An integer defining the number of records to display per page.

user_ids[]integer[]Optional

An integer list of users ids to filter by.

user_idsinteger[]Optional

An integer list of users ids to filter by.

class_happens_onstring · dateOptional

A date param to filter by start term and end term date range.

Responses
200

successful

application/json
get
/v2p0/memberships
GET /v2p0/memberships HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

successful

{
  "memberships": [
    {
      "id": 922,
      "user_id": 2012,
      "level": 1,
      "created_at": "2021-06-28T12:39:52.000Z",
      "updated_at": "2021-06-28T12:39:52.000Z",
      "class_id": 899,
      "user_email": "[email protected]",
      "role": "Student"
    },
    {
      "id": 923,
      "user_id": 2013,
      "created_at": "2021-06-28T12:39:52.000Z",
      "updated_at": "2021-06-28T12:39:52.000Z",
      "class_id": 900,
      "user_email": "[email protected]",
      "role": "Student"
    },
    {
      "id": 924,
      "user_id": 2014,
      "created_at": "2021-06-28T12:39:52.000Z",
      "updated_at": "2021-06-28T12:39:52.000Z",
      "class_id": 901,
      "user_email": "[email protected]",
      "role": "Student"
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "per_page": 100
  }
}

Get a Student's memberships

get
/v2p0/students/{id}/memberships

This endpoint retrieves details of all student memberships.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Path parameters
idintegerRequired

Unique identifier of a student.

Query parameters
archivedbooleanOptional

Boolean value to filter memberships by archived status.

Default: false
Responses
200

Success

application/json
get
/v2p0/students/{id}/memberships
GET /v2p0/students/{id}/memberships HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

Success

{
  "memberships": {
    "classes": [
      {
        "id": 1,
        "uniq_id": "text",
        "name": "text",
        "archived": true,
        "start_term_id": 1,
        "end_term_id": 1
      }
    ],
    "groups": [
      {
        "id": 1,
        "name": "text",
        "archived": true
      }
    ],
    "year_groups": [
      {
        "id": 1,
        "name": "text",
        "program": "text",
        "archived": true
      }
    ]
  }
}

Last updated

Was this helpful?