Documentation Index
Fetch the complete documentation index at: https://docs.morph-data.io/llms.txt
Use this file to discover all available pages before exploring further.
Connecting to Intercom
For an overview of connectors, please refer to the following link:
Create a Connector
Select the “Connectors” tab on the homepage and click the “Create” button.
Enter Intercom Credentials
Select Intercom and click the sign-in button.
After entering the information, click the Create button to complete the creation. If there are any errors in the parameters, an error message will be displayed, so please check the connection details again. Retrieve access_token from the Created Connector
Once the creation is successful, you can retrieve the connector name from the list.Use the dedicated function to enter the connector name in the Python code and retrieve the access_token.import morph
from morph import MorphGlobalContext
from morph_lib.api import get_auth_token
@morph.func
def main(context: MorphGlobalContext):
access_token = get_auth_token("connection_name")
# ↓↓↓ Process using access_token ↓↓↓
For the local version, you currently need to directly write the credentials in ~/.morph/connections.yml. Please create it using the dashboard if you prefer other methods.
Edit connections.yml
If the file ~/.morph/connections.yml does not exist, please create it beforehand and then edit it.mkdir ~/.morph
touch ~/.morph/connections.yml
connections:
intercom-connection: # Any unique name
type: intercom # Fixed
method: intercom_oauth # Fixed
refresh_token: str
client_id: str
client_secret: str
redirect_uri: str
access_token: str # Optional
Use the Connector in Code to Retrieve Data
Use the dedicated function to enter the connector name in the Python code and retrieve the access_token.import morph
from morph import MorphGlobalContext
from morph_lib.api import get_auth_token
@morph.func
def main(context: MorphGlobalContext):
access_token = get_auth_token("connection_name")
# ↓↓↓ Process using access_token ↓↓↓
Refreshing the access_token is a feature of the dashboard, so the one specified will always be used in the local environment.When actually specifying and executing a file with a connector, the priority is as follows:
Also, please note that only connectors created in the dashboard can be used in environments where morph deploy has been performed.
- Connectors listed in
~/.morph/connections.yml on the local machine
- Connectors registered in the cloud