Pearson
Always Learning

API Group: 

This API retrieves the user role for the specified user enrolled in the course.

Note: The same user may have different roles for each enrolled course.



Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols OAuth 1.0a, OAuth 2.0
Valid for Roles (OAuth 2): Professor, Teaching Assistant, Student, Administrator
Note that Students can only request their own role.

API Request

API Endpoints

HTTP Verbs and URIs

GET /users/{userId}/courses/{courseId}/role{.format}
  • Retrieves the role information for the specified user in the specified course.

Parameters

Parameter Description Valid Values
{userId} LearningStudio User ID or relevant user overload.
  • Numeric ID issued by LearningStudio
  • loginid={clientString}|{username}
  • or replace /users/{userId} with /me
    (OAuth 2 only)
{courseId} LearningStudio Course ID or relevant course overload.
  • Numeric ID issued by LearningStudio
  • ccn={callNumber}
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Query String Parameters

No Query String Parameters are supported.

Request Body

None

API Response

Response Header

This API returns the standard HTTP Status Codes used by the LearningStudio APIs. There are no special headers returned by the API.

Note that if using OAuth 2 and a student's access token, requesting any other user's role will return a 403 - Forbidden status code.

Response Body

Format

{
  "role": {
      "id": "{roleId}",
      "type": "{roleType}",
      "name": "{roleName}",
      }
}

Property Descriptions

Name Description Valid Values
{roleId} Id of the role for the user in the course. Note: The same user may have different roles for each enrolled course. For example, a user may be a Student in one course and a Teaching Assistant in another course.
{roleType} Type of the role.
  • PROF - Professor.
  • TAST - Teaching Assistant.
  • STUD - Student.
{roleName} Name of the role as defined by the Educational Partner.

Examples

Request

Endpoint

GET /users/5678/courses/1234/role

or

GET /me/courses/1234/role

Response

Body

{
  "role": {
    "id": 2,
    "type": "STUD",
    "name": "Student"
    }
}
2489 reads
Always Learning
Pearson