Skip to content

Commit 938c669

Browse files
committed
docs: Expand API documentation with more endpoints
1 parent ae3ca19 commit 938c669

File tree

1 file changed

+349
-0
lines changed

1 file changed

+349
-0
lines changed

api_docs.py

Lines changed: 349 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,352 @@ def post(self):
157157
"""
158158
pass
159159

160+
@bot_ns.route('/get_chatbots')
161+
class GetChatbots(Resource):
162+
@bot_ns.doc('get_chatbots', security='Bearer')
163+
@bot_ns.param('userId', 'User ID', required=True)
164+
@bot_ns.marshal_with(success_response_model, code=200)
165+
@bot_ns.marshal_with(error_response_model, code=400)
166+
def get(self):
167+
"""
168+
Get all chatbots for a user
169+
170+
Requires JWT authentication
171+
"""
172+
pass
173+
174+
@bot_ns.route('/get_chatbot_data')
175+
class GetChatbotData(Resource):
176+
@bot_ns.doc('get_chatbot_data', security='Bearer')
177+
@bot_ns.param('botId', 'Bot ID', required=True)
178+
@bot_ns.param('userId', 'User ID', required=True)
179+
@bot_ns.marshal_with(success_response_model, code=200)
180+
@bot_ns.marshal_with(error_response_model, code=400)
181+
def get(self):
182+
"""
183+
Get detailed data for a specific chatbot
184+
185+
Requires JWT authentication
186+
"""
187+
pass
188+
189+
@bot_ns.route('/del_bot')
190+
class DeleteBot(Resource):
191+
@bot_ns.doc('del_bot', security='Bearer')
192+
@bot_ns.expect(api.model('DeleteBot', {
193+
'botId': fields.Integer(required=True, description='Bot ID to delete')
194+
}))
195+
@bot_ns.marshal_with(success_response_model, code=200)
196+
@bot_ns.marshal_with(error_response_model, code=400)
197+
def post(self):
198+
"""
199+
Delete a chatbot
200+
201+
Requires JWT authentication
202+
"""
203+
pass
204+
205+
@bot_ns.route('/update_chatbot')
206+
class UpdateChatbot(Resource):
207+
@bot_ns.doc('update_chatbot', security='Bearer')
208+
@bot_ns.expect(create_bot_model)
209+
@bot_ns.marshal_with(success_response_model, code=200)
210+
@bot_ns.marshal_with(error_response_model, code=400)
211+
def post(self):
212+
"""
213+
Update chatbot settings
214+
215+
Requires JWT authentication
216+
"""
217+
pass
218+
219+
@bot_ns.route('/del_messages')
220+
class DeleteMessages(Resource):
221+
@bot_ns.doc('del_messages', security='Bearer')
222+
@bot_ns.expect(api.model('DeleteMessages', {
223+
'sessionId': fields.String(required=True, description='Session ID')
224+
}))
225+
@bot_ns.marshal_with(success_response_model, code=200)
226+
def post(self):
227+
"""
228+
Delete conversation messages for a session
229+
230+
Requires JWT authentication
231+
"""
232+
pass
233+
234+
# Auth namespace endpoints - additional
235+
@auth_ns.route('/get_user')
236+
class GetUser(Resource):
237+
@auth_ns.doc('get_user', security='Bearer')
238+
@auth_ns.expect(api.model('GetUser', {
239+
'userID': fields.Integer(required=True, description='User ID')
240+
}))
241+
@auth_ns.marshal_with(success_response_model, code=200)
242+
@auth_ns.marshal_with(error_response_model, code=404)
243+
def post(self):
244+
"""
245+
Get user information
246+
247+
Requires JWT authentication
248+
"""
249+
pass
250+
251+
@auth_ns.route('/update_user')
252+
class UpdateUser(Resource):
253+
@auth_ns.doc('update_user', security='Bearer')
254+
@auth_ns.expect(register_model)
255+
@auth_ns.marshal_with(success_response_model, code=200)
256+
@auth_ns.marshal_with(error_response_model, code=400)
257+
def post(self):
258+
"""
259+
Update user information
260+
261+
Requires JWT authentication
262+
"""
263+
pass
264+
265+
@auth_ns.route('/forgot_password')
266+
class ForgotPassword(Resource):
267+
@auth_ns.doc('forgot_password')
268+
@auth_ns.expect(api.model('ForgotPassword', {
269+
'email': fields.String(required=True, description='User email')
270+
}))
271+
@auth_ns.marshal_with(success_response_model, code=200)
272+
@auth_ns.marshal_with(error_response_model, code=404)
273+
def post(self):
274+
"""
275+
Request password reset
276+
277+
Sends password reset email to user
278+
"""
279+
pass
280+
281+
@auth_ns.route('/reset_with_token')
282+
class ResetPassword(Resource):
283+
@auth_ns.doc('reset_password')
284+
@auth_ns.expect(api.model('ResetPassword', {
285+
'token': fields.String(required=True, description='Reset token'),
286+
'password': fields.String(required=True, description='New password')
287+
}))
288+
@auth_ns.marshal_with(success_response_model, code=201)
289+
@auth_ns.marshal_with(error_response_model, code=400)
290+
def post(self):
291+
"""
292+
Reset password with token
293+
294+
Resets user password using verification token
295+
"""
296+
pass
297+
298+
# Knowledge namespace endpoints
299+
upload_document_model = api.model('UploadDocument', {
300+
'name': fields.String(required=True, description='Knowledge base name'),
301+
'userID': fields.Integer(required=True, description='User ID'),
302+
'files': fields.List(fields.Raw, description='Document files'),
303+
'qa': fields.String(description='Q&A JSON'),
304+
'docs': fields.String(description='Docs JSON'),
305+
'urls': fields.String(description='URLs JSON')
306+
})
307+
308+
@knowledge_ns.route('/upload_document')
309+
class UploadDocument(Resource):
310+
@knowledge_ns.doc('upload_document', security='Bearer')
311+
@knowledge_ns.expect(upload_document_model)
312+
@knowledge_ns.marshal_with(success_response_model, code=201)
313+
@knowledge_ns.marshal_with(error_response_model, code=400)
314+
def post(self):
315+
"""
316+
Upload documents to knowledge base
317+
318+
Supports multiple file types (PDF, DOCX, TXT, etc.)
319+
Requires JWT authentication
320+
"""
321+
pass
322+
323+
@knowledge_ns.route('/get_knowledge_bases')
324+
class GetKnowledgeBases(Resource):
325+
@knowledge_ns.doc('get_knowledge_bases', security='Bearer')
326+
@knowledge_ns.param('userId', 'User ID', required=True)
327+
@knowledge_ns.marshal_with(success_response_model, code=200)
328+
@knowledge_ns.marshal_with(error_response_model, code=400)
329+
def get(self):
330+
"""
331+
Get all knowledge bases for a user
332+
333+
Requires JWT authentication
334+
"""
335+
pass
336+
337+
@knowledge_ns.route('/get_knowledge_base')
338+
class GetKnowledgeBase(Resource):
339+
@knowledge_ns.doc('get_knowledge_base', security='Bearer')
340+
@knowledge_ns.param('baseId', 'Knowledge base ID', required=True)
341+
@knowledge_ns.marshal_with(success_response_model, code=200)
342+
@knowledge_ns.marshal_with(error_response_model, code=404)
343+
def get(self):
344+
"""
345+
Get detailed knowledge base information
346+
347+
Includes documents, websites, and texts
348+
Requires JWT authentication
349+
"""
350+
pass
351+
352+
@knowledge_ns.route('/del_knowledgebase')
353+
class DeleteKnowledgeBase(Resource):
354+
@knowledge_ns.doc('del_knowledgebase', security='Bearer')
355+
@knowledge_ns.expect(api.model('DeleteKB', {
356+
'baseId': fields.Integer(required=True, description='Knowledge base ID')
357+
}))
358+
@knowledge_ns.marshal_with(success_response_model, code=200)
359+
def post(self):
360+
"""
361+
Delete a knowledge base
362+
363+
Requires JWT authentication
364+
"""
365+
pass
366+
367+
# Ticket namespace endpoints
368+
book_ticket_model = api.model('BookTicket', {
369+
'botId': fields.Integer(required=True, description='Bot ID'),
370+
'userIndex': fields.String(required=True, description='User index'),
371+
'sessionId': fields.String(required=True, description='Session ID'),
372+
'email': fields.String(required=True, description='Email address'),
373+
'content': fields.String(required=True, description='Ticket content'),
374+
'website': fields.String(required=True, description='Website URL'),
375+
'createdAt': fields.String(required=True, description='Creation timestamp')
376+
})
377+
378+
@ticket_ns.route('/book')
379+
class BookTicket(Resource):
380+
@ticket_ns.doc('book_ticket')
381+
@ticket_ns.expect(book_ticket_model)
382+
@ticket_ns.marshal_with(success_response_model, code=201)
383+
@ticket_ns.marshal_with(error_response_model, code=500)
384+
def post(self):
385+
"""
386+
Create a support ticket
387+
388+
Books a ticket and sends email notification
389+
"""
390+
pass
391+
392+
@ticket_ns.route('/get_tickets')
393+
class GetTickets(Resource):
394+
@ticket_ns.doc('get_tickets', security='Bearer')
395+
@ticket_ns.expect(api.model('GetTickets', {
396+
'userID': fields.Integer(required=True, description='User ID')
397+
}))
398+
@ticket_ns.marshal_with(success_response_model, code=200)
399+
def post(self):
400+
"""
401+
Get all tickets for a user
402+
403+
Requires JWT authentication
404+
"""
405+
pass
406+
407+
# Chat log namespace endpoints
408+
@chat_ns.route('/get_chat')
409+
class GetChat(Resource):
410+
@chat_ns.doc('get_chat', security='Bearer')
411+
@chat_ns.expect(api.model('GetChat', {
412+
'userID': fields.Integer(required=True, description='User ID')
413+
}))
414+
@chat_ns.marshal_with(success_response_model, code=200)
415+
def post(self):
416+
"""
417+
Get chat logs for a user
418+
419+
Requires JWT authentication
420+
"""
421+
pass
422+
423+
@chat_ns.route('/get_log_data')
424+
class GetLogData(Resource):
425+
@chat_ns.doc('get_log_data', security='Bearer')
426+
@chat_ns.expect(api.model('GetLogData', {
427+
'sessionId': fields.String(required=True, description='Session ID')
428+
}))
429+
@chat_ns.marshal_with(success_response_model, code=200)
430+
def post(self):
431+
"""
432+
Get detailed conversation log for a session
433+
434+
Requires JWT authentication
435+
"""
436+
pass
437+
438+
# Payment namespace endpoints
439+
checkout_session_model = api.model('CheckoutSession', {
440+
'price_id': fields.String(required=True, description='Stripe price ID'),
441+
'email': fields.String(required=True, description='Customer email')
442+
})
443+
444+
@payment_ns.route('/create-checkout-session')
445+
class CreateCheckoutSession(Resource):
446+
@payment_ns.doc('create_checkout')
447+
@payment_ns.expect(checkout_session_model)
448+
@payment_ns.marshal_with(success_response_model, code=200)
449+
@payment_ns.marshal_with(error_response_model, code=400)
450+
def post(self):
451+
"""
452+
Create Stripe checkout session
453+
454+
Returns Stripe checkout session URL
455+
"""
456+
pass
457+
458+
@payment_ns.route('/webhook')
459+
class PaymentWebhook(Resource):
460+
@payment_ns.doc('payment_webhook')
461+
def post(self):
462+
"""
463+
Stripe webhook endpoint
464+
465+
Handles Stripe payment events
466+
"""
467+
pass
468+
469+
# Shopify namespace endpoints
470+
@shopify_ns.route('/shopifyinstall')
471+
class ShopifyInstall(Resource):
472+
@shopify_ns.doc('shopify_install')
473+
@shopify_ns.param('shop', 'Shop domain', required=True)
474+
@shopify_ns.param('hmac', 'HMAC signature', required=True)
475+
@shopify_ns.param('timestamp', 'Timestamp', required=True)
476+
def get(self):
477+
"""
478+
Shopify app installation endpoint
479+
480+
Initiates OAuth flow for Shopify app
481+
"""
482+
pass
483+
484+
@shopify_ns.route('/active_chatbots')
485+
class ActiveChatbots(Resource):
486+
@shopify_ns.doc('active_chatbots')
487+
@shopify_ns.param('shop', 'Shop domain', required=True)
488+
@shopify_ns.marshal_with(success_response_model, code=200)
489+
def get(self):
490+
"""
491+
Get active chatbots for a Shopify store
492+
"""
493+
pass
494+
495+
# WordPress namespace endpoints
496+
@wordpress_ns.route('/wordpressinstall')
497+
class WordPressInstall(Resource):
498+
@wordpress_ns.doc('wordpress_install')
499+
@wordpress_ns.param('website_url', 'WordPress website URL', required=True)
500+
@wordpress_ns.param('access_token', 'Access token', required=True)
501+
def get(self):
502+
"""
503+
WordPress plugin installation endpoint
504+
505+
Initiates connection with WordPress site
506+
"""
507+
pass
508+

0 commit comments

Comments
 (0)