---
# System prepended metadata

title: NUS Wishboard API

---

# NUS Wishboard API

## Router group `/api/v1`
|**Method**|**Endpoint**|**Auth**|**Description**|
|:--------:|:----------:|:------:|:-------------:|
|GET       |/           |No      |Landing Page, alraedy showing the dashboard|

<details>
<summary>Request</summary>
    
```jsonld=
{}
```
    
</details>

<details>
<summary>Response</summary>

```jsonld=
{
    cards: [
        {
            id: number,
            idea: string,
            owner: string, // email, null if ownership expired
            description: string,
            tags: [string],
            comments: [WIP],
            
            created_at: string,
            updated_at: string
        }
    ]
}
```

</details>

|**Method**|**Endpoint**|**Auth**|**Description**|
|:--------:|:----------:|:------:|:-------------:|
|POST|/login|NA|Login endpoint for jwt token|

<details>
<summary>Request</summary>
    
```jsonld=
{
    // WIP
}
```
    
</details>

<details>
<summary>Response</summary>

```jsonld=
{
    token: string
}
```

</details>

## Router Group `/api/v1/idea`
> Unauthorized request -> 401 Unauthorized

|**Method**|**Endpoint**|**Auth**|**Description**|
|:--------:|:----------:|:------:|:-------------:|
|POST|/|Yes|Create idea for project|

<details>
<summary>Request</summary>
    
```jsonld=
{
    idea: string,
    description: string,
    tags: [string]
}
```
    
</details>

<details>
<summary>Response</summary>

```jsonld=
{
    id: number,
    success: boolean
}
```

</details>

|**Method**|**Endpoint**|**Auth**|**Description**|
|:--------:|:----------:|:------:|:-------------:|
|GET|/:id|Yes|View idea for project (owner view)|

<details>
<summary>Request</summary>
    
```jsonld=
{}
```
    
</details>

<details>
<summary>Response</summary>

```jsonld=
{
    id: number,
    idea: string,
    owner: string, // email, null if ownership expired
    description: string,
    comments: [WIP],
    tags: [string],
    
    created_at: string,
    updated_at: string
}
```

</details>

|**Method**|**Endpoint**|**Auth**|**Description**|
|:--------:|:----------:|:------:|:-------------:|
|PUT|/:id|Yes|Edit idea for project|

<details>
<summary>Request</summary>
    
```jsonld=
{
    idea: string,
    owner: string, // email, null if ownership expired
    description: string
}
```
    
</details>

<details>
<summary>Response</summary>

```jsonld=
{
    id: number,
    idea: string,
    owner: string, // email, null if ownership 
    comments: [WIP],
    tags: [string],
    
    created_at: string,
    updated_at: string
}
```

</details>

|**Method**|**Endpoint**|**Auth**|**Description**|
|:--------:|:----------:|:------:|:-------------:|
|DELETE|/:id|Yes|Delete idea for project (Might need admin permission)|

<details>
<summary>Request</summary>
    
```jsonld=
{}
```
    
</details>

<details>
<summary>Response</summary>

```jsonld=
{
    id: number,
    success: boolean
}
```

</details>