This API is under construction. Some of the details documented here may change.

Read User

Functional Overview

With the basic read user call, you may retrieve a user's first name, last name, email address, and default user type. With the secondary call listed below you can retrieve information about a user's current enrollments.

GET /user/$user_ID

Returns basic user information

Parameters

Required:
user_id
INTEGER. Generated by Turnitin, used as primary handle for user.
Optional:
none

Outputs

first_name
STRING. User first name.
last_name
STRING. User last name. This field is required by the Turnitin user interface to create a user password.
email
STRING. User email address, used as user login ID. Must be formatted as email address with "@". Must be unique.
id
//integer. max size xxx. unique identifier for user
date_lastmodified
/DATE. Date user record was last modified in Turnitin.
default_language
STRING. Accepts languages codes, in the format of "es" or "MX-es". Will dictate language presented to user in the Turnitin user interface and document viewer.
default_user_type
INTEGER. Values:1=student (default), 2=instructor. Default user role in Turnitin. Does not control User access to a class. User access to a particular class is determined by class enrollment, may deviate from default user type.

Error Codes & Text

Code Text
XXX "User ID required"
XXX "User does not exist"
XXX "An unexpected error occurred. Please contact Turnitin support"

GET /user/123456789
{
  "user": [
    {
      "id": "https://<base_url>/user/123456789",
      "default_language": 2,
      "default_user_type": 2,
      "last_name": "User",
      "first_name": "Test",
      "email": "test_user@turnitin.com",
      "date_lastmodified": "2011-06-04T18:47:36.537541000-07:00",
      "date_lastmodified_local": "2011-06-04T18:47:36",
    }
  ]
} 

GET /user/$user_id/enrollments

Returns list of classes user is enrolled in as either an instructor or a student

Parameters

Required:
user_id
INTEGER. Generated by Turnitin, used as primary handle for user.
Optional:
none

Outputs

"student classes"
ARRAY. IDs of classes where user is a student
"instructor classes"
ARRAY. IDs of classes where user is an instructor

Error Codes & Text

Code Text
XXX "User ID or email address required"
XXX "User does not exist"
XXX "An unexpected error occurred. Please contact Turnitin support"

GET /user/123456789/enrollments
{
  "student classes": [
    {
      "id": "https://<base_url>/class/23456789"
    },
    {
      "id": "https://<base_url>/class/23456780"
    }
  ],
  "instructor classes": [
    {
      "id": "https://<base_url>/class/34567890"
    },
    {
      "id": "https://<base_url>/class/34567809"
    }
  ]
}