Getting Started

This is a quick tutorial to get you started using our API. We will show you how to send your first email, how to authenticate with our API and tell you more about MTARGET RESTful API.


Make Your First Request

Give it a go and send your first email. This simple example shows how to send an email with the API in a few easy steps.

  1. You need to enter API_KEY. You will need API_KEY for accessToken. To get access to Transactional MTARGET, you need API_KEY which you can get in the menu Transactional Email > Domain Management through the MTARGET Apps.

  2. After you got your API_KEY you need to find your credentials, the API Key in the Domain Information section.

curl -s \
  -X POST \
  https://trx.mailtarget.co/outbox \
  -H 'Content-Type: application/json' \
  -d '{
    "accessToken": "$MT_APIKEY",
    "from": "$SENDER_EMAIL",
    "to": [
        "$RECIPIENT_EMAIL"
    ],
    "labels": [
        "$LABEL_EMAIL"
    ],
    "subject": "Hello",
    "content": "<!DOCTYPE html><html><head><meta charset=\"utf-8\"/><title>Hello</title></head><body><h3>My First Email Sent by MTARGET</h3></body></html>",
    "track": true
    }'
Parameter Description
$MT_APIKEY Your API Key
$SENDER_EMAIL Sender email address with domain of your register
$RECIPIENT_EMAIL Recipient email address of your test
$LABEL_EMAIL Label email which you use for view report easily



Was this article helpful?
Let's See How They Improved By Using Our Products
Learn how our customers increase their leads and revenue through personalization and many other features. Check their stories!
×

Subscribe

The latest tutorials sent straight to your inbox.