Skip to content

Latest commit

 

History

History
executable file
·
155 lines (142 loc) · 4.67 KB

README.md

File metadata and controls

executable file
·
155 lines (142 loc) · 4.67 KB

ADD DATA ENDPOINT

« back to menu

Table of Contents

1.1 add product category

  • URL

    https://t-gadgetapi.herokuapp.com/add/category
    
  • Request method
    POST

  • Request header

    • api-key
    • token
  • Params body

    PARAMETER REQUIRED UNIQUE TYPE MAX_LENGTH
    category_name yes yes text 20 char
  • Success response

    • code : 201 Created
      json :
      { 
        "success": true,
        "message": "add category is success!" 
      }
      
  • Error Response:

    • code : 400 Bad Request
      json : { "success": false,"message": {} }
    • code : 401 Unauthorized
      json : { "success": false,"message": {} }
    • code : 500 Internal Server Error
      json : { "success": false,"message": "" }

1.2 add testimoni

  • URL

    https://t-gadgetapi.herokuapp.com/add/testimony
    
  • Request method
    POST

  • Request header

    • api-key
    • token
  • Params body

    PARAMETER REQUIRED TYPE MAX_SIZE
    img_testi yes webp,jpeg,png 200kb
  • Success response

    • code : 201 Created
      json :
      { 
        "success": true,
        "message": "add testimony is success" 
      }
      
  • Error Response:

    • code : 400 Bad Request
      json : { "success": false,"message": {} }
    • code : 401 Unauthorized
      json : { "success": false,"message": {} }
    • code : 500 Internal Server Error
      json : { "success": false,"message": "" }

1.3 add banner

  • URL

    https://t-gadgetapi.herokuapp.com/add/banner
    
  • Request method
    POST

  • Request header

    • api-key
    • token
  • Params body

    PARAMETER REQUIRED TYPE MAX_SIZE
    banner_desktop yes webp,jpeg,png 200kb
    banner_mobile yes webp,jpeg,png 200kb
  • Success response

    • code : 201 Created
      json :
      { 
        "success": true,
        "message": "add banner is success!" 
      }
      
  • Error Response:

    • code : 400 Bad Request
      json : { "success": false,"message": {} }
    • code : 401 Unauthorized
      json : { "success": false,"message": {} }
    • code : 500 Internal Server Error
      json : { "success": false,"message": "" }

1.4 add product

  • URL

    https://t-gadgetapi.herokuapp.com/add/product
    
  • Request method
    POST

  • Request header

    • api-key
    • token
  • Params body

    PARAMETER REQUIRED UNIQUE TYPE MAX_LENGTH
    product_name yes yes text 250 char
    price yes no num 11 char
    kategori yes no text 20 char
    keyword yes no text 200 char
    product_img yes no webp,jpeg,png 200kb
    deskripsi yes no text 1000 char
    linktp yes no text 200 char
    linksp yes no text 200 char
    linklz yes no text 200 char
    linkwa yes no text 200 char
    stock yes no num (1,0) 1
  • Success response

    • code : 201 Created
      json :
      { 
        "success": true,
        "message": "add product is success!" 
      }
      
  • Error Response:

    • code : 400 Bad Request
      json : { "success": false,"message": "" }
    • code : 401 Unauthorized
      json : { "success": false,"message": {} }
    • code : 500 Internal Server Error
      json : { "success": false,"message": "" }