Skip to content

Commit f5b3536

Browse files
committed
Merge branch 'Nereo-version-3' into version-3
2 parents 6d4c521 + 5646da0 commit f5b3536

13 files changed

+18
-30
lines changed

README.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ Configure your client
3535
.. code:: python
3636
3737
from intercom.client import Client
38-
intercom = Client(app_id='my_app_id', api_key='my_api_key')
39-
40-
You can get your app_id from the URL when you're logged into Intercom (it's the alphanumeric just after /apps/) and your API key from the API keys integration settings page (under your app settings - integrations in Intercom).
38+
intercom = Client(personal_access_token='my_personal_access_token')
4139
40+
Note that certain resources will require an extended scope access token : `Setting up Personal Access Tokens <https://developers.intercom.com/docs/personal-access-tokens>`_
4241

4342
Resources
4443
~~~~~~~~~
@@ -552,7 +551,7 @@ Integration tests:
552551

553552
.. code:: bash
554553
555-
INTERCOM_APP_ID=xxx INTERCOM_APP_API_KEY=xxx nosetests tests/integration
554+
INTERCOM_PERSONAL_ACCESS_TOKEN=xxx nosetests tests/integration
556555
557556
.. |PyPI Version| image:: https://img.shields.io/pypi/v/python-intercom.svg
558557
:target: https://pypi.python.org/pypi/python-intercom

docs/development.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Run the integration tests:
1515
::
1616

1717
# THESE SHOULD ONLY BE RUN ON A TEST APP!
18-
INTERCOM_APP_ID=xxx INTERCOM_APP_API_KEY=xxx nosetests tests/integration
18+
INTERCOM_PERSONAL_ACCESS_TOKEN=xxx nosetests tests/integration
1919

2020
Generate the Documentation
2121
--------------------------

docs/index.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ Intercom documentation: `Personal Access Tokens <https://developers.intercom.com
3232

3333
::
3434

35-
from intercom import Intercom
36-
Intercom.app_id = 'dummy-app-id'
37-
Intercom.app_api_key = 'dummy-api-key'
35+
from intercom.client import Client
36+
intercom = Client(personal_access_token='my_personal_access_token')
3837

3938
Users
4039
-----

intercom/client.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33

44
class Client(object):
55

6-
def __init__(self, app_id='my_app_id', api_key='my_api_key'):
7-
self.app_id = app_id
8-
self.api_key = api_key
6+
def __init__(self, personal_access_token='my_personal_access_token'):
7+
self.personal_access_token = personal_access_token
98
self.base_url = 'https://api.intercom.io'
109
self.rate_limit_details = {}
1110

1211
@property
1312
def _auth(self):
14-
return (self.app_id, self.api_key)
13+
return (self.personal_access_token, '')
1514

1615
@property
1716
def admins(self):

tests/integration/issues/test_72.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from intercom.client import Client
88

99
intercom = Client(
10-
os.environ.get('INTERCOM_APP_ID'),
11-
os.environ.get('INTERCOM_API_KEY'))
10+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1211

1312

1413
class Issue72Test(unittest.TestCase):

tests/integration/issues/test_73.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from intercom.client import Client
1010

1111
intercom = Client(
12-
os.environ.get('INTERCOM_APP_ID'),
13-
os.environ.get('INTERCOM_API_KEY'))
12+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1413

1514

1615
class Issue73Test(unittest.TestCase):

tests/integration/test_admin.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from intercom.client import Client
66

77
intercom = Client(
8-
os.environ.get('INTERCOM_APP_ID'),
9-
os.environ.get('INTERCOM_API_KEY'))
8+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
109

1110

1211
class AdminTest(unittest.TestCase):

tests/integration/test_company.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
from . import get_timestamp
1111

1212
intercom = Client(
13-
os.environ.get('INTERCOM_APP_ID'),
14-
os.environ.get('INTERCOM_API_KEY'))
13+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1514

1615

1716
class CompanyTest(unittest.TestCase):

tests/integration/test_conversations.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
from . import get_timestamp
1212

1313
intercom = Client(
14-
os.environ.get('INTERCOM_APP_ID'),
15-
os.environ.get('INTERCOM_API_KEY'))
14+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1615

1716

1817
class ConversationTest(unittest.TestCase):

tests/integration/test_notes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
from . import get_timestamp
99

1010
intercom = Client(
11-
os.environ.get('INTERCOM_APP_ID'),
12-
os.environ.get('INTERCOM_API_KEY'))
11+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1312

1413

1514
class NoteTest(unittest.TestCase):

tests/integration/test_segments.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from intercom.client import Client
66

77
intercom = Client(
8-
os.environ.get('INTERCOM_APP_ID'),
9-
os.environ.get('INTERCOM_API_KEY'))
8+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
109

1110

1211
class SegmentTest(unittest.TestCase):

tests/integration/test_tags.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
from . import get_timestamp
1111

1212
intercom = Client(
13-
os.environ.get('INTERCOM_APP_ID'),
14-
os.environ.get('INTERCOM_API_KEY'))
13+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1514

1615

1716
class TagTest(unittest.TestCase):

tests/integration/test_user.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
from . import delete_user
99

1010
intercom = Client(
11-
os.environ.get('INTERCOM_APP_ID'),
12-
os.environ.get('INTERCOM_API_KEY'))
11+
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
1312

1413

1514
class UserTest(unittest.TestCase):

0 commit comments

Comments
 (0)