Wrapper APIs
Wrapper API's
Wrapper APIs ensure the developers while switching their code from one of our competition to Netcore Email API 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 Netcore Email API 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 Netcore Email API 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
- Create Netcore Email API Account - That's the first step, just go and Signup for a free trial at Netcore Email API.
- Get your api key
Steps for API Integration
- Change API Key from your current provider to Netcore Email API
- Change URL from your current provider to respective URL provided by Netcore Email API
- Deploy and test.
Examples
Sendgrid
Netcore Email API URL for Sendgrid Migration - https://sgapi.netcorecloud.net
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>"}}'
Netcore Email API Wrapper API version for migration (Note: the only difference being URL and API Key)
curl --request POST \
--url https://sgapi.netcorecloud.net/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
Netcore Email API URL for Mailgun Migration - https://mgapi.netcorecloud.net
Sample Mailgun API V3 Call:
curl -s --user 'api:<MAILGUN API KEY>' \
https://api.mailgun.net/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('<MAILGUN API KEY>', $client);
# Instantiate the client.
$domain = "<SENDING DOMAIN>";
# Make the call to the client.
$result = $mgClient->sendMessage($domain, array(
'from' => '<FROM NAME> <<FROM EMAIL>>',
'to' => '<RECIPIENT NAME> <<RECIPIENT EMAIL>>',
'subject' => 'Hello',
'text' => 'Testing some Mailgun awesomness!'
));
?>
Netcore Email API Wrapper API version for migration (Note: the only difference being URL and API Key)
curl -s --user 'api:<PEPIPOST API KEY>' \
https://mgapi.netcorecloud.net/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> <<FROM EMAIL>>',
'to' => '<RECIPIENT NAME> <<RECIPIENT EMAIL>>',
'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/, /v3/<domain_name>/unsubscribes/, /v3/<domain_name>/complaints/
- Add in suppression (POST) - /v3/<domain_name>/bounces, /v3/<domain_name>/complaints, /v3/<domain_name>/unsubscribes (edited)
Updated over 3 years ago