Page 1 of 1

How to use the GMass API

Posted: Mon Dec 09, 2024 6:03 am
by batasakas
We’ve launched a beta version of the GMass API that can handle basic GMass functionality around creating lists and sending campaigns. Over time, we’ll be adding more functionality, like accessing reporting data.

Our API is the only API we know of that allows you to completely create and send a cold email campaign all from within the API, without ever having to do anything in the user interface.
Getting Started
The API is indonesia phone number library mostly RESTful and conforms to OpenAPI standards. To get started with the API:

Create an API Key in your Dashboard. Go to the “API Keys” section.
Visit the API homepage, which serves as a reference for all API methods.
You can perform a test API call to retrieve all the Google Sheet titles in your account

Image

You can access test forms for all methods using our Swagger-generated site here. Note that the Swagger site does include descriptions of methods, but the more c
Authentication
You can authenticate into the API using your API key and passing it either:

Via the query string as “apikey”
Via an HTTP header using X-apikey
Note that it must be passed as “apikey” and not any other variation of that. api-key and api_key will not work.

How to send a campaign
The basic steps of sending a campaign through the API are similar to the steps you would take in the Gmail interface with the Chrome extension.

Determine the Google Sheet and the corresponding Worksheet that your email list is in using the /api/sheets and api/sheets/{sheetid}/worksheets endpoints.
Create a GMass list address (for exampusing the /api/lists endpoint, in which you’ll use the spreadsheetId and worksheetId from step 1.
Create a campaign DRAFT using the /api/campaigndrafts endpoint. You can add CC and BCC addresses here, as well as file attachments. This will return a Gmail DRAFT Id, which you can then use to send a campaign.
Send the campaign with the /api/campaigns endpoint and pass in the Gmail DRAFT Id from step 3, plus other campaign settings.
You can store the GMass alias addresses and reuse them in campaigns, and thereby skip steps 1 and 2 most of the time.

We’ll be adding endpoints, functionality, and better documentation with time.

What else can you do?
Retrieve a list of all your campaigns using the campaigns method.

Retrieve the lists of recipients, opens, clicks, replies, unsubscribes, and bounces for a particular campaign.

Send a transactional email through your Google account. You can view a log of your transactional emails inside your dashboard.

Error handling
All calls to the API will return an HTTP 200 OK status code if the method call is successful.

If you don’t get an HTTP 200 OK status code, your code can assume there has been an error. Error codes include:

HTTP 401 Unauthorized: Passing in an invalid API key
HTTP 400 Bad Request: Passing in an invalid spreadsheet ID or invalid campaign ID
HTTP 404 Not Found: Calling a method that doesn’t exist. For e
HTTP 500 Internal Server Error: Calling a method where the result is an error that is unexpected
Al API errors are logged and reported to our sysadmins. If we see a lot of errors from your account, you’ll likely be hearing from our support team.

Webhooks