function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jo PolandJo Poland 

Time Doctor sync with Salesforce. Does anyone know how to do this at the Salesforce end? Apparently it needs Oauth and I can't figure out how to do that.

I find really complex programming instructions when I search for Oauth, but I know I did use an Oauth to install Salesforce for Outlook and that was simple. 
scottbcovertscottbcovert
Hi Jo,

You should be able to perform Apex callouts to a 3rd party API such as the one Time Doctor provides. You can build a Visualforce page and Apex controller that takes the running user id to run a query for an existing Time Doctor access token to use for further integration. In the event of no access token or an expired token you can follow the steps from this document:

https://webapi.timedoctor.com/doc/#authentication

Afterwards you can save the Time Doctor token somewhere in Salesforce (perhaps a list custom setting?) along with the associated SF user id.

Here's more information on making HTTP callouts from Apex:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_httprequest.htm

You'll also want to whitelist the Time Doctor domain under Remote Site Settings: https://help.salesforce.com/apex/HTViewHelpDoc?id=configuring_remoteproxy.htm&language=en