Skip to content

Instantly share code, notes, and snippets.

@MarkoKaartinen
Last active February 3, 2017 06:30
Show Gist options
  • Save MarkoKaartinen/8f2a89aa8fc103e61ea6122e440197f8 to your computer and use it in GitHub Desktop.
Save MarkoKaartinen/8f2a89aa8fc103e61ea6122e440197f8 to your computer and use it in GitHub Desktop.
Lyhyt.fi esimerkki (user)
<?php
$ch = curl_init('https://lyhyt.fi/api/user');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// headers
$headers = [
'Authorization: Bearer APITOKEN',
'Accept: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo "<pre>";
print_r($response);
echo "</pre>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment