Help me please

php

#1

i have a problent when i try get a user infor with user/show i get this error {“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]}… if any can help me in it plss this is my code…

<?php
require('twitteroauth/autoload.php');

use Abraham\TwitterOAuth\TwitterOAuth;

define("CONSUMER_KEY", "YBlxxxxxxxxxT3");
define("CONSUMER_SECRET","D3QxxxxxxxxxCkY");

class twitter{

	private $access_token, $access_token_secret, $oauth_token, $oauth_verifier, $cuenta;

	public function __construct()
	{
		$this->access_token = '783xxxxxxxxdtwZO';
		$this->access_token_secret = 'hx6xxxxxxxxRLVA';
		

		$this->cuenta=3;
	}
	public function twitter_user($id)
	{

		$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $this->access_token, $this->access_token_secret);

$trends_available = $connection->get('users/show.json?screen_name='.$id);

echo json_encode($trends_available);
 
					
	}
			}


$consulto=new twitter();
echo $consulto->twitter_user($_POST['cadena']);


?>

#2

That isn’t the documented way of using the TwitterOAuth library. Try something like the examples on https://twitteroauth.com/

$connection->get('users/show', ['screen_name' => $id])

#3

tnk abraham it work


#4