# CtfScoreboardApi.StudentApi

All URIs are relative to *https://localhost/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addStudent**](StudentApi.md#addStudent) | **POST** /register | register a new student
[**deleteStudent**](StudentApi.md#deleteStudent) | **DELETE** /student/{id} | Delete student
[**getAllStudents**](StudentApi.md#getAllStudents) | **GET** /student/all | All students
[**getScorelist**](StudentApi.md#getScorelist) | **GET** /student/me/scorelist | Own detailed score list
[**getSelfStudent**](StudentApi.md#getSelfStudent) | **GET** /student/me | Own data
[**getUserById**](StudentApi.md#getUserById) | **GET** /student/{id} | Get user by id
[**updateStudent**](StudentApi.md#updateStudent) | **PUT** /student/{id} | Updated student


<a name="addStudent"></a>
# **addStudent**
> Student addStudent(body)

register a new student

will register a new student, will probably later be replaced by saml registration. 

### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var body = new CtfScoreboardApi.Student(); // Student | Student object to be added to the scoreboard


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.addStudent(body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Student**](Student.md)| Student object to be added to the scoreboard | 

### Return type

[**Student**](Student.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="deleteStudent"></a>
# **deleteStudent**
> deleteStudent(id)

Delete student

This can only be done by the logged in user.

### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var id = "id_example"; // String | The id of the student that needs to be deleted


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteStudent(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The id of the student that needs to be deleted | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getAllStudents"></a>
# **getAllStudents**
> StudentList getAllStudents()

All students



### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getAllStudents(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**StudentList**](StudentList.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getScorelist"></a>
# **getScorelist**
> [Score] getScorelist()

Own detailed score list



### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getScorelist(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[Score]**](Score.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getSelfStudent"></a>
# **getSelfStudent**
> Student getSelfStudent()

Own data



### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSelfStudent(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**Student**](Student.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getUserById"></a>
# **getUserById**
> Student getUserById(id)

Get user by id



### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var id = "id_example"; // String | The id that needs to be fetched.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUserById(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The id that needs to be fetched. | 

### Return type

[**Student**](Student.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="updateStudent"></a>
# **updateStudent**
> updateStudent(id, body)

Updated student

This can only be done by the logged in user.

### Example
```javascript
var CtfScoreboardApi = require('ctf_scoreboard_api');

var apiInstance = new CtfScoreboardApi.StudentApi();

var id = "id_example"; // String | id of student that needs to be updated

var body = new CtfScoreboardApi.Student(); // Student | Updated student object


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateStudent(id, body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| id of student that needs to be updated | 
 **body** | [**Student**](Student.md)| Updated student object | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

