Last active
March 12, 2017 15:33
-
-
Save nidup/c22e0c4eeb4f22f0ea906a291ec213a2 to your computer and use it in GitHub Desktop.
Akeneo Web API, get products
This file contains hidden or 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 | |
$host = "http://pim-ce-17-odm.local/app_dev.php/"; | |
$url = $host."api/rest/v1/products"; | |
$tokenType = "Bearer"; | |
$accessToken = "M2IzMTFlYTE0MDZjNTc4YTlhNjNiY2I4MTdhYTRhNTMxMjlkY2FhYWRiYWM3MjMyMTgzZjdmZTIyMDExMDk1Yw"; | |
$headers = array(); | |
$headers[] = 'Content-Type: application/json'; | |
$headers[] = 'Authorization: '.$tokenType.' '.$accessToken; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); | |
$result = curl_exec($ch); | |
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment