UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 9.34 kB
{"openapi":"3.0.0","info":{"title":"AltoroJ REST API","version":"1.0.2","x-apisguru-categories":["security"],"x-origin":[{"format":"swagger","url":"https://demo.testfire.net/swagger/properties.json","version":"2.0"}],"x-providerName":"testfire.net","x-serviceName":"altoroj"},"tags":[{"description":"Login mechanism","name":"1. Login"},{"description":"View account information","name":"2. Account"},{"description":"Transfer funds between accounts","name":"3. Transfer"},{"description":"Submit and review feedback","name":"4. Feedback"},{"description":"Add and change user details","name":"5. Admin"},{"description":"Logout mechanism","name":"6. Logout"}],"paths":{"/account":{"get":{"description":"Returns a list of all the accounts owned by the user","operationId":"getAccount","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation"},"401":{"description":"Unauthorized request"},"500":{"description":"Internal server error"}},"tags":["2. Account"]}},"/account/{accountNo}":{"get":{"description":"Returns details about a specific account","operationId":"getAccountBalance","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Account id","in":"path","name":"accountNo","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation"},"401":{"description":"Unauthorized request"},"500":{"description":"Internal server error"}},"tags":["2. Account"]}},"/account/{accountNo}/transactions":{"get":{"description":"Returns the last 10 transactions attached to an account","operationId":"showLastTenTransactions","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Account id","in":"path","name":"accountNo","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation"},"401":{"description":"Unauthorized request"},"500":{"description":"Internal server error"}},"tags":["2. Account"]},"post":{"description":"Return transactions between 2 specific dates","operationId":"getTransactions","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Account id","in":"path","name":"accountNo","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dates"}}},"description":"A start date and an end date","required":true},"responses":{"200":{"description":"Successful operation"},"400":{"description":"Bad parameters: Please check provided values"},"401":{"description":"Unauthorized request"},"501":{"description":"Internal server error"}},"tags":["2. Account"]}},"/admin/addUser":{"post":{"description":"Add new user","operationId":"addUser","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/newUser"}}},"description":"Details of a new user including first name, last name, desired username and a password","required":true},"responses":{"200":{"description":"Successful operation"},"400":{"description":"Unauthorized request"},"401":{"description":"Unauthorized request"},"500":{"description":"Error creating user"}},"tags":["5. Admin"]}},"/admin/changePassword":{"post":{"description":"Change user password","operationId":"changePassword","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/changePassword"}}},"description":"Information about the user password to be changed including id and new password","required":true},"responses":{"200":{"description":"Successful operation"},"400":{"description":"Unauthorized request"},"401":{"description":"Unauthorized request"},"500":{"description":"Error in changing the username password"}},"tags":["5. Admin"]}},"/feedback/submit":{"post":{"description":"Submit feedback for the bank","operationId":"sendFeedback","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/feedback"}}},"description":"Feedback details including name, email the subject and complete message","required":true},"responses":{"200":{"description":"Successful operation"},"401":{"description":"Unauthorized request"},"500":{"description":"Internal server error"}},"tags":["4. Feedback"]}},"/feedback/{feedbackId}":{"get":{"description":"Retrieve feedback","operationId":"getFeedback","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"in":"path","name":"feedbackId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation"},"400":{"description":"Bad parameters: Please check provided values"},"401":{"description":"Unauthorized request"},"500":{"description":"Internal server error"}},"tags":["4. Feedback"]}},"/login":{"get":{"description":"If a user is loggedin the username will be returned","operationId":"checkLogin","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Logged in"},"401":{"description":"Logged out"}},"summary":"Check if any user is logged in","tags":["1. Login"]},"post":{"description":"After a successful login a token is returned. This is a Bearer token. To authenticate with it use the Authorization header and set value to Bearer empty space and the token value.","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/login"}}},"description":"Username and password combination to allow users to log-in","required":true},"responses":{"200":{"description":"Success message when login is complete"},"400":{"description":"Bad parameters: Please check provided values"},"500":{"description":"Internal server error: Please see error message or logs for details"}},"summary":"Login method","tags":["1. Login"]}},"/logout":{"get":{"description":"Logout from the bank","operationId":"doLogOut","responses":{"200":{"description":"Successful operation"},"500":{"description":"Unauthorized request "}},"tags":["6. Logout"]}},"/transfer":{"post":{"description":"Transfer money between two accounts","operationId":"trasnfer","parameters":[{"description":"Authorization token (provided upon successful login)","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/transfer"}}},"description":"Transfer details including ammount, sender and receiver","required":true},"responses":{"200":{"description":"Successful operation"},"400":{"description":"Bad parameters: Please check provided values"},"501":{"description":"Internal server error"}},"tags":["3. Transfer"]}}},"servers":[{"url":"/api"}],"components":{"schemas":{"changePassword":{"properties":{"password1":{"example":"Th1s!sz3nu3Passv0rd","format":"password","type":"string"},"password2":{"example":"Th1s!sz3nu3Passv0rd","format":"password","type":"string"},"username":{"example":"jdoe","type":"string"}},"required":["username","passwrod1","password2"],"type":"object"},"dates":{"properties":{"endDate":{"example":"2025-04-15T13:50:42.767Z","format":"date","type":"string"},"startDate":{"example":"2025-04-15T13:50:42.767Z","format":"date","type":"string"}},"required":["startDate","endDate"],"type":"object"},"feedback":{"properties":{"email":{"example":"jsmtih@altoromutual.com","format":"email","type":"string"},"message":{"example":"I like the new look of your applicaiton","type":"string"},"name":{"example":"J Smith","type":"string"},"subject":{"example":"Amazing web design","type":"string"}},"required":["name","email","subject","message"],"type":"object"},"login":{"properties":{"password":{"example":"demo1234","type":"string"},"username":{"example":"jsmith","type":"string"}},"required":["username","password"],"type":"object"},"newUser":{"properties":{"firstname":{"example":"Bilbo","type":"string"},"lastname":{"example":"Baggins","type":"string"},"password1":{"example":"S3l3ctS0methingStr0ng5AsP@ssword","format":"password","type":"string"},"password2":{"example":"S3l3ctS0methingStr0ng5AsP@ssword","format":"password","type":"string"},"username":{"example":"bilbob","type":"string","uniqueItems":true}},"required":["firstname","lastname","username","password1","password2"],"type":"object"},"transfer":{"properties":{"fromAccount":{"example":"800003","type":"string"},"toAccount":{"example":"800002","type":"string"},"transferAmount":{"example":"200","type":"string"}},"required":["toAccount","fromAccount","transferAmount"],"type":"object"}}}}