Skip to content

Latest commit

 

History

History
400 lines (356 loc) · 19.5 KB

endpoints.md

File metadata and controls

400 lines (356 loc) · 19.5 KB

OverView

Preview

Number Title Description
1 User contains all methods related to User
1.1 Create Account Creates new account
1.2 Edit Wallet Updates new information about the Wallet
1.3 Edit Password Updates user's password
2 Verify contains all method related to user Validation
2.1 Log In If credentials are correct returns token
2.2 Validate Token Checks if token is valid
2.3 Verify Admin Verifies if token is from Admin account
2.4 Verify Manager Verifies if token is from Manager account
3 WhiteList contains all method related to user WhiteList
3.1 List Lists all Domains in Whitelist
3.2 Create Rule Adds a certain domain to the Whitelist
3.3 Edit Rule Edits a certain domain to the Whitelist
3.4 Delete Rule Delete a certain domain to the Whitelist
4 Manager contains all method related to Manager
4.1 Create Creates a new Manager in a certain group
4.2 Delete deletes a Manager from a certain group
4.3 List Lists all Managers
4.4 Change State Activates or Deactivates Manager from certain group
5 Events contains all method related to Events
5.1 Create Creates new event
5.2 List Lists all events
5.3 Follow Follows event
5.4 Unfollow Unfollows event
5.5 Saved List Participants saved event
5.6 Search Given a string returns events that match
5.7 Edit Updates event info
5.8 Delete Deletes event
5.9 Change State Activates or Deactivates event
6 Poap contains all method related to Poap
6.1 Create Creates new Poap
6.2 List Lists all Poap
6.3 Get by ID returns poap by id
6.4 Redeem redeems poap

Premission

Number Title Admin Manager Participant
1 User
1.1 Create Account NO NO YES
1.2 Edit Wallet NO NO YES
1.3 Edit Password NO NO YES
2 Verify
2.1 Log In YES YES YES
2.2 Validate Token YES YES YES
2.3 Verify Admin YES YES YES
2.4 Verify Manager YES YES YES
3 WhiteList
3.1 List YES NO NO
3.2 Create Rule YES NO NO
4 Manager
4.1 Create Manager YES NO NO
4.2 Delete Manager YES NO NO
4.3 List Manager YES NO NO
4.4 Activate Manager YES NO NO
4.5 Deactivate Manager YES NO NO
5 Events
5.1 Create YES YES NO
5.2 List YES YES YES
5.3 Follow NO NO YES
5.3 Unfollow NO NO YES
5.5 Saved NO NO YES
5.6 Search YES YES YES
5.7 Edit YES YES NO
5.8 Delete YES YES NO
5.9 Activate YES YES NO
5.10 Deactivate YES YES NO
6 Poap
6.1 Create YES YES NO
6.2 List YES YES YES
6.3 Get by ID NO NO YES
6.4 Redeem NO NO YES

EndPoints

1 - User

1.1 Create Account

Método POST
Rota /users/
Body creatUser{email,password,confirm_password,metamask_account}
Headers ---
Responses 201 - Success
400 - Syntax
500 - Internal Server Error
Account created
Wrong Syntax
Server Error

1.2 Edit Wallet

Método PUT
Rota /users/editWallet
Body editWallet {email,metamask_account}
Headers token
Responses 201 - Success
400 - Syntax
500 - Internal Server Error
Wallet Updated
Wrong Syntax
Server Error

1.3 Edit Password

Método PUT
Rota /users/editPassword
Body verifyManager {email,old,new,confirm_new}
Headers token
Responses 201 - Success
202 - Wrong Password
203 - New Password
400 - Syntax
500 - Internal Server Error
Password updated
Wrong Password
Password and Confirm Password different
Wrong Syntax
Server Error

2 - Verify

2.1 Log In

Método GET
Rota /verify/login
Body login {email,password}
Headers
Responses 200 - Success
400 - Syntax
500 - Internal Server Error
token
Wrong Syntax
Server Error

3 - WhiteList

3.1 List

Método GET
Rota /whiteList/
Body list {email}
Headers token
Responses 200 - Success
400 - Syntax
500 - Internal Server Error
WhiteList{every domain}
Wrong Syntax
Server Error

3.2 Create Rule

Método POST
Rota /whiteList/
Body createRule {email,domain}
Headers token
Responses 201 - Success
202 - Rule not added
400 - Syntax
500 - Internal Server Error
Rule created
Rule already exists
Wrong Syntax
Server Error

3.3 Edit Rule

Método PUT
Rota /whiteList/
Body UpdateRule {email,domain}
Headers token
Responses 201 - Success
202 - Rule not added
400 - Syntax
500 - Internal Server Error
Rule created
Rule already exists
Wrong Syntax
Server Error

3.4 Delete Rule

Método DELETE
Rota /whiteList/
Body DeleteRule {email,domain}
Headers token
Responses 201 - Success
202 - Rule not added
400 - Syntax
500 - Internal Server Error
Rule created
Rule already exists
Wrong Syntax
Server Error

4 - Manager

4.1 Create

Método POST
Rota /manager/
Body create {manager_email,group_id}
Headers token
Responses 201 - Success
202 - Manager not added
400 - Syntax
500 - Internal Server Error
Manager created
Manager already exists
Wrong Syntax
Server Error

4.2 Delete

Método DELETE
Rota /manager/
Body delete {manager_email,group_id}
Headers token
Responses 201 - Deleted
400 - Syntax
500 - Internal Server Error
Manager created
Wrong Syntax
Server Error

4.3 List

Método GET
Rota /manager/
Body list {manager_email,group_id}
Headers token
Responses 201 - Deleted
400 - Syntax
500 - Internal Server Error
Manager created
Wrong Syntax
Server Error

4.4 Change State

Método PUT
Rota /manager/changeStage
Body changeState {manager_email,group_id}
Headers token
Responses 201 - Active
400 - Syntax
500 - Internal Server Error
Manager is now Active
Wrong Syntax
Server Error

5 - Events

5.1 Create

Método POST
Rota /events/
Body create {
name,organizer,local,datetime
,description,foto,capacity,state,type
}
Headers token
Responses 201 - Created
202 - Not Created
400 - Syntax
500 - Internal Server Error
link to redem poap
Denied
Wrong Syntax
Server Error

5.2 List

Método GET
Rota /events/
Body list{}
Headers token
Responses 200 - OK
400 - Syntax
500 - Internal Server Error
Events{}
Wrong Syntax
Server Error

5.3 Follow

Método PUT
Rota /events/follow
Body follow{id}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
Following
Wrong Syntax
Server Error

5.4 Unfollow

Método PUT
Rota /events/unfollow
Body unfollow{id}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
Unfollowed
Wrong Syntax
Server Error

5.5 Saved

Método GET
Rota /events/saved
Body saved{}
Headers token
Responses 200 - OK
400 - Syntax
500 - Internal Server Error
Events{}
Wrong Syntax
Server Error

5.6 Search

Método GET
Rota /events/search
Body search{string}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
Events{}
Wrong Syntax
Server Error

5.7 Edit

Método PUT
Rota /events/
Body edit{name,organizer,local,datetime
,description,foto,capacity,state,type}
Headers token
Responses 201 - OK
202 - Denied
400 - Syntax
500 - Internal Server Error
Event updated
Not Permitted
Wrong Syntax
Server Error

5.8 Delete

Método DELETE
Rota /events/
Body delete{id}
Headers token
Responses 201 - OK
202 - Denied
400 - Syntax
500 - Internal Server Error
Event Deleted
Not Permitted
Wrong Syntax
Server Error

5.9 Change State

Método PUT
Rota /events/changeState
Body changeState{id}
Headers token
Responses 201 - OK
202 - Denied
400 - Syntax
500 - Internal Server Error
Event Ative
Not Permitted
Wrong Syntax
Server Error

5.10 New Type

Método POST
Rota /events/type
Body changeState{name}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
Created
Wrong Syntax
Server Error

5.11 Update Type

Método PUT
Rota /events/type
Body changeState{name}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
Updated: $name
Wrong Syntax
Server Error

5.12 Delete Type

Método DELETE
Rota /events/type
Body changeState{name}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
$name deleted
Wrong Syntax
Server Error

5.12 List Type

Método GET
Rota /events/type
Body changeState{name}
Headers token
Responses 201 - OK
400 - Syntax
500 - Internal Server Error
List<EventType>
Wrong Syntax
Server Error

6 - Poap

6.1 Create

Método POST
Rota /poap/create
Body {"name": name of your Drop,
"description": Description of your drop,
"city": city where the event will be taking place,
"country": country where the event will be taking place,
"start_date": Start date for your Drop,
"end_date": Can be the same as the End date,
"expiry_date": From this day onward, no Collectors will be able to mint POAPs from your Drop,
"year": <number>,
"event_url": entity_url_,
"virtual_event": true or false,
"image": Image should be 500x500, circle cropped, under 4MB and can either be .png or .gif with .png extension,
"secret_code": 6 digit secret code that can be used to edit your Drop afterwards,
"event_template_id": <number: default 0> add a template to customize the page where your Collectors will mint their POAP,
"email": Manager email,
"requested_codes": <number> of Mints,
"private_event": true
}
Responses 201 - Created
202 - Not Created
400 - Syntax
500 - Internal Server Error
link to redem poap
Denied
Wrong Syntax
Server Error

6.2 List

Método GET
Rota /poap/list
Body list{}
Headers token
Responses 200 - OK
400 - Syntax
500 - Internal Server Error
Events{}
Wrong Syntax
Server Error

6.3 Get by ID

Método GET
Rota /poap/getbyID
Body getbyid{id}
Headers token
Responses 200 - OK
400 - Syntax
500 - Internal Server Error
poap{}
Wrong Syntax
Server Error

6.4 Redeem

Método POST
Rota /poap/redem
Body redem{id, address}
Headers token
Responses 200 - OK
400 - Syntax
500 - Internal Server Error
poap{}
Wrong Syntax
Server Error

7 - Entity

7.1 Create

Método POST
Rota /entity/
Body name, admin{email,password}
Responses 201 - Created
400 - Syntax
500 - Internal Server Error
entity{}
Wrong Syntax
Server Error

7.2 Update

Método PUT
Rota /entity/
Body name
Responses 201 - Updated
400 - Syntax
500 - Internal Server Error
entity{}
Wrong Syntax
Server Error

7.3 Delete

Método DELETE
Rota /entity/
Body name
Responses 201 - Deleted
400 - Syntax
500 - Internal Server Error

Wrong Syntax
Server Error

7.4 Create Admin

Método POST
Rota /entity/admin
Body entity, admin{email,password}
Responses 201 - Created
400 - Syntax
500 - Internal Server Error
Admin{}
Wrong Syntax
Server Error

7.5 Update Admin

Método PUT
Rota /entity/admin
Body name,id,Admin{}
Responses 201 - Updated
400 - Syntax
500 - Internal Server Error
newAdmin{}
Wrong Syntax
Server Error

7.6 Delete Admin

Método DELETE
Rota /entity/admin
Body name, admin.id
Responses 201 - Deleted
400 - Syntax
500 - Internal Server Error

Wrong Syntax
Server Error