Skip to content
fandilladp edited this page Apr 27, 2023 · 1 revision

Mosfitech API Documentation

Mopartner

This rest api is for mosfitech partners so they can control and monitor kits in realtime

request

  • get | https://api.berusaha.live/mopartner/ get all data partner
  • post | https://api.berusaha.live/mopartner/ add new data mitra
  • put | https://api.berusaha.live/mopartner/:id updated data mitra { require all body }
  • delete| https://api.berusaha.live/mopartner/:id delete one mitra
  • get | https://api.berusaha.live/mopartner/:id detail spesifik mitra using find by _id
  • get | https://api.berusaha.live/mopartner/emmail detail spesifik mitra using find by email

response

  • 200 Success
  • 400 Bad Request
  • 500 Internal Server Error

Kits

Rest api to connect users to hardware kits

request

  • get | https://api.berusaha.live/kits/ get all data kits
  • post | https://api.berusaha.live/kits/ add new data kits
  • put | https://api.berusaha.live/kits/:id updated data kits { require all body }
  • delete| https://api.berusaha.live/kits/:id delete one kits
  • get | https://api.berusaha.live/kits/emmail detail spesifik kits using find by email
  • put | https://api.berusaha.live/kits/warning/:id updated data kits only warning status
  • put | https://api.berusaha.live/kits/location/:id updated data kits only location kits
  • put | https://api.berusaha.live/kits/battray/:id updated data kits only battray percentage kits
  • put | https://api.berusaha.live/kits/rental/:id updated data to ready rental {rental_status,rental_time,latest_rent_username,latest_rent_email}
  • get | https://api.berusaha.live/kits/rental/:id detail spesifik kits using find by id

websocket to mqtt

  • put | https://api.berusaha.live/kits/publish/:id updated rental status
  • put | https://api.berusaha.live/kits/publish/warning/:id updated data to warning zone kits

response

  • 200 Success
  • 400 Bad Request
  • 500 Internal Server Error

MQTT Broker

Connectivity broker with the mqtt protocol uses the pub sub method to exchange data information between servers and kits in real time, where there is a geofencing process using georedis computations that can calculate the area of the vehicle

topic


kits subscribe
  • rental/uuid
    • response {rental status, 0 to no rental and 1 ready to rental}
  • rental/warning/uuid
    • response {rental warning zone 0 to false & 1 to true}

kits publish

  • rental/battray
    • response updated data battray to db
      • format data uuid,data-battray
  • rental/location
    • response updated data location
      • format data uuid,latitude,longitude

Clone this wiki locally