Created
April 9, 2018 19:18
-
-
Save khamidou/803538d0f9f24809f1aa6cb3a1b4c309 to your computer and use it in GitHub Desktop.
Listing calendar events from the Nylas API using PHP and cURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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