-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_config.yml
146 lines (138 loc) · 3.92 KB
/
api_config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
swagger: "2.0"
info:
description: This is the swagger file that goes with our server code
version: "1.1.0"
title: Leaf REST API
consumes:
- application/json
produces:
- application/json
basePath: /api
# Paths supported by the server application
paths:
/authorize/{provider}:
get:
operationId: provider.oauth_authorize
tags:
- Provider OAuth
summary: Authorize and receive temp access token
description: Authorize and receive temp access token
parameters:
- name: provider
in: path
description: provider name
type: string
required: True
responses:
302:
description: Successfully redirected user to authorize the provider
/callback/{provider}:
get:
operationId: provider.oauth_callback
tags:
- Provider OAuth
summary: Exchange temp access for perm access token
description: Exchange temp access for perm access token
parameters:
- name: provider
in: path
description: provider name
type: string
required: True
responses:
302:
description: Successfully redirected user upon successful authorization
/users:
post:
operationId: users.authenticate_user
tags:
- Users
summary: Create a new user in our database
description: Create a new user in our database
parameters:
- name: user_data
in: body
description: user data
required: True
schema:
type: object
properties:
id:
type: string
description: last name of the user
data:
type: object
description: last name of the user
properties:
firstName:
type: string
description: first name of the user
lastName:
type: string
description: last name of the user
imgUrl:
type: string
description: last name of the user
responses:
201:
description: Successfully created a new user
schema:
type: array
items:
properties:
fname:
type: string
lname:
type: string
/users/{user_id}:
get:
operationId: users.get_by_id
tags:
- Users
summary: Read the entire list of books
description: Read the list of books
parameters:
- name: user_id
in: path
description: id of the user that needs to be retrieved
type: string
required: True
responses:
200:
description: Successfully retrieve this user's data
schema:
type: array
items:
properties:
username:
type: string
fname:
type: string
number_of_read_items:
type: number
/users/{user_id}/reading-library:
get:
operationId: users.get_reading_library
tags:
- Users
summary: Read the entire reading library of this user
description: Read the list of reading library items
parameters:
- name: user_id
in: path
description: id of the user that needs to be retrieved
type: string
required: True
responses:
200:
description: Successfully retrieve list of books for this user
schema:
type: array
items:
properties:
isbn:
type: string
author:
type: string
editions:
type: object