Select "Create API Key" in the top right-hand corner:
Create your first API Key (Full Access):
Success! You know have your API key. SendGrid will not allow you to view the key again after this window is closed, so be sure to acquire a copy before closing.
Copy this new API Key and paste it into your Plugin Settings area (make sure you include "Bearer " with a space before the API key). It will look something like this: "Bearer YOUR-API-KEYβ
That's it! Navigate to the next pages in this folder to view specific instructions for using each of the 7 calls available.
Find Your List and Contact IDs
Several of the API action calls in this section require a List and/or Contact ID. To find this, head over to your Sendgrid dashboard and navigate to Marketing > Contacts
Select the List you want to work with, then take a look at the URL:
This process is the same for finding a Contact ID. Select the Contact in your List that you want to work with and you'll find the ID in your URL.
Retrieve All Contacts - Data Call
Set up your data source
In this example, we'll use a repeating group to display our data. Since we're using buttons to trigger our API calls, we'll leave the data source blank and use a Display list in RG action to send the results to the repeating group.
Note: You can achieve the same results by assigning the data source directly to this repeating group, rather than the display list in repeating group action.
Type of content = Retrieve All Contacts (Sendgrid Campaigns)
Data source = leave blank
Set up the API call
Now that your repeating group is set up properly, let's configure the workflow action to retrieve all Contacts from Sendgrid and display the results. In this demo, we're using the blue "Retrieve" button to do this.
For this example, we'll leave the default values for page and page_size parameters.
That's it! Let's test this API call.
page_size - This number will indicate how many results per page to return.
page - This number will indicate how many pages of results to return.
Available Parameters (* indicates a required value)
This API call requires a Contact ID. You can find instructions on where to find this value under our How to set up section.
Set up your data source
In this example, we'll use a group to display our data. Since this data call is reliant upon a Contact ID value, we'll use the Display data in group action to send the results of the API call to the group.
Note: You can achieve the same results by assigning the data source directly to this group, rather than the display data in group action.
Type of content = Retrieve Single Recipient (Sendgrid Campaigns)
Data source = leave blank
Set up the API call
Now that your group is set up properly, let's configure the workflow action to retrieve a Contact from Sendgrid and display the results. In this demo, we're using the blue "Retrieve" button to do this.
Next, hook up the input that will be used to input your List ID in the (path) list-id field.
That's it!
Testing your API call
Available Path (* indicates a required value)
contact-id - Enter the ID of the Contact you're wanting to retrieve.
This API call requires a List ID. You can find instructions on where to find this value under our How to set up section.
Set up your data source
In this example, we'll use a group to display our data. Since this data call is reliant upon a List ID value, we'll use the Display data in group action to send the results of the API call to the group.
Note: You can achieve the same results by assigning the data source directly to this group, rather than the display data in group action.
Type of content = Retrieve List (Sendgrid Campaigns)
Data source = leave blank
Set up the API call
Now that your group is set up properly, let's configure the workflow action to retrieve a List from Sendgrid and display the results. In this demo, we're using the blue "Retrieve" button to do this.
Next, hook up the input that will be used to input your List ID in the (path) list-id field.
That's it!
Testing your API call
Available Path (* indicates a required value)
list-id* - Enter the ID of the List you're wanting to retrieve.
This API call requires a Contact ID. You can find instructions on where to find this value under our How to set up section.
Set Up Action
In this example, we'll take a value from an input element and generate a List in Sendgrid!
That's it! Run this API call and check your Sendgrid account for the absence of those Contacts.
β
Note: This API call can accept a list of Contact emails. Make sure you comma separate your values if you choose to run multiple emails through this call at once.
Available Parameters (* indicates a required value)
ids* - Enter a comma-separated list of IDs of the Contacts you'd like to delete.
This API call requires a List and Contact ID. You can find instructions on where to find these values under our How to set up section.
Set Up Action
In this example, we'll take values from two inputs to specify the Contact we're removing and from which List it's being removed from.
That's it! Run this API call and check your Sendgrid account for the absence of the specified Contacts from your List.
β
Note: This API call can accept a list of Contact emails. Make sure you comma separate your values if you choose to run multiple emails through this call at once.
Available Path (* indicates a required value)
list-id* - Enter the ID of the List you're wanting to remove a Contact from.
Available Parameters (* indicates a required value)
contact_ids* - Enter a comma-separated list of IDs of the Contacts you'd like to remove.
Create a Contact - Action
This API call requires a List ID. You can find instructions on where to find this value under our How to set up section.
That's it! Run this API call and check your Sendgrid account for the newly created contact.
Available Parameters (* indicates a required value)
list-id* - Enter the ID of the List you want to add this new Contact to.
email* - Enter the email address of your new Contact.
first-name* - Enter the first name of your new Contact.
last-name* - Enter the last name of your new Contact.
In this example, we'll use a repeating group to display our data. Since we're using buttons to trigger our API calls, we'll leave the data source blank and use a Display list in RG action to send the results to the repeating group.
Note: You can achieve the same results by assigning the data source directly to this repeating group, rather than the display list in repeating group action.
Type of content = Retrieve All Lists (Sendgrid Campaigns)
Data source = leave blank
Set up the API call
Now that your repeating group is set up properly, let's configure the workflow action to retrieve all Lists from Sendgrid and display the results. In this demo, we're using the blue "Retrieve" button to do this.
That's it! Let's test this API call.
Changelogs
Update 26.06.23 - Version 4.4.0
Updated description
Update 26.06.23 - Version 4.3.0
Updated the description
Update 09.06.22 - Version 4.2.0
Updated Documentation
Update 19.05.22 - Version 4.1.0
Bug fix for the Create a Contact API call.
Update 18.05.22 - Version 4.0.0
A List ID field was added to the Update List API call. Please review any existing actions to ensure they have a List ID.
Update 13.02.21 - Version 3.2.0
Cleared out default values so that placeholders don't end up saving to contacts with empty fields
Update 14.01.21 - Version 3.1.1
Bug fix for "remove contact" call
Update 13.07.20 - Version 3.1.0
Added a new call to "Delete Contact from List"
Update 28.11.19 - Version 3.0.0
Updated all calls to support Sendgrid's new version of Marketing Contacts/Lists. If you're using the new version, please upgrade to this version. If you're on the legacy version, you should stay on version 1.1.0 until you transition.
Update 28.11.19 - Version 2.0.0
Updated the Retrieve All Lists call to support Sendgrid's new version of Marketing Contacts/Lists
Update 28.11.19 - Version 1.2.1
Bug Fix in "Retrieve All Lists" call
Update 02.10.19 - Version 1.2.0
New call added: Retrieve All Lists
Update 19.07.18 - Version 1.1.0
Very minor update to hide a required header users don't need to edit.