With the world adapting to hybrid and remote workspaces, there is a need more than ever for companies and organizations to update themselves. Tracking and monitoring employee productivity and ensuring efficiency has become a challenging task for companies.
Being a developer, developing website, maintaining productivity, and communicating with the team was something I faced challenges with.
Therefore, I am sharing this blog about time tracking software, Time Doctor, which has made remote work life a lot easier. I will also mention how to get the logged data using Application Programming Interface (API), which many other developers like me would find helpful.
What is Time Doctor?
Time Doctor is a SaaS employee monitoring tool that companies can use to view their employees' websites and applications. It is highly multifunctional and has Customer Relationship Management (CRM) and white-label capabilities.
Time Doctor keeps track of how much time each team member spends on each project, client, or task and breaks it down by project, client, or task.
Managers can see exactly where time is spent and how much time is spent on specific activities thanks to the second-by-second accuracy of the time monitoring data. Companies can use this information to bill clients or keep track of employee salaries.
Managers get a weekly report that details the websites and applications their staff used and for how long. Individual users will receive the same report, which will detail their time usage information.
This report, according to the provider, maximizes productivity tracking and assists in identifying productivity concerns.
At work, screenshots of the employee's computer are displayed every few minutes using the application.
To retrieve reports and resources, Time Doctor uses an API. The first step to making use of the interface is to create an account in Time Doctor.
Once you create an account, you will be redirected to the dashboard.
What is an API?
An Application Programming Interface (API) is a software that enables the users to connect two or more applications with each other through simple commands. It acts as a mediator by delivering your requests to the provider and reverts the response to you.
APIs allow users to use pre-existing frameworks to develop code and software, eliminating creating code from scratch. This saves time and lets them concentrate on the proposition of their applications.
They enable data to be transmitted from one system to another, hence establishing connectivity. APIs are a common technique for gaining access to any data or device in an application.
Let us now see how you can create a Time Doctor API to fetch data from Time Doctor. To create professional website application, you have to follow some rules. The authentication process is also essential.
Here you will see how you can authenticate the app
Register your app
If you want to connect to the Time Doctor API with your own app, you must first register it to acquire a Client ID and Client Secret Key.
Step (a): Log in to https://webapi.timedoctor.com/app/login using your Time Doctor credentials.
Step (b): After you've logged in, go to the "Register Another Application" page and fill out the form. Save a copy of your CLIENT ID and SECRET KEY after submitting the form for future use -
Requesting Authorization from the User
There are two strategies you can choose while implementing this:
a. Authorization Code Grant Flow: This flow is helpful if you have your own server for your app. It is most commonly used for traditional web apps, desktop, and mobile apps.
This url will return the auth code:
https://webapi.timedoctor.com/oauth/v2/auth?client_id=<YOUR_CLIENT_ID>&response_type=code&redirect_uri=<REDIRECT_URI>
Use the auth code and get the access token from here:
https://webapi.timedoctor.com/oauth/v2/token?client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>&grant_type=authorization_code&redirect_uri=<REDIRECT_URI>&code=<RETURNED_CODE_FROM_POINT.a>
Implicit Grant Flow: It is useful when you don't have your own server for your app. It is suitable for in-browser web apps.
https://webapi.timedoctor.com/oauth/v2/auth?client_id=<CLIENT_ID>&redirect_uri=REDIRECT_URI&response_type=token- this url will redirect back on successful authentication with the access_token, refresh_token and expiry on the url
Using the Access Token
After getting the Access_token, you can make authenticated requests to the API on the user's behalf. To do this, add the HTTP header of the form "Authorization: $access_token" to your requests.
Handling expired Access Token
The access token expires after a while. After it expires, you can use the refresh token to create a new set of tokens by requesting your app.
Making an Authenticated request
You can make an authenticated request on the user's behalf in two ways:
- By sending the access token as part of the query parameter.
- By sending the access token as part of the request header.
You can also make use of API documentation,
Or you can go through your dashboard.
Make sure you get access to your access token before starting to use your API.
Once you click, you will be redirected to the next page as below mentioned
Now you have your access token, which can be used anywhere in your app.
The next step is to create & test API, and for this, you can one of the API testing tools listed by RapidAPI. For our example, we will use Postman. Here is a small introduction about it, which is a reliable tool for testing API.
What is Postman?
Postman is an API client for developers that makes it simple to create, share, test, and document APIs.
Users can construct and save simple and sophisticated HTTP/s requests and read their responses to do this. As a result, you'll be more productive and spend less time working.
In case you haven't installed Postman, you can download it here.
As we can create API URL there and then we can test in Postman, for more clarity, please follow the steps :
From the screenshots given below, you can see that the company's data is accessible with API. First, you will be required to fill your access token in 'Access Token.'
Now you need to click on the 'TRY' button. Once you click on the try button, you will get the data :
Similarly, you can fetch any data as per your requirement.
Wrapping Up
Time Doctor has proved to be a game-changer! It is ideal for service-based businesses where time monitoring is critical for billing and revenue. It is also suitable for both professional and personal use.
Now that I have shared the software that has helped me be productive and efficient, I hope this may be useful for many others.
For more information, Contact us!
Editor- Amrutha