From 27a61ee989893695e8de2b5d91b3572a9db9df74 Mon Sep 17 00:00:00 2001 From: Sam Ryan Date: Thu, 25 Jul 2019 12:46:15 -0700 Subject: [PATCH] Added support for Playbook APIs --- drift/api.py | 2 ++ drift/playbooks.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 drift/playbooks.py diff --git a/drift/api.py b/drift/api.py index cadcc03..5a5f16e 100644 --- a/drift/api.py +++ b/drift/api.py @@ -2,6 +2,7 @@ import requests from .contacts import Contact from .conversations import Conversation +from .playbook import Playbook from .users import User from . import __version__ @@ -24,6 +25,7 @@ def __init__(self, access_token): } self.contacts = Contact(self) self.conversations = Conversation(self) + self.playbooks = Playbook(self) self.users = User(self) def post(self, url, data, **kwargs): diff --git a/drift/playbooks.py b/drift/playbooks.py new file mode 100644 index 0000000..3ee0164 --- /dev/null +++ b/drift/playbooks.py @@ -0,0 +1,16 @@ +from .errors import InvalidFormatError + + +class Playbook(object): + """ + Contains API route for quering playbooks. + https://devdocs.drift.com/docs/retrieve-conversational-landing-pages + """ + + CLP_URL = 'https://driftapi.com/playbooks/clp' + + def __init__(self, client): + self.client = client + + def get(self): + return self.client.get(self.CLP_URL)