Establishing a Connection
The objects available within our connector are accessible from the "cdata.sendgrid" module. To use the module's objects directly:
- Import the module as follows:
import cdata.sendgrid as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("APIKey=abc123;")
You must use an API key to authenticate through the SendGrid connector.
Obtaining an API Key
To obtain an API key, follow the steps below:
- Log into SendGrid.
- Click Settings.
- Click API keys.
- Click Create API Key.
- Choose the Permissions the API Key should have, either Full Access or Restricted Access. The API key is then displayed.
NOTE: If you want access to Email events, you must purchase the Email Activity History add-in of SendGrid. If using a Restricted Access key, you must give it the messages.read and email_activity.read scopes.