File tree Expand file tree Collapse file tree 13 files changed +19
-31
lines changed Expand file tree Collapse file tree 13 files changed +19
-31
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,9 @@ Configure your client
35
35
.. code :: python
36
36
37
37
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' )
41
39
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 >`_
42
41
43
42
Resources
44
43
~~~~~~~~~
@@ -552,7 +551,7 @@ Integration tests:
552
551
553
552
.. code :: bash
554
553
555
- INTERCOM_APP_ID=xxx INTERCOM_APP_API_KEY =xxx nosetests tests/integration
554
+ INTERCOM_PERSONAL_ACCESS_TOKEN =xxx nosetests tests/integration
556
555
557
556
.. |PyPI Version | image :: https://img.shields.io/pypi/v/python-intercom.svg
558
557
:target: https://pypi.python.org/pypi/python-intercom
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Run the integration tests:
15
15
::
16
16
17
17
# 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
19
19
20
20
Generate the Documentation
21
21
--------------------------
Original file line number Diff line number Diff line change @@ -28,13 +28,12 @@ Usage
28
28
Authentication
29
29
---------------
30
30
31
- Intercom documentation: `Authentication <http ://api .intercom.io /docs#authentication >`_.
31
+ Intercom documentation: `Authentication <https ://developers .intercom.com /docs#authentication >`_.
32
32
33
33
::
34
34
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')
38
37
39
38
Users
40
39
-----
Original file line number Diff line number Diff line change 3
3
4
4
class Client (object ):
5
5
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
9
8
self .base_url = 'https://api.intercom.io'
10
9
self .rate_limit_details = {}
11
10
12
11
@property
13
12
def _auth (self ):
14
- return (self .app_id , self . api_key )
13
+ return (self .personal_access_token , '' )
15
14
16
15
@property
17
16
def admins (self ):
Original file line number Diff line number Diff line change 7
7
from intercom .client import Client
8
8
9
9
intercom = Client (
10
- os .environ .get ('INTERCOM_APP_ID' ),
11
- os .environ .get ('INTERCOM_API_KEY' ))
10
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
12
11
13
12
14
13
class Issue72Test (unittest .TestCase ):
Original file line number Diff line number Diff line change 9
9
from intercom .client import Client
10
10
11
11
intercom = Client (
12
- os .environ .get ('INTERCOM_APP_ID' ),
13
- os .environ .get ('INTERCOM_API_KEY' ))
12
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
14
13
15
14
16
15
class Issue73Test (unittest .TestCase ):
Original file line number Diff line number Diff line change 5
5
from intercom .client import Client
6
6
7
7
intercom = Client (
8
- os .environ .get ('INTERCOM_APP_ID' ),
9
- os .environ .get ('INTERCOM_API_KEY' ))
8
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
10
9
11
10
12
11
class AdminTest (unittest .TestCase ):
Original file line number Diff line number Diff line change 10
10
from . import get_timestamp
11
11
12
12
intercom = Client (
13
- os .environ .get ('INTERCOM_APP_ID' ),
14
- os .environ .get ('INTERCOM_API_KEY' ))
13
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
15
14
16
15
17
16
class CompanyTest (unittest .TestCase ):
Original file line number Diff line number Diff line change 11
11
from . import get_timestamp
12
12
13
13
intercom = Client (
14
- os .environ .get ('INTERCOM_APP_ID' ),
15
- os .environ .get ('INTERCOM_API_KEY' ))
14
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
16
15
17
16
18
17
class ConversationTest (unittest .TestCase ):
Original file line number Diff line number Diff line change 8
8
from . import get_timestamp
9
9
10
10
intercom = Client (
11
- os .environ .get ('INTERCOM_APP_ID' ),
12
- os .environ .get ('INTERCOM_API_KEY' ))
11
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
13
12
14
13
15
14
class NoteTest (unittest .TestCase ):
Original file line number Diff line number Diff line change 5
5
from intercom .client import Client
6
6
7
7
intercom = Client (
8
- os .environ .get ('INTERCOM_APP_ID' ),
9
- os .environ .get ('INTERCOM_API_KEY' ))
8
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
10
9
11
10
12
11
class SegmentTest (unittest .TestCase ):
Original file line number Diff line number Diff line change 10
10
from . import get_timestamp
11
11
12
12
intercom = Client (
13
- os .environ .get ('INTERCOM_APP_ID' ),
14
- os .environ .get ('INTERCOM_API_KEY' ))
13
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
15
14
16
15
17
16
class TagTest (unittest .TestCase ):
Original file line number Diff line number Diff line change 8
8
from . import delete_user
9
9
10
10
intercom = Client (
11
- os .environ .get ('INTERCOM_APP_ID' ),
12
- os .environ .get ('INTERCOM_API_KEY' ))
11
+ os .environ .get ('INTERCOM_PERSONAL_ACCESS_TOKEN' ))
13
12
14
13
15
14
class UserTest (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments