Skip to content

mailnjoy/check-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accèder à la version française

Logo

API partenaire de Check by Mailnjoy

is an email address validation solution.
The API provides simple, automated and secure access to Check's services.

Table des matières

About Mailnjoy

Introduction

Mailnjoy is a company specialized in email marketing. It offers various value-added tools in this field. Check is one of these products, enabling you to confirm the existence and commercial interest of an email address.

Contact (become a beta tester)

If you are interested in this service and would like to use it, please visit our website: check.mailnjoy.com

QuickStart

Follow the steps adapted to your use case (validation of a single e-mail / many e-mails). In all cases, you'll need to satisfy the prerequisites first.

Prerequisites

Each call to the API must be authenticated by a login/secret pair. To obtain access to the API, you first need to create a developer key, via the site dedicated to developers: https://developer.mailnjoy.com

Once authenticated, go to the API Accounts tab.

API Accounts tab

On this page, you can create new keys, by specifying:

  • The name of the key
  • Whether or not the key can modify your data (this parameter will be useful for future functions)
  • Whether the key can spend credits (authorize purchases). This parameter must be enabled to validate e-mail addresses, as this action consumes credits.

Key creation

You can also consult existing keys and retrieve id/secret pairs in the following section

View existing keys

Finally, by clicking on the button to the right of the key, you can access the key's details, such as id, secret or creation date.

Key details

You also have the option of deleting the key. Please note that this action is definitive; you will not be able to retrieve this key at a later date.

Unit validation

All examples are available in the folder examples

Node.js

Define your credentials and the url of the unit validation API

const mailnjoyId = "myId"
const mailnjoySecret = "mySecret"
const mailnjoyUnitaryPath = "https://api.mailnjoy.com/v1/unitary"

You can then make the call (here using the http client axios)

axios.post(
  mailnjoyUnitaryPath + "?type=simple", // on fait ici une validation simple
  "example.address@somedomain.com", // l'adresse email que vous souhaitez valider
  {
    "headers": { // on précise dans les headers les credentials et le type de la payload
      "mailnjoy-id": mailnjoyId,
      "mailnjoy-secret": mailnjoySecret ,
      "Content-Type": "text/plain"
    }
  }
).then(result => {
  console.log(result.data)
}).catch(error => {
  console.log(error)
})

Full example available here

php

Define your credentials and the url of the unit validation API

define("MAILNJOY_ID","myId");
define("MAILNJOY_SECRET","mySecret");
define("MAILNJOY_SERVER","https://api.mailnjoy.com/");

You can then make the call (here using the http client CURL)

$curl = curl_init();

curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "example.address@somedomain.com");
curl_setopt($curl, CURLOPT_URL, MAILNJOY_SERVER."v1/unitary/?type=simple"); // on fait ici une validation simple
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

// on précise dans les headers les credentials et le type de la payload
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "mailnjoy-id: ".MAILNJOY_ID,
  "mailnjoy-secret: ".MAILNJOY_SECRET,
  "Content-Type: text/plain"
));

$result = curl_exec($curl);
if(!$result) {
  echo curl_error($curl);
} else {
  print_r(json_decode($result,true));
}

curl_close($curl);

Full example available here

Mass validation

List validation enables you to validate a large number of e-mail addresses, with a quality equivalent to that of unit validation. These validations cost less (1 credit per address) but are less rapid.

It is now possible to perform these validations en masse via SFTP. More information is available on the [Developer] site (https://developer.mailnjoy.com/page-home), in the "SFTP Documentation" section.

This type of validation is not currently possible via API (consult API roadmap).

Bonus - Check credit balance

Using the previous developer key, you can query the API to obtain the credit balance of the parent account. This can be useful for uploading information to an interface or for setting up balance monitoring.

All examples are available in the folder examples

Node.js

Using the previous credentials, we just add another endpoint to the base url

const mailnjoyId = "myId"
const mailnjoySecret = "mySecret"
const mailnjoyCreditPath = "https://api.mailnjoy.com/v1/credit"

You can then make the call in the same way (here with the same http client axios)

axios.get(
  mailnjoyCreditPath,
  {
    "headers": {
      "mailnjoy-id": mailnjoyId,
      "mailnjoy-secret": mailnjoySecret
    }
  }
).then(result => {
  console.log(result.data) // the content is only an integer: your credit balance
}).catch(error => {
  console.log(error)
})

Full example here

php

Define your credentials and the url of the unit validation API

define("MAILNJOY_ID","myId");
define("MAILNJOY_SECRET","mySecret");
define("MAILNJOY_SERVER","https://api.mailnjoy.com/");

You can then make the call (here still using CURL)

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, MAILNJOY_SERVER."v1/credit/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  "mailnjoy-id: ".MAILNJOY_ID,
  "mailnjoy-secret: ".MAILNJOY_SECRET,
));

$result = curl_exec($curl);
if(!$result) {
  echo curl_error($curl);
} else {
  echo $result." credits left";
}

curl_close($curl);

Full example here

Going further

The technical description of the API is available on the SwaggerHub.

We offer a number of services to facilitate the integration of our API with your services: SDK, development server, ...

To find out more about these tools, see examples of integrations or explore the API's possibilities further, we invite you to read the full documentation and visit the Mailnjoy dedicated developer site.

Roadmap

The roadmap for this API is available on Trello.

Like our services, the API is still in its infancy. We already have a number of features in mind that will enhance your development experience, and we're also listening to your feedback.

Do you have a need or an idea for improving our API? You can send your suggestions to our dedicated e-mail address: contact-developer@mailnjoy.com

Contact

For any technical questions relating to the API, documentation or integration of Mailnjoy services, you can contact us by e-mail at contact-developer@mailnjoy.com or via the contact tab on the developer site (developer.mailnjoy.com).

If you would like to contact us with a question about Mailnjoy services or would like to become a beta tester, you can reach us via the standard contact address contact@mailnjoy.com or via the contact tab on the Check site, if you have access to it.

License

API and SDK documentation is distributed under the MIT license. Please refer to the LICENSE file for more information.

About

API partenaire de Check by Mailnjoy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors