samedi 28 mai 2016

How to use instagram api with guzzle 6+ and laravel?

Im trying to convert this url http://ift.tt/1TLcGWX

Into something I can use with guzzle. So far I've got:

$token = "123456789";    
$client = new \GuzzleHttp\Client();
    $res = $client->request('GET', 'http://ift.tt/1PQwoOc', [
        'access_token' => $token
    ]);
    echo $res->getStatusCode();
    // 200
    echo $res->getHeaderLine('content-type');
    // 'application/json; charset=utf8'
    echo $res->getBody();
    // {"type":"User"...'

but I just get an error that reads:

Client error: `GET http://ift.tt/1PQwoOc` resulted in a `400 BAD REQUEST` response:
{"meta": {"error_type": "OAuthParameterException", "code": 400, "error_message": "Missing client_id or access_token URL (truncated...)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire