Code Monkey home page Code Monkey logo

ip-hck64-ardiantoosman4's Introduction

Review Assignment Due Date Open in Visual Studio Code

Individual Project Phase 2 (TENFLIX)

 

0. CLIENT TENFLIX

https://tenflix-ardianto.web.app/

 

1. POST /add-user

Request:

  • body:
{ "email": "[email protected]", "password": "12345" }

Response (201 - Created)

{
  "id": 3,
  "email": "[email protected]"
}

Response (400 - Bad Request)

{
  "message": string
}

 

2. POST /login

  • body:
{ "email": "[email protected]", "password": "12345" }

Response (200 - OK)

{
  "access_token": "JWT TOKEN"
}

Response (400 - Bad Request)

{
  "message": string
}

 

3. POST /googleLogin

  • body:
{
  "googleToken": "Google Token"
}

Response (200 - OK)

{
  "access_token": "JWT TOKEN"
}

Response (400 - Bad Request)

{
  "message": string
}

4. POST /midtrans/payment

  • Description: To accept response from midtrans and give back 200

  • Header:

{
  "authentication": "Bearer <JWT TOKEN>"
}
  • body:
{
  "transaction_status":string,
  "fraud_status":string,
  "order_id":string
}

Response (200 - OK)

5. POST /midtrans/token

  • Description: To get midtrans token and create new order

  • Header:

{
  "authentication": "Bearer <JWT TOKEN>"
}
  • body:
{
  "price": 1000,
  "title": string,
  "movie_id": 1,
  "imgUrl": string,
  "description": string,
  "duration": 0,
}

Response (200 - OK)

{
  "response":{
    "token": string
  }
}

6. GET /my-profile

  • Description: To get transaction done by user

  • Header:

{
  "authentication": "Bearer <JWT TOKEN>"
}

Response (200 - OK)

[

  {
    "order_id": string,
    "UserId": integer,
    "orderTime": date,
    "price": number,
    "title": string,
    "movie_id": number,
    "imgUrl": string,
    "description": string,
    "duration": number,
    "trailerUrl": string,
    "paymentStatus": string
  }
  ...
]

 

7. DELETE /my-profile/order/:OrderId

  • Header:
{
  "authorization": "Bearer <JWT TOKEN>"
}
  • path parameter:
{
  "id": 1
}

Response (200 - OK)

{
  "id": 1,
  "order_id": string,
  "UserId": integer,
  "orderTime": date,
  "price": number,
  "title": string,
  "movie_id": number,
  "imgUrl": string,
  "description": string,
  "duration": number,
  "trailerUrl": string,
  "paymentStatus": string
}

Response (404 - Not Found)

{
  "message": "Data with id <id> is not found"
}

 

8. get /my-profile/order/:OrderId

  • Header:
{
  "authorization": "Bearer <JWT TOKEN>"
}
  • path parameter:
{
  "id": 1
}

Response (200 - OK)

{
  "order_id": string,
  "UserId": integer,
  "orderTime": date,
  "price": number,
  "title": string,
  "movie_id": number,
  "imgUrl": string,
  "description": string,
  "duration": number,
  "trailerUrl": string,
  "paymentStatus": string
}

Response (404 - Not Found)

{
  "message": "Data with id <id> is not found"
}

 

Global Error

Response (401 - Unauthorized)

{
  "message": "Invalid token"
}

Response (500 - Internal Server Error)

{
  "message": "Internal server error"
}

ip-hck64-ardiantoosman4's People

Contributors

ardiantoosman4 avatar github-classroom[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.