Skip to content

Instantly share code, notes, and snippets.

@khamidou
Created April 9, 2018 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khamidou/803538d0f9f24809f1aa6cb3a1b4c309 to your computer and use it in GitHub Desktop.
Save khamidou/803538d0f9f24809f1aa6cb3a1b4c309 to your computer and use it in GitHub Desktop.
Listing calendar events from the Nylas API using PHP and cURL
<?php
$ACCESS_TOKEN = "YOUR_ACCESS_TOKEN";
$ch = curl_init("https://api.nylas.com/events");
# Pass the access token as an HTTP basic auth username
curl_setopt($ch, CURLOPT_USERPWD, $ACCESS_TOKEN . ":");
# Return response instead of printing.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
# Send request.
$result = curl_exec($ch);
curl_close($ch);
# Print response.
echo $result;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment