calendly-python icon indicating copy to clipboard operation
calendly-python copied to clipboard

Calendly V2 support

Open kevteg opened this issue 6 years ago • 6 comments

Calendly is working on the next version of their API. Monitoring it to make it compatible with this lib

kevteg avatar Sep 27 '19 15:09 kevteg

We are currently looking for exactly a lib with v2 support. Is there already a plan to implement this or would you be open to a PR which implements it?

jankatins avatar Oct 14 '19 13:10 jankatins

I am planning to work on this soon, but I will definitely love a PR!

kevteg avatar Oct 17 '19 22:10 kevteg

is any work on this still occuring?

jumpfinance-api avatar Sep 08 '20 00:09 jumpfinance-api

I am not a Python developer but am able to use the V2 API by making some slight modification. I don't use webhooks:

Change: (utils/requests.py):

class CaRequest(object):

def __init__(self, token):
    self.headers = {'authorization': token}
    #self.headers = {'X-TOKEN': token}

Change: (utils/constants.py):

BASE="https://api.calendly.com/" #BASE="https://calendly.com/api/v1/" WEBHOOK=f"{BASE}/hooks" ME=f"{BASE}/users/me" ECHO=f"{BASE}/echo" #EVENTS=f"{BASE}/events"

#Added EVENT_TYPE=f"{BASE}/event_types" SCHEDULED_EVENTS=f"{BASE}/scheduled_events"

Change: (utils/constants.py):

from requests.auth import HTTPBasicAuth from json import JSONDecodeError #from calendly.utils.constants import WEBHOOK, ME, ECHO, EVENTS from calendly.utils.constants import BASE,WEBHOOK, ME, ECHO,SCHEDULED_EVENTS,EVENT_TYPE from calendly.utils.requests import CaRequest

class Calendly(object):

... ... #Updated def event_types(self): #response = self.request.get(f'{BASE}/event_types') response = self.request.get(f'{ME}/event_types') return response.json()

#added
def scheduled_events(self,queryParam):
    #response = self.request.get(f'{BASE}/event_types')
    #response = self.request.get(f'{SCHEDULED_EVENTS}?'+'user='+user+'status='+status+'&count=20')
    response = self.request.get(f'{SCHEDULED_EVENTS}?' + queryParam)
    return response.json()

#added
def scheduled_event_details(self,eventUUID,inviteeUUID):
    #response = self.request.get(f'{BASE}/event_types')
    #response = self.request.get(f'{SCHEDULED_EVENTS}?'+'user='+user+'status='+status+'&count=20')
    response = self.request.get(f'{SCHEDULED_EVENTS}/' + eventUUID + '/invitees')#/' + inviteeUUID)
    return response.json()

chotaGit avatar Jun 13 '21 02:06 chotaGit

If you are still looking for Calendly API v2 support, I've built another package which you can make use of: https://github.com/laxmena/PyCalendly

laxmena avatar Jul 30 '21 05:07 laxmena

Thanks, @chotaGit I noticed they made the V2 the main version now.

kevteg avatar Aug 04 '21 04:08 kevteg