Skip to content

RESTful Service Endpoints

Enan Ashaduzzaman edited this page Nov 1, 2020 · 8 revisions

Customer Endpoints

POST - Create customer

URL Template: https://artsee-backend.herokuapp.com/customers

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"userID": "john1","email": "john1@gmail.com","password": "123","firstName": "john", "lastName": "smith", "phoneNumber": "1234", "address": {"addressLine1": "750 garden st", "addressLine2": "apt 23", "city": "montreal", "province": "quebec", "postalCode": "hhhhhh", "country" : "Canada"}}' 'https://artsee-backend.herokuapp.com/customers'

GET - Get Customer by userID

URL Template: https://artsee-backend.herokuapp.com/customers/{userID}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/customers/john1'

GET - Get All Customers

URL Template: https://artsee-backend.herokuapp.com/customers

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/customers'

PUT - Update customer

URL Template: https://artsee-backend.herokuapp.com/customers

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"userID": "john1","email": "john1@gmail.com","password": "123","firstName": "john", "lastName": "smith", "phoneNumber": "5143333344", "address": {"addressLine1": "750 garden st", "addressLine2": "apt 23", "city": "montreal", "province": "quebec", "postalCode": "hhhhhh", "country" : "Canada"}}' 'https://artsee-backend.herokuapp.com/customers'

DELETE- Delete customer

URL Template: https://artsee-backend.herokuapp.com/customers/{userID}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/customers/john1'

Artist Endpoints

POST - Create artist

URL Template: https://artsee-backend.herokuapp.com/artists

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"userID": "bob1", "email": "bob1@gmail.com","password": "12345","firstName": "bob", "lastName": "charles", "phoneNumber": "5141111111", "artistDescription": "coolartist"}' 'https://artsee-backend.herokuapp.com/artists'

GET - Get Artist by userID

URL Template: https://artsee-backend.herokuapp.com/artists/{userID}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artists/bob1'

GET - Get All Artists

URL Template: https://artsee-backend.herokuapp.com/artists

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artists'

PUT - Update artist

URL Template: https://artsee-backend.herokuapp.com/artists

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"userID": "bob1","email": "bob123@gmail.com","password": "321","firstName": "bob", "lastName": "ch", "phoneNumber": "5143334344", "artistDescription": "coolartist"}' 'https://artsee-backend.herokuapp.com/artists'

DELETE- Delete artist

URL Template: https://artsee-backend.herokuapp.com/artists/{userID}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artists/bob1'

Admin Endpoints

POST - Create admin

URL Template: https://artsee-backend.herokuapp.com/administrators

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"userID": "admin1", "email": "admin1@gmail.com","password": "999","firstName": "new", "lastName": "admin", "phoneNumber": "5143456789"}' 'https://artsee-backend.herokuapp.com/administrators'

GET - Get Admin by userID

URL Template: https://artsee-backend.herokuapp.com/administrators/{userID}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/administrators/admin1'

GET - Get All Admins

URL Template: https://artsee-backend.herokuapp.com/administrators

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/administrators'

PUT - Update admin

URL Template: https://artsee-backend.herokuapp.com/administrators

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"userID": "admin1","email": "admin1@hotmail.com","password": "321","firstName": "new", "lastName": "admin", "phoneNumber": "5143456789"}' 'https://artsee-backend.herokuapp.com/administrators'

DELETE- Delete admin

URL Template: https://artsee-backend.herokuapp.com/administrators/{userID}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/administrators/admin1'

User Endpoints

GET - Get User by userID

URL Template: https://artsee-backend.herokuapp.com/users/{userID}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/users/bob1'

GET - Get All Users

URL Template: https://artsee-backend.herokuapp.com/users

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/users'

PUT - Update user

URL Template: https://artsee-backend.herokuapp.com/users

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"userID": "admin1","email": "admin1@hotmail.com","password": "321","firstName": "new", "lastName": "admin", "phoneNumber": "46702421552"}' 'https://artsee-backend.herokuapp.com/users'

DELETE- Delete user

URL Template: https://artsee-backend.herokuapp.com/users/{userID}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/users/admin1'

Sign-in Endpoint

POST- Sign in

URL Template: https://artsee-backend.herokuapp.com/signIn

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"userID": "bob1", "password": "321"}' 'https://artsee-backend.herokuapp.com/signIn'

Artwork Endpoints

POST - Create Artwork

URL Template: https://artsee-backend.herokuapp.com/artworks

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"name": "newart1", "price": 9, "description": "latest", "dateOfCreation": "2020-03-10", "numInStock": 5, "artist": {"userID": "bob1"}}' 'https://artsee-backend.herokuapp.com/artworks'

GET - Get All Artworks

URL Template: https://artsee-backend.herokuapp.com/artworks

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworks'

GET - Get Artwork by ID

URL Template: https://artsee-backend.herokuapp.com/artwork/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artwork/1'

GET - Get All Artworks By Artist

URL Template: https://artsee-backend.herokuapp.com/artworksByArtist/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworksByArtist/artist1'

PUT - Update Artwork

URL Template: https://artsee-backend.herokuapp.com/artworks

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"id": "1", "name": "newart1", "price": 10, "description": "latest", dateOfCreation": "2020-03-10", "numInStock": 6, "artist": {"userID": "bob1"}}' 'https://artsee-backend.herokuapp.com/artworks'

DELETE- Delete artwork

URL Template: https://artsee-backend.herokuapp.com/artworks/{id}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworks/1'

Review Endpoints

POST - Create review

URL Template: https://artsee-backend.herokuapp.com/reviews

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"rating": 5, "comment": "best", "wouldRecommend": true, "customer": {"userID": "john1"}, "artist": {"userID": "bob1"}}' 'https://artsee-backend.herokuapp.com/reviews'

GET - Get All Reviews

URL Template: https://artsee-backend.herokuapp.com/reviews

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/reviews'

GET - Get Review by ID

URL Template: https://artsee-backend.herokuapp.com/review/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/review/1'

GET - Get Reviews on Artist

URL Template: https://artsee-backend.herokuapp.com/reviewsOnArtist/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/reviewsOnArtist/artist1'

GET - Get Reviews by Customer

URL Template: https://artsee-backend.herokuapp.com/reviewsByCustomer/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/reviewsByCustomer/customer1'

PUT - Update review

URL Template: https://artsee-backend.herokuapp.com/reviews

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"id": 1, "rating": 4, "comment": "yet to improve", "wouldRecommend": true, "customer": {"userID": "john1"}, "artist": {"userID": "bob1"}}' 'https://artsee-backend.herokuapp.com/reviews'

DELETE- Delete review

URL Template: https://artsee-backend.herokuapp.com/reviews/{id}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/reviews/1'

Artwork Order Endpoints

POST - Create Artwork Order

URL Template: https://artsee-backend.herokuapp.com/artworkOrders

URL Sample: curl -X POST -H "Content-Type: application/json" --data '{"customer": {"userID": "john1"}, "artworks": [], "deliveryMethodDto": "SHIP"}' 'https://artsee-backend.herokuapp.com/artworkOrders'

GET - Get All Artwork Orders

URL Template: https://artsee-backend.herokuapp.com/artworkOrders

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworkOrders'

GET - Get Artwork Order by ID

URL Template: https://artsee-backend.herokuapp.com/artworkOrder/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworkOrder/1'

GET - Get Artwork Orders by Customer

URL Template: https://artsee-backend.herokuapp.com/artworkOrdersByCustomer/{id}

URL Sample: curl -X GET -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworkOrdersByCustomer/customer1'

PUT - Update Artwork Order

URL Template: https://artsee-backend.herokuapp.com/artworkOrders

URL Sample: curl -X PUT -H "Content-Type: application/json" --data '{"orderID": 1, "customer": {"userID": "john1"}, "artworks": [{"id": 1, "name": "newart1", "price": 9, "description": "latest", dateOfCreation": "2020-03-10", "numInStock": 5, "artist": {"userID": "bob1"}}], "deliveryMethodDto": "SHIP", "orderStatusDto": "PROCESSING"}' 'https://artsee-backend.herokuapp.com/reviews'

DELETE- Delete Artwork Order

URL Template: https://artsee-backend.herokuapp.com/artworkOrders/{id}

URL Sample: curl -X DELETE -H "Content-Type: application/json" 'https://artsee-backend.herokuapp.com/artworkOrders/1'