Jehanramadhan

Untitled

Jan 12th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. Step how to access API Realtime:
  2.  
  3. <?php $host = $_SERVER['HTTP_HOST']; ?>
  4.  
  5. var hostName = '//<?php echo $host; ?>';
  6. var hawkUrl = localhost/index.php';
  7.  
  8. 1. API Login
  9. url : hawkUrl + '/api_users/login'
  10. post data : {username: 'admin', password: 'admin'}
  11.  
  12. from respon get 'token'
  13.  
  14. 2. API Load Device
  15. url : hawkUrl + '/api_devices/load_device/' + token
  16.  
  17. from respon get 'deviceid'
  18.  
  19. 3. API Set Sesion device
  20. url : hawkUrl + '/api_devices/set_session_device/'+ token
  21. post data : {devices[]: deviceid}
  22.  
  23. 4. API Register Realtime
  24. url : hawkUrl + '/api_positions/register_realtime/'+ token
  25.  
  26. from respon get 'realtime_id'
  27.  
  28. 5. API Realtime
  29. url : hawkUrl + '/api_positions/realtime/'+ token
  30. post data : realtime_id
  31.  
  32. from respon get require data.
Add Comment
Please, Sign In to add comment