Skip to content

Instantly share code, notes, and snippets.

@jagroop
Last active July 2, 2018 10:30
Show Gist options
  • Save jagroop/bd90344bd610963b617ec414c252c782 to your computer and use it in GitHub Desktop.
Save jagroop/bd90344bd610963b617ec414c252c782 to your computer and use it in GitHub Desktop.
<?php
$public_key = 'd27a3b3fef7b3050856084526c43fab3';
$private_key = '2d0be36e46e8049c9ec5325869e4452e';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.mailjet.com/v3/REST/contactslist");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_USERPWD, $public_key . ":" . $private_key);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
echo "<pre>";
print_r($result);
echo "</pre>";
die;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment