-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.json
265 lines (265 loc) · 8.44 KB
/
openapi.json
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
{
"openapi": "3.0.3",
"info": {
"title": "Mock Facebook API",
"description": "API for simulating Facebook-like interactions in PostSuite.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://fb.mock.postsuite.xyz",
"description": "Mock Facebook API server"
}
],
"paths": {
"/{page_id}/feed": {
"post": {
"summary": "Create a new post on the page's feed",
"description": "Add a post to the specified page's feed, including a message, link, image, and other details.",
"parameters": [
{
"name": "page_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the page to post to."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "example": "Exciting news! We are launching a new product next week. Stay tuned for updates!" },
"link": { "type": "string", "example": "https://www.samplebusiness.com/new-product" },
"picture": { "type": "string", "example": "https://www.samplebusiness.com/images/new-product.jpg" },
"name": { "type": "string", "example": "New Product Launch" },
"caption": { "type": "string", "example": "Check out our latest addition!" },
"description": { "type": "string", "example": "Discover the amazing features of our newest product, designed to make your life easier." },
"published": { "type": "boolean", "example": true }
},
"required": ["message"]
}
}
}
},
"responses": {
"200": {
"description": "Post created successfully",
"content": { "application/json": { "example": { "status": "success", "post_id": "12345" } } }
}
}
},
"get": {
"summary": "Retrieve posts from the page's feed",
"description": "Fetch all posts from the specified page's feed.",
"parameters": [
{
"name": "page_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the page to retrieve posts from."
}
],
"responses": {
"200": {
"description": "List of posts retrieved",
"content": {
"application/json": {
"example": [
{ "post_id": "12345", "message": "First post on this page!" },
{ "post_id": "12346", "message": "Exciting updates coming soon!" }
]
}
}
}
}
}
},
"/{post_id}": {
"delete": {
"summary": "Delete a post by ID",
"description": "Remove a post from the system by providing its unique post ID.",
"parameters": [
{
"name": "post_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the post to delete."
}
],
"responses": {
"200": {
"description": "Post deleted successfully",
"content": { "application/json": { "example": { "status": "deleted", "post_id": "12345" } } }
}
}
},
"post": {
"summary": "Update a post by ID",
"description": "Edit an existing post by providing its unique post ID and new message content.",
"parameters": [
{
"name": "post_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the post to update."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "example": "new post message" }
},
"required": ["message"]
}
}
}
},
"responses": {
"200": {
"description": "Post updated successfully",
"content": { "application/json": { "example": { "status": "updated", "post_id": "12345" } } }
}
}
}
},
"/{page_id}": {
"post": {
"summary": "Update page information",
"description": "Modify details about a page, such as the 'about' section.",
"parameters": [
{
"name": "page_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the page to update."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"about": { "type": "string", "example": "New about string" }
},
"required": ["about"]
}
}
}
},
"responses": {
"200": {
"description": "Page updated successfully",
"content": { "application/json": { "example": { "status": "updated", "page_id": "page123" } } }
}
}
},
"get": {
"summary": "Retrieve page details",
"description": "Get basic information about the page.",
"parameters": [
{
"name": "page_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the page to retrieve."
}
],
"responses": {
"200": {
"description": "Page details retrieved",
"content": {
"application/json": {
"example": { "page_id": "page123", "about": "Information about this page." }
}
}
}
}
}
},
"/{page_id}/settings": {
"get": {
"summary": "Retrieve page settings",
"description": "Fetch settings configuration for the specified page.",
"parameters": [
{
"name": "page_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the page to retrieve settings for."
}
],
"responses": {
"200": {
"description": "Page settings retrieved",
"content": { "application/json": { "example": { "settings": { "notifications": true, "privacy": "public" } } } }
}
}
}
},
"/{user_id}/accounts": {
"get": {
"summary": "Retrieve user accounts",
"description": "Get a list of pages or accounts that belong to the specified user.",
"parameters": [
{
"name": "user_id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "The ID of the user to retrieve accounts for."
}
],
"responses": {
"200": {
"description": "User accounts retrieved",
"content": {
"application/json": {
"example": [
{ "account_id": "page123", "name": "Sample Page" },
{ "account_id": "page456", "name": "Another Page" }
]
}
}
}
}
}
},
"/oauth": {
"get": {
"summary": "Initiate OAuth authentication",
"description": "Start the OAuth authentication process for the user.",
"parameters": [
{
"name": "state",
"in": "query",
"required": true,
"schema": { "type": "string" },
"description": "Unique identifier for the OAuth state."
}
],
"responses": {
"200": {
"description": "OAuth initiated",
"content": { "application/json": { "example": { "status": "oauth_started", "redirect_uri": "https://fb.mock.postsuite.xyz/oauth/callback" } } }
}
}
}
}
}
}