API

This page will show what each fun

Get Users

GET https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/users

This endpoint allows you to get free cakes.

{response: [username1, username2, ...]}

Post Users

POST https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/users

This method will create a user given the correct headers

Headers

Name
Type
Description

Name

string

Name that will be displayed for the user

Username

string

Username that will be used for sending and logging in

Password

string

Password for the account

{response: ref}

Get User

GET https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/users/:id

Get a certain user given an id

Path Parameters

Name
Type
Description

id

string

the username of the account

Headers

Name
Type
Description

token

string

token for the user associated with the account

{response: [{username: result[0]["username"], name: result[0]["name"]}]}

Get posts

GET https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/posts

This will return the posts for the username given

Headers

Name
Type
Description

Username

string

Username for the account

Token

string

User token created during login

{result: [post1, post2, ..., postN]}

Post post

POST https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/posts

Use this method to create a post

Headers

Name
Type
Description

Message

string

Message for the image

Token

string

User token

Username

string

User that this is being posted by

Request Body

Name
Type
Description

content

string

a base64 encoded image that gets put into the database

{ref}

Put Send

PUT https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/send

Use this method to send the post that was just created

Headers

Name
Type
Description

id

string

Id of post being sent

newUser

string

Id of user being sent to

Token

string

user token

currentUser

string

username of the user that the post is being sent from

{error: "SENT"}

Put Login

PUT https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/login

Use this method to login and create a session token

Headers

Name
Type
Description

Password

string

md5 hashed password of user logging in

Username

string

Username of user logging in

{token: sessionToken}

Put Logout

PUT https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/logout

Logs the user out by invalidating user token

Headers

Name
Type
Description

Username

string

Username of user being logged out

Token

string

User Token of user being logged out

{response: "loggedOut"}

get Post

GET https://ec2-18-217-231-79.us-east-2.compute.amazonaws.com/posts/:id

Path Parameters

Name
Type
Description

id

string

ID of the post

Headers

Name
Type
Description

Username

string

Token

string

{result: postData}

Last updated

Was this helpful?