Welcome to our self-help documentation

Our fast, easy and intuitive self-service documentation helps you effortlessly get to your answers. If you still don’t find what you need, our 24X7 online Developer Support is always ready to help.

Wrapper APIs

Wrapper API's

Wrapper APIs ensure the developers while switching their code from one of our competition to Pepipost are not required to rewrite any code.

The only thing a developer needs to do while switching from supported competitors is to change API Key and path of the API URL from competition provided values to Pepipost provided values, and they are ready to start sending emails as well as do all other actions like reporting, domain management etc which are supported by Pepipost platform.

Benefits

  • Easy integration - Integrate in 3 easy steps, without spending too much time in coding and re-coding.
  • Code re-usability - Do not waste your time and energies to code again, we have already taken care of that. All your request and response formats remain absolutely same. Just change API keys and URLs, and you are ready to go.
  • Minimal testing - No code change also means no repeat QA. Your code will just work!

Currently Supported

Steps

Prerequisites

Steps for API Integration

  1. Change API Key from your current provider to Pepipost
  2. Change URL from your current provider to respective URL provided by Pepipost
  3. Deploy and test.

Examples

Sendgrid

Pepipost API URL for Sendgrid Migration - https://sgapi.pepipost.com

Sample SendGrid API v3 call:

curl --request POST \
--url https://api.sendgrid.com/v3/mail/send \
--header 'authorization: Bearer <YOUR SENDGRID API KEY>' \
--header 'content-type: application/json' \
--data '{"personalizations":[{"to":[{"email":"<RECIPIENT EMAIL ID>","name":"<RECIPIENT NAME>"}],"subject":"This is a test mail"}],"content": [{"type": "text/plain", "value": "Hello, How are you?"}],"from":{"email":"<FROM EMAIL ID>","name":"<FROM NAME>"}}'

Pepipost Wrapper API version for migration (Note: the only difference being URL and API Key)

curl --request POST \
--url https://sgapi.pepipost.com/v3/mail/send \
--header 'authorization: Bearer <YOUR PEPIPOST API KEY>' \
--header 'content-type: application/json'  \
--data '{"personalizations":[{"to":[{"email":"<RECIPIENT EMAIL ID>","name":"<RECIPIENT NAME>"}],"subject":"This is a test mail"}],"content": [{"type": "text/plain", "value": "Hello, How are you?"}],"from":{"email":"<FROM EMAIL ID>","name":"<FROM NAME>"}}'

Mailgun

Pepipost API URL for Mailgun Migration - https://mgapi.pepipost.com

Sample Mailgun API V3 Call:

curl -s --user 'api:<MAILGUN API KEY>' \
https://api.mailgun.net/v3/<SENDING DOMAIN>/messages \
-F from='<FROM NAME>' \
    -F to='<RECIPIENT EMAILID' \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomeness!'
<?php
# Include the Autoloader (see "Libraries" for install instructions)
require 'vendor/autoload.php';
use Mailgun\Mailgun;

$client = new \Http\Adapter\Guzzle6\Client();
$mgClient = new \Mailgun\Mailgun('<MAILGUN API KEY>', $client);

# Instantiate the client.
$domain = "<SENDING DOMAIN>";

# Make the call to the client.
$result = $mgClient->sendMessage($domain, array(
    'from'    => '<FROM NAME> ',
    'to'      => '<RECIPIENT NAME> ',
    'subject' => 'Hello',
    'text'    => 'Testing some Mailgun awesomness!'
));
?>

Pepipost Wrapper API version for migration (Note: the only difference being URL and API Key)

curl -s --user 'api:<PEPIPOST API KEY>' \
    https://mgapi.pepipost.com/v3/<SENDING DOMAIN>/messages \
    -F from='<FROM NAME> <FROM EMAILID>' \
    -F to='<RECIPIENT EMAILID' \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomeness!'
<?php
# Include the Autoloader (see "Libraries" for install instructions)
require 'vendor/autoload.php';
use Mailgun\Mailgun;

$client = new \Http\Adapter\Guzzle6\Client();
$mgClient = new \Mailgun\Mailgun('<PEPIPOST API KEY>', $client,'mgapi.pepipost.com');     //Changed API KEY and Added PEPIPOST DOMAIN
$mgClient->setApiVersion('v3');    //Changed API Version

# Instantiate the client.

$domain = "<SENDING DOMAIN>";

# Make the call to the client.
$result = $mgClient->sendMessage($domain, array(
    'from'    => '<FROM NAME> ',
    'to'      => '<RECIPIENT NAME> ',
    'subject' => 'Hello',
    'text'    => 'Testing some Mailgun awesomness!'
));
?>

What is covered?

SENDGRID

  • Email Send (POST) - /v3/mail/send
  • Template Add (POST) - /v3/templates/{template_id}/versions
  • Template View (GET) - /v3/templates/{template_id}
  • Template Edit (PATCH) - /v3/templates/{template_id}/versions/{version_id}
  • Stats (GET) - /v3/stats?start_date=2018-11-01&end_date=2018-12-10&aggregated_by=month&limit=1&offset=2
  • Get Categories - /v3/categories
  • Add in suppression (POST) - /v3/asm/groups/<group_id>/suppressions
  • Add in Global Suppression (POST) - /v3/asm/suppressions/global (edited)

MAILGUN

  • Email Send (POST) - /v3/<domain_name>/messages
  • Get Stats - /v3/<domain_name>/stats
  • Get Tag - /v3/<DOMAIN_NAME>/tags
  • View single tag - /v3/<domain_name>/tags/<tag_name>
  • Add Domain (POST) - /v3/domains
  • Whitelist single emailid (DELETE) - /v3/<domain_name>/bounces/<address>, /v3/<domain_name>/unsubscribes/<address>, /v3/<domain_name>/complaints/<address>
  • Add in suppression (POST) - /v3/<domain_name>/bounces, /v3/<domain_name>/complaints, /v3/<domain_name>/unsubscribes (edited)

Wrapper APIs


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.