Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user/jobs docs page #5

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pages/endpoints/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"hello": "GET/user/hello",
"full": "GET/user/full",
"links": "GET/user/links",
"jobs": "GET/user/jobs",
"projects": "GET/user/projects"
}
93 changes: 93 additions & 0 deletions pages/endpoints/jobs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import Meta from '../../components/Meta'

<Meta />

# `GET/user/jobs`

Returns all the user's jobs

## Basic Information
- type: `REST`
- method: `GET`
- url: https://www.api.remoet.dev/user/jobs
- returns: `JSON`

## cURL
```bash
curl --location 'https://www.api.remoet.dev/user/jobs' --header 'Authorization: Bearer <Your key>'
```

## HTTP
```http
GET /user/jobs HTTP/1.1
Host: www.api.remoet.dev
Authorization: Bearer <Your key>
```

## Javascript Fetch
```javascript
const myHeaders = new Headers();
myHeaders.append("Authorization", `Bearer ${key}`);

const requestOptions = {
method: "GET",
headers: myHeaders,
};

fetch("https://www.api.remoet.dev/user/jobs", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
```

## DTO
```typescript
// Note that the return type is an array of PublicUserJobDto
class PublicUserJobDto {
createdAt: Date;
updatedAt: Date;
userId: string;
title: string;
startDate: Date;
endDate: Date;
isCurrent: boolean;
isPublic: boolean;
companyName: string;
technologies: string[];
description: string;
isRemote: boolean;
companyUrl: string;
companyId: string;
}
```

## Response
```json
[
{
"createdAt": <Date>,
"updatedAt": <Date>,
"userId": <string>,
"title": <string>,
"startDate": <Date>,
"endDate": <Date>,
"isCurrent": <boolean>,
"isPublic": <boolean>,
"companyName": <string>,
"technologies": [<string>],
"description": <string>,
"isRemote": <boolean>,
"companyUrl": <string>,
"companyId": <string>
}
]
```

## Non authenticated response
```json
{
"statusCode": 401,
"message": "Invalid API Key",
"error": "Unauthorized"
}
```
2 changes: 1 addition & 1 deletion pages/endpoints/projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fetch("https://www.api.remoet.dev/user/projects", requestOptions)

## DTO
```typescript
export class PublicUserProjectDto {
class PublicUserProjectDto {
title: string;
shortDescription: string;
technologies: string[];
Expand Down