-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
1 lines (1 loc) · 10.6 KB
/
openapi.json
File metadata and controls
1 lines (1 loc) · 10.6 KB
1
{"openapi":"3.1.0","info":{"title":"Aptos PDF Storage API","description":"API for storing PDF files on IPFS and their metadata on Aptos blockchain","version":"0.1.0"},"paths":{"/auth/signup":{"post":{"tags":["authentication"],"summary":"Signup","description":"Create a new user with an Aptos account funded with 10 million octas.","operationId":"signup_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["authentication"],"summary":"Login For Access Token","description":"OAuth2 compatible token login, get an access token for future requests.","operationId":"login_for_access_token_auth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_for_access_token_auth_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["authentication"],"summary":"Reset Password","description":"Reset user password.","operationId":"reset_password_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResetPassword"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/auth/logout":{"post":{"tags":["authentication"],"summary":"Logout","description":"Logout endpoint (client-side only, JWT cannot be invalidated on server).","operationId":"logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/documents/upload":{"post":{"tags":["documents"],"summary":"Upload Document","description":"Upload a PDF document, store it in IPFS, extract data, and store on Aptos blockchain.","operationId":"upload_document_documents_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_documents_upload_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/documents/my-documents":{"get":{"tags":["documents"],"summary":"Get My Documents","description":"Retrieve all documents uploaded by the current user.","operationId":"get_my_documents_documents_my_documents_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentResponse"},"title":"Response Get My Documents Documents My Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/documents/{document_id}":{"get":{"tags":["documents"],"summary":"Get Document By Id","description":"Retrieve a document by ID.","operationId":"get_document_by_id_documents_documents__document_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/search":{"post":{"tags":["documents"],"summary":"Search Documents","description":"Search for documents by transaction hash or Aptos address.","operationId":"search_documents_documents_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSearch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"type":"array","title":"Response Search Documents Documents Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/documents/ipfs/{ipfs_hash}":{"get":{"tags":["documents"],"summary":"Get Ipfs Content","description":"Retrieve content from IPFS by hash.","operationId":"get_ipfs_content_documents_ipfs__ipfs_hash__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"ipfs_hash","in":"path","required":true,"schema":{"type":"string","title":"Ipfs Hash"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/blockchain/resources":{"get":{"tags":["blockchain"],"summary":"Get Blockchain Resources","description":"Get resources associated with the user's Aptos account.","operationId":"get_blockchain_resources_blockchain_resources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response Get Blockchain Resources Blockchain Resources Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/blockchain/transactions":{"get":{"tags":["blockchain"],"summary":"Get Transactions","description":"Get transactions associated with the user's Aptos account.","operationId":"get_transactions_blockchain_transactions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response Get Transactions Blockchain Transactions Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/":{"get":{"summary":"Root","description":"Root endpoint for the API.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Body_login_for_access_token_auth_login_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"password"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_for_access_token_auth_login_post"},"Body_upload_document_documents_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_document_documents_upload_post"},"DocumentResponse":{"properties":{"filename":{"type":"string","title":"Filename"},"id":{"type":"integer","title":"Id"},"ipfs_hash":{"type":"string","title":"Ipfs Hash"},"transaction_hash":{"type":"string","title":"Transaction Hash"},"aptos_address":{"type":"string","title":"Aptos Address"},"extracted_data":{"type":"object","title":"Extracted Data"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["filename","id","ipfs_hash","transaction_hash","aptos_address","extracted_data","created_at"],"title":"DocumentResponse"},"DocumentSearch":{"properties":{"transaction_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Hash"},"aptos_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aptos Address"}},"type":"object","title":"DocumentSearch"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"Token"},"UserCreate":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","email","password"],"title":"UserCreate"},"UserResetPassword":{"properties":{"username":{"type":"string","title":"Username"},"old_password":{"type":"string","title":"Old Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["username","old_password","new_password"],"title":"UserResetPassword"},"UserResponse":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"id":{"type":"integer","title":"Id"},"aptos_address":{"type":"string","title":"Aptos Address"},"is_active":{"type":"boolean","title":"Is Active"},"is_admin":{"type":"boolean","title":"Is Admin"}},"type":"object","required":["username","email","id","aptos_address","is_active","is_admin"],"title":"UserResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}}}