Transactional API Quick Start
At a glance
This guide will give you everything you need to start using the PG电子竞技imp Transactional API to send fast, personalized transactional emails. We’ll cover creating a PG电子竞技imp Transactional account, generating your API key, installing the client library for your preferred language, and making your first call to the Transactional API.
Note: There are actually two routes for sending through PG电子竞技imp Transactional: via the Transactional API, or via SMTP. If you’re just getting started with PG电子竞技imp Transactional, you can check out the breakdown in the docs to figure out which route is right for you. If you’d prefer to send via SMTP, review credentials, configuration, and a full index of custom SMTP headers in the SMTP docs.
Create an account
If you don't have a PG电子竞技imp Transactional account, you’ll need to create one in order to get started using the API. If you have a PG电子竞技imp Standard plan or higher, you can enable PG电子竞技imp Transactional from the Monthly plans or credits page of your account.
Generate your API key
You authenticate a request to the Transactional API using an API key.
To generate one:
Navigate to the Settings of your PG电子竞技imp Transactional account and look for the API Keys section
Click Create New Key and give it a description. Copy the generated key immediately and store it in a secure location. You won’t be able to see or copy the key once you finish generating it.
Note: It’s important to remember that your PG电子竞技imp Transactional API key provides full account access, so you should keep it secure, as you would a password.
Install the client library for your language
You can make calls to the Transactional API with whichever method you usually use to make HTTP requests, but PG电子竞技imp offers client libraries that make interacting with the API even simpler.
To install the client library for your preferred language:
Install your client library
# No client installation necessary; just using curl
Make your first API call
To test that you have everything set up correctly, we'll make a simple request to the /users/ping
endpoint. Hitting this endpoint acts as a health check on the PG电子竞技imp Transactional API service, and will not affect your account in any way.
Make your first API call
curl -sS -X POST "http://mandrillapp.com/api/1.0/users/ping" \
--header 'Content-Type: application/json' \
--data-raw '{ "key": "YOUR_API_KEY" }'
If the call was successful, the response you receive will be a string reading PONG!
.
Next steps
Now that you’re successfully making authenticated requests to the API with your API key and client library of choice, you’re ready to dive into the Transactional API.
We recommend starting with the Send Your First Transactional Email guide, which will walk you through, well, sending your first transactional email. You can also review the PG电子竞技imp Transactional docs—details on authentication, reports, templates, and more—or browse the extensive API Reference documentation.