SendGrid
The SendGrid UI lets you create API keys with full access, but we strongly recommend creating an API key with limited scopes when connecting SendGrid to Trelica.
The specific scopes required by Trelica can't be created through the SendGrid user interface, so we recommend temporarily creating a full access API key, and then using the API to create a limited scope key, and then delete the full access key.
First log in to SendGrid as an administrator and go to Settings > API Keys and click Create API Key:
%20(3).png?alt=media&token=d5979dfc-838d-46a1-aea8-ea14bce51f10)
Give your key a name (e.g. Temp Full Access) and choose Full Access permissions and click Create & View:
%20(4).png?alt=media&token=1b0ec7bd-90d9-489a-a0ea-7e3cfe2efd35)
You will be shown the new API key. Click on it to paste it to the clipboard:
%20(5).png?alt=media&token=a6908bb0-c6ad-40ab-b725-5c5d9a9f8939)
Now we can use the full access API key to create a limited scope key.
Go to the command line and run the following curl command, substituting {API_KEY} for the full access API key:
curl --location --request POST 'https://api.sendgrid.com/v3/api_keys' \
--header 'Authorization: Bearer {API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Trelica", "scopes": ["teammates.read"] }' \
| jq .
If you don't have
jq
installed, just skip the piping in the final line. jq just formats the JSON response more neatly for you.The command should output something like this:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 217 100 166 100 51 342 105 --:--:-- --:--:-- --:--:-- 447
{
"api_key": "SG....................................-dKdIgFgY",
"api_key_id": "ynfH3dkkSYfdvQRKIjcP5Q",
"name": "Trelica",
"scopes": [
"teammates.read"
]
}
You need the longer
"api_key"
attribute, not the "api_key_id"
one.Copy the value for the
api_key
attribute (excluding the quotation marks) and paste it into Trelica when asked, when you connect the integration.Once you've generated the limited scope key, you can tidy up the full access one. Just go back to SendGrid and delete it:
%20(6).png?alt=media&token=12ca91d0-3eae-4cb3-949e-1f1f36c077ad)
Be sure to delete the temporary Full Access token you created at the start, and not the limited scope Trelica token you just created.
Last modified 1yr ago