Group7
  1. phones
Group7
  • phones
    • Get a list of all phones
      GET
    • Get phone by id
      GET
    • Get the 5 phones that will sell out soon
      GET
    • Get the hot 5 mobile phones
      GET
    • Search for mobile phones by title keyword
      GET
    • Shopping Cart Checkout
      POST
    • Post mobile reviews (as a buyer)
      POST
    • Hide/Show Comments (as a buyer)
      PUT
    • Get details and quantities of phones purchased (as a buyer)
      POST
    • Get details of reviewed phones (as a buyer)
      POST
    • Get reviewed phones and corresponding reviews (as a buyer)
      POST
    • View phones for sale and reviews (as a seller)
      POST
    • Enable/disable mobile phones (as a seller)
      PUT
    • Change mobile phone information
      PUT
    • createPhone
      POST
    • Delete phone
      DELETE
    • Sellers view phones for sale
      POST
    • Get phone by id for list
      GET
  • users & auth
    • Registration
      POST
    • Verify email address
      GET
    • Login
      POST
    • Forgot your password (enter your email address)
      POST
    • Reset password
      PUT
    • Obtaining user information
      GET
    • Modify user information
      PUT
    • Reset password
      PUT
  1. phones

Enable/disable mobile phones (as a seller)

PUT
localhost:5001/api/phones/enableOrDisablePhone
The front end needs to work with: disabled is not displayed if it is "" or true, and is displayed if it is false or if the attribute is not hidden at all.

Request

Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0NWQzZmViNmIyZDJhZTQ5Y2NiNTBiZiIsImlhdCI6MTY4NDE1ODM3OSwiZXhwIjoxNjg2NzUwMzc5fQ.U42gF2jH69vxdcp2edpDm3T4ReBFO3Mn3Ayrd4nwAkc
Body Params application/json
disable
boolean 
required
Example
{
  "phoneId": "646237b961822c4e469d8834",
  "disabled": true
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'localhost:5001/api/phones/enableOrDisablePhone' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0NWQzZmViNmIyZDJhZTQ5Y2NiNTBiZiIsImlhdCI6MTY4NDE1ODM3OSwiZXhwIjoxNjg2NzUwMzc5fQ.U42gF2jH69vxdcp2edpDm3T4ReBFO3Mn3Ayrd4nwAkc' \
--header 'Content-Type: application/json' \
--data-raw '{
    "phoneId":"646237b961822c4e469d8834",
    "disabled":true
}'

Responses

🟢200OK
application/json
Body
_id
string 
required
title
string 
required
brand
string 
required
price
integer 
required
stock
integer 
required
seller
string 
required
reviews
array[string]
required
createdAt
string 
required
updatedAt
string 
required
__v
integer 
required
disabled
string 
required
Example
{
  "_id": "646237b961822c4e469d8834",
  "title": "iphone1000000 promax maxmaxmax",
  "brand": "Apple",
  "price": 2909999999,
  "stock": 100,
  "seller": "645d3feb6b2d2ae49ccb50bf",
  "reviews": [],
  "createdAt": "2023-05-15T13:46:33.743Z",
  "updatedAt": "2023-05-15T13:56:21.392Z",
  "__v": 0,
  "disabled": "false"
}
🔴500Server Error
🟠404Record Not Found
Previous
View phones for sale and reviews (as a seller)
Next
Change mobile phone information
Built with