/
Add/Remove/Transfer Student from Class

Add/Remove/Transfer Student from Class

Using the LinkIt! REST API, you can add/remove/transfer a student from a class.

 

Click on the links below to learn how to generate the HTTPS PUT call for each of these methods.

 

 Add a Student to a Class
Resource URI
/classes/{id}?verb=addstudent
HTTPS PUT
/classes/{id}?verb=addstudent&timestamp={TimeStamp}&accesskey={AccessKey}&tag={Token}
Parameters for Request URL

The following parameters should be included in the request URL of the HTTPS PUT call to add a student to a class.

Parameter
Required?
Data Type
Description
idYes
INTEGER

the unique ID that identifies the class in the LinkIt! database.

TimeStampYes
DATETIME
the GMT time at which the call is generated. EXAMPLE: 5/1/2013+5:10:5+PM
AccessKeyYes
STRING (128)
a unique key associated with the API user. EXAMPLE: 123456789-987654321
TagYes
STRING (128)
token generated for authorization and authentication.
Parameters for Request Header

The following parameter should be included in the request header of the HTTPS PUT call to add a student to a class.

ParameterRequiredData TypeDescription
StudentIDYes
INTEGER

the LinkIt! ID of the student that you would like to add to the class. You can include up to 100 IDs to add multiple students to a class with a single call.

 Remove a Student from a Class
Resource URI
/classes/{id}?verb=removestudent
HTTPS PUT
/classes/{id}?verb=removestudent&timestamp={TimeStamp}&accesskey={AccessKey}&tag={Token}
Parameters for Request URL

The following parameters should be included in the request URL of the HTTPS PUT call to remove a student from a class.

Parameter
Required?
Data Type
Description
idYes
INTEGER

the unique ID that identifies the class in the LinkIt! database.

TimeStampYes
DATETIME
the GMT time at which the call is generated. EXAMPLE: 5/1/2013+5:10:5+PM
AccessKeyYes
STRING (128)
a unique key associated with the API user. EXAMPLE: 123456789-987654321
TagYes
STRING (128)
token generated for authorization and authentication.
Parameters for Request Header

The following parameter should be included in the request header of the HTTPS PUT call to remove a student from a class.

ParameterRequiredData TypeDescription
StudentIDYes
INTEGER

the LinkIt! ID of the student that you would like to remove from the class. You can include up to 100 IDs to remove multiple students from a class with a single call.

 Transfer a Student between Classes
Resource URI
/classes/{id}?verb=transferstudent
HTTPS PUT
/classes/{id}?verb=transferstudent&timestamp={TimeStamp}&accesskey={AccessKey}&tag={Token}
Parameters for Request URL

The following parameters should be included in the request URL of the HTTPS PUT call to transfer student between classes.

Parameter
Required?
Data Type
Description
idYes
INTEGER

the unique ID that identifies the original class in the LinkIt! database (the class that you would like to transfer the student out of).

TimeStampYes
DATETIME
the GMT time at which the call is generated. EXAMPLE: 5/1/2013+5:10:5+PM
AccessKeyYes
STRING (128)
a unique key associated with the API user. EXAMPLE: 123456789-987654321
TagYes
STRING (128)
token generated for authorization and authentication.
Parameters for Request Header

The following parameter should be included in the request header of the HTTPS PUT call to transfer students between classes.

ParameterRequiredData TypeDescription
StudentIDYes
INTEGER

the LinkIt! ID of the student that you would like to transfer.

ReceivingClassIDYes
INTEGER
the LinkIt! ID of the class that you would like to transfer the student into.
TransferTestResultsNo
STRING (10)
YES or NO. This parameter indicates whether the test results associated with this student and the original class should also be transferred to the new class. If this parameter is not included in the HTTPS PUT call or a "no" value is passed through, test results will stay with the original class.

 

 

Response

The following fields are included in the response following any of the HTTPS PUT calls listed above.

Field NameData TypeDescriptionExample
Result
STRING (10)
indicates whether the student is added to/removed/transferred from the class successfully.

SUCCESS

ERROR

Data
JSON/XML

returns null following an HTTPS PUT call to add/remove/transfer a student from a class.

See below for detailed examples.
Error
STRING (100)

provides explanation if result is ERROR."Null" is returned if result is SUCCESS.

Click here for a list of error messages.

Note: If you included multiple StudentIDs in the call, there will be individual success or error message for each student.

Examples

Example 1: Add a student to a class


Add the student (StudentID: 151557) to the class (ClassID: 566716)


 

 JSON
Method

PUT

Request URL
/classes/566716?verb=addstudent&timestamp=6%2f25%2f2013+6%3a22%3a59+PM&accesskey=123456789-987654321&tag=ddd7035402db83d9c9b347f90d175bc453acf5bc
Request Header
{ "StudentID": "151557", } 
Response Content
{"Result":"SUCCESS", "Data":null, "Error":null} 
 XML
Method

PUT

Request URL
/classes/566716?verb=addstudent&timestamp=6%2f25%2f2013+6%3a22%3a59+PM&accesskey=123456789-987654321&tag=ddd7035402db83d9c9b347f90d175bc453acf5bc 
Request Header
<ClassElement xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <StudentID>151557</StudentID> </ClassElement> 
Response Content
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Result>SUCCESS</Result></Response> 

Example 2: Remove a student from a class


Remove the student (StudentID: 151557) from the class (ClassID: 566716)


 

 JSON
Method

PUT

Request URL
/classes/566716?verb=removestudent&timestamp=6%2f25%2f2013+6%3a24%3a17+PM&accesskey=123456789-987654321&tag=c72909c563e4c96fc5cd7a1f51264957da06f858
Request Header
{ "StudentID": "151557", }
Response Content
{"Result":"SUCCESS", "Data":null, "Error":null}
 XML
Method

PUT

Request URL
/classes/566716?verb=removestudent&timestamp=6%2f25%2f2013+6%3a24%3a17+PM&accesskey=123456789-987654321&tag=c72909c563e4c96fc5cd7a1f51264957da06f858 
Request Header
<ClassElement xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <StudentID>151557</StudentID> </ClassElement> 
Response Content
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Result>SUCCESS</Result></Response> 

Example 3: Transfer a student from one class to another


Transfer the student (StudentID: 151557) from the class (ClassID: 566716) to the class (ClassID: 566717), including test results.


 

 JSON
Method

PUT

Request URL
/classes/566716?verb=transferstudent&timestamp=6%2f25%2f2013+6%3a26%3a31+PM&accesskey=123456789-987654321&tag=47059f761c962f6d9fdb3299f8d8612fb5cfb13e
Request Header
{ "ReceivingClassID": "566717", "StudentID": "151557", "TransferTestResults": "yes", } 
Response Content
{"Result":"SUCCESS", "Data":null, "Error":null}
 XML
Method

PUT

Request URL
/classes/566716?verb=transferstudent&timestamp=6%2f25%2f2013+6%3a26%3a31+PM&accesskey=123456789-987654321&tag=47059f761c962f6d9fdb3299f8d8612fb5cfb13e 
Request Header
<ClassElement xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ReceivingClassID>566717</ReceivingClassID> <StudentID>151557</StudentID> <TransferTestResults>yes</TransferTestResults> </ClassElement> 
Response Content
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Result>SUCCESS</Result></Response> 

Example 4: Add multiple students to a class


Add multiple students (StudentID: 3544245,1464543,1464542) to a class (ClassID: 3734035), some of which result in errors.


 

 JSON
Method

PUT

Request URL
/classes/3734035?verb=addstudent×tamp=8%2f21%2f2017+6%3a27%3a44+PM&accesskey=30AB3A28-EF9E-4177-8CEA-45CD631A1253
Request Header
{
 "StudentID": "3544245,1464543,1464542",
}
Response Content
{"Result":"SUCCESS", "Data":{"StudentIDs":[{"StudentID":"3544245", "Status":"ERROR", "Errors":[{"Code":"3103", "Message":"Add student failed - This student has already assigned on this class"}]}, {"StudentID":"1464543", "Status":"ERROR", "Errors":[{"Code":"3084", "Message":"Add student failed - StudentID is not found"}]}, {"StudentID":"1464542", "Status":"SUCCESS", "Errors":null}]}, "Error":null}
 XML
Method

PUT

Request URL
/classes/3734035?verb=addstudent×tamp=8%2f21%2f2017+6%3a27%3a44+PM&accesskey=30AB3A28-EF9E-4177-8CEA-45CD631A1253
Request Header
<ClassElement xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <StudentID>3544245,1464543,1464542</StudentID>
 </ClassElement>
Response Content
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Result>SUCCESS</Result><Data><Class><Student><StudentID>3544245</StudentID><Status>ERROR</Status><Errors><Error><Code>3103</Code><Message>Add student failed - This student has already assigned on this class</Message></Error></Errors></Student><Student><StudentID>1464543</StudentID><Status>ERROR</Status><Errors><Error><Code>3084</Code><Message>Add student failed - StudentID is not found</Message></Error></Errors></Student><Student><StudentID>1464542</StudentID><Status>SUCCESS</Status><Errors /></Student></Class></Data></Response>

Navigation and Reference

 

 

Related content