Skip to content

REST API's

Anusha Shetty edited this page Nov 28, 2019 · 31 revisions
  1. User Login
  SERVER_URI 	: 	http://www.brightlightventures.com/timetracker/index.php/api/login

  METHOD 	: 	POST

REQUEST DATA 	: 	{  
 			   "username":"test@printgreener.com",
 			   "password":"gp.@1234"
 			}

RESPONSE        : 
                  a) On sucessfull login gives 
                      {
                        "success": 1,
                        "user_details": {
                                       "id": "1",
                                       "type": "user",
                                       "email": "admin@printgreener.com",
                                       "auth_key": "eyJ0eXAiOiJKV1QiLCJhbG"
                                        }
                      }
                      

                  b) On validation error like invalid email or invalid password it gives 

                      {
                         "success": 0,
                         "msg": "Invalid username or password!"
                      }
  1. Task List
  SERVER_URI 	: 	http://www.brightlightventures.com/timetracker/index.php/api/task

  METHOD 	: 	POST

REQUEST DATA	:  {
 			      "id": 1
                   }
HEADERS : {
               "Authorization-Key" : //auth_key from login API
           }

RESPONSE        : 
                  a) On Success

                     {
                      "details": [
                                 {
                                  "name": "Sphere",
                                  "start_time": "2019-11-13 05:47:08",
                                  "image_name": "",
                                  "task_name": "task5",
                                  "id": "7",
                                  "running_task": "1",
                                  "t_minutes": "0"
                                },
                               {
                                 "name": "Buck",
                                 "start_time": "2019-11-13 06:52:18",
                                 "image_name": null,
                                 "task_name": "task22",
                                 "id": "8",
                                 "running_task": "1",
                                 "t_minutes": "0"
                               }
                              ]
                        }
                  b) if auth-key is incorrect

                     {
                       "success":0,
                       "status": 401,
                       "msg": "Unauthorized Access! "
                     }
                  

Clone this wiki locally