Skip to content

Commit

Permalink
[Chore #162888628] Deploy and and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mugoh committed Jan 1, 2019
1 parent c07565a commit 1dc1421
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
143 changes: 143 additions & 0 deletions apiary.apid
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
FORMAT: 1A
HOST: https://st9-api-heroku.herokuapp.com/


# BucketList

Bucketlist is an API allowing a user to register, login to create a bucket and
bucket items.

## User Registration [/auth/register]

### Register a user [POST]

You can create a user by sending a json request with an email and password. The
password must be four(4) characters and more.

+ Request (application/json)

{
"email": "example@gmail.com",
"password": "123456"
}

+ Response 201 (application/json)

{
"auth_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDM0ODQ5OTYsImlhdCI6MTUwMzM5ODU4Niwic3ViIjo1fQ.GC6IEOohdo_xrz9__UeugIlir0qtJdKbEzBtLgqjt5A",
"message": "Successfully registered",
"status": "success"
}

+ Response 202 (application/json)

{
"message": "Missing or wrong email format or password",
"status": "failed"
}

+ Response 202 (application/json)

{
"message": "Failed, User already exists, Please sign In",
"status": "failed"
}

+ Response 202 (application/json)

{
"message": "Content-type must be json",
"status": "failed"
}

## Login [/auth/login]

### Login a user [POST]
You can login a user by sending their email and password. Please take note
of the auth token for you will need it for all user requests.

+ Request (application/json)

{
"email": "example@gmail.com",
"password": "123456"
}

+ Response 201 (application/json)

{
"auth_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDM0ODQ5OTYsImlhdCI6MTUwMzM5ODU4Niwic3ViIjo1fQ.GC6IEOohdo_xrz9__UeugIlir0qtJdKbEzBtLgqjt5A",
"message": "Successfully registered",
"status": "success"
}

+ Response 202 (application/json)

{
"message": "Content-type must be json",
"status": "failed"
}

+ Response 401 (application/json)

{
"message": "Missing or wrong email format or password is less than four characters",
"status": "failed"
}

+ Response 401 (application/json)

{
"message": "User does not exist or password is incorrect",
"status": "failed"
}

## Logout [/auth/logout]

### Log out a user [POST]

You can log out a user by sending a request with their email and address. The
auth token will then be invalidated.

+ Request (application/json)

+ Headers

Authorization: Bearer JWT Token

+ Response 200 (application/json)

{
"message": "Successfully logged out",
"status": "success"
}

+ Response 403 (application/json)

{
"message": "Provide a valid auth token",
"status": "failed"
}

+ Response 403 (application/json)

{
"message": "Provide an authorization header",
"status": "failed"
}

+ Response 401 (application/json)

{
"message": "Signature expired, Please sign in again",
"status": "failed"
}

+ Response 401 (application/json)

{
"message": "Invalid token. Please sign in again",
"status": "failed"
}


1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ coveralls==1.5.1
docopt==0.6.2
Flask==1.0.2
Flask-JWT-Extended==3.14.0
gunicorn==19.9.0
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10
Expand Down

0 comments on commit 1dc1421

Please sign in to comment.