Skip to content

Commit

Permalink
Add second set of APIs - Set2
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshitaShroff committed May 13, 2024
1 parent 762b9cc commit 7222427
Show file tree
Hide file tree
Showing 5 changed files with 1,502 additions and 5 deletions.
53 changes: 52 additions & 1 deletion src/content/docs/backend/API/tii_eula.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,55 @@ This "tii_eula" API has the following operations.
- **GET** /api/tii_eula


## Detail of Operations related to tii_eula.
## Detail of Operations related to tii_eula.

### PUT: Trigger an action on the given group attachment
PUT /api/tii_eula/users/{id}/accept

- URL: `/api/tii_eula/users/{id}/accept`
- Method: `PUT`
- Parameters:

| Parameter | Description |Parameter Type| Data Type|Mandatory|
|---------------------|-----------------|------------|------------|---|
|id | The user id who is accepting the EULA| path | integer |Yes|
|Username | User username | header | string |Yes|
|Auth_Token | Authentication token | header | string |Yes|

- Response:
`200 OK`

- Example Request:
```bash
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/tii_eula/users/1/accept'
```
- Response body:
```
"22448dfcaa620f1ad665d4b7"
```


### GET: Get the current EULA html
GET /api/tii_eula

- URL: `/api/tii_eula`
- Method: `GET`
- Parameters:

| Parameter | Description |Parameter Type| Data Type|Mandatory|
|---------------------|-----------------|------------|------------|---|
|Username | User username | header | string |Yes|
|Auth_Token | Authentication token | header | string |Yes|

- Response:
`200 OK`

- Example Request:
```bash
curl -X GET --header 'Accept: text/html' --header 'Username: aadmin' --header 'Auth_Token: ZRZfC2r8_2KNZKdstXHc' 'http://localhost:3000/api/tii_eula'
```
- Response body:
```
null
```

28 changes: 27 additions & 1 deletion src/content/docs/backend/API/tii_hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,36 @@ title: Doubtfire API
# List of Doubtfire

# API: tii_hook
tii_hook : Operations about tii_hook
This markdown document provides detailed documentation for the "tii_hook" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl.

This "tii_hook" API has the following operations.
- **POST** /api/tii_hook

## Detail of Operations related to tii_hook.

### POST activity_types: Accept the TurnItIn EULA
POST /api/tii_hook

- URL: `api/tii_hook`
- Method: `POST`
- Parameters:

| Parameter | Description |Parameter Type| Data Type|Mandatory|
|---------------------|-----------------|------------|------------|----|
| X-Turnitin-Signature | Valdates server identity | header| string| Yes|
|X-Turnitin-EventType | The name of the event type for this request | header| string| Yes|


- Response:
`201 Created`: Accept the TurnItIn EULA

- Example Request:
```bash
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/error' --header 'X-Turnitin-Signature: <signature_value>' --header 'X-Turnitin-EventType: PDF_STATUS' 'http://localhost:3000/api/tii_hook'

```

- Response Body
```
success: Accept the TurnItIn EULA
```
106 changes: 105 additions & 1 deletion src/content/docs/backend/API/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,108 @@ This "tutorials" API has the following operations.
- **POST** /api/tutorials


## Detail of Operations related to users.
## Detail of Operations related to users.

### DELETE: Delete a tutorial
DELETE /api/tutorials/{id}

- URL: `/api/tutorials/{id}`
- Method: `DELETE`
- Parameters:
| Parameter | Description |Parameter Type| Data Type|Mandatory|
|---------------------|-----------------|------------|------------|---|
|id | | path | integer|Yes|
|Username | User username | header | string |Yes|
|Auth_Token | Authentication token | header | string |Yes|


- Response:
`204 OK`: Tutorial deleted successfully.

- Example Request:
```bash
curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/api/campuses/6'
```
- Response body:
```
true
```
-----------------------------------------------------------------------------
### PUT: Create a tutorial
PUT /api/tutorials/{id}

- URL: `/api/tutorials/{id}`
- Method: `PUT`
- Parameters:
| Parameter | Description |Parameter Type| Data Type|Mandatory|
|---------------------|-----------------|------------|------------|---|
| tutorial [unit_id] | Id of the unit| formData | integer|Yes|
| tutorial [tutor_id] | Id of the tutor| formData | integer||
| tutorial [campus_id] | Id of the campus| formData | integer||
| tutorial [capacity] | Capacity of the tutorial| formData | integer||
|tutorial[abbreviation] | The tutorials code| formData | string||
|tutorial[meeting_location] |The tutorials location | formData | string||
|tutorial[meeting_day] |Day of the tutorials | formData | string||
|tutorial[meeting_time] |Time of the tutorials | formData | string||
|Username | User username | header | string |Yes|
|Auth_Token | Authentication token | header | string |Yes|


- Response:
`200 OK`

- Example Request:
```bash
curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 3DLo9xQoiKbXb7-ViNzJ' -d 'tutorial%5Btutor_id%5D=43&tutorial%5Bcapacity%5D=45' 'http://localhost:3000/api/tutorials/1'
```
- Response body:
```json
{
"id": 1,
"meeting_day": "Wednesday",
"meeting_time": "15:00",
"meeting_location": "geelong",
"abbreviation": "LA1-01",
"campus_id": 2,
"capacity": 45,
"tutorial_stream_abbr": "wrkshop-2",
"num_students": 6,
"tutor_id": 2
}
```


-----------------------------------------------------------------------------

### POST: Create a tutorial
POST /api/tutorials

- URL: `/api/tutorials`
- Method: `POST`
- Parameters:
| Parameter | Description |Parameter Type| Data Type|Mandatory|
|---------------------|-----------------|------------|------------|---|
| tutorial [unit_id] | Id of the unit| formData | integer|Yes|
| tutorial [tutor_id] | Id of the tutor| formData | integer|Yes|
| tutorial [campus_id] | Id of the campus| formData | integer||
| tutorial [capacity] | Capacity of the tutorial| formData | integer|Yes|
|tutorial[abbreviation] | The tutorials code| formData | string|Yes|
|tutorial[meeting_location] |The tutorials location | formData | string|Yes|
|tutorial[meeting_day] |Day of the tutorials | formData | string|Yes|
|tutorial[meeting_time] |Time of the tutorials | formData | string|Yes|
|tutorial[tutorial_stream_abbr] |Abbreviation of the associated tutorial stream | formData | string| |
|Username | User username | header | string |Yes|
|Auth_Token | Authentication token | header | string |Yes|


- Response:
`201 Created`

- Example Request:
```bash
curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 3DLo9xQoiKbXb7-ViNzJ' -d 'tutorial%5Bunit_id%5D=1&tutorial%5Btutor_id%5D=43&tutorial%5Bcapacity%5D=45&tutorial%5Babbreviation%5D=tut_test2&tutorial%5Bmeeting_location%5D=online&tutorial%5Bmeeting_day%5D=Tue&tutorial%5Bmeeting_time%5D=11%3A00' 'http://localhost:3000/api/tutorials'
```
- Response body:
```
null
```
Loading

0 comments on commit 7222427

Please sign in to comment.