title: How to used aweber api to add new subscriber usign php and aweber OAuth 2.0 Examples
body: <p>i am used aweber api in add subscriber and OAuth 2.0 Examples usign php</p>
  
  <pre><code>require_once('aweber_api/aweber_api.php');
  $body = [
    'ad_tracking' =&gt; 'ebook',
    'custom_fields' =&gt; [
      'apple' =&gt; 'fuji',
      'pear' =&gt; 'bosc'
    ],
    'email' =&gt; 'anand@gmail.com',
    'ip_address' =&gt; '192.168.1.1',
    'last_followup_message_number_sent' =&gt; 0,
    'misc_notes' =&gt; 'string',
    'name' =&gt; 'Anand',
    'strict_custom_fields' =&gt; 'true',
    'tags' =&gt; [
      'slow',
      'fast',
      'lightspeed'
    ]
  ];
  $headers = [
      'Content-Type' =&gt; 'application/json',
      'Accept' =&gt; 'application/json',
      'User-Agent' =&gt; 'AWeber-PHP-code-sample/1.0'
  ];
  $listId='myid';
  $accountId='myid';
  $url = "https://api.aweber.com/1.0/accounts/{$accountId}/lists/{$listId}/subscribers";
  $response = $client-&gt;post($url, ['json' =&gt; $body, 'headers' =&gt; $headers]);
  echo $response-&gt;getHeader('Location')[0];
  </code></pre>
  
  <p>Error Code :</p>
  
  <p>Notice: Undefined variable: client in D:\xampp\htdocs\Aweber\index.php on line 30</p>
  
  <p>Fatal error: Uncaught Error: Call to a member function post() on null in D:\xampp\htdocs\Aweber\index.php:30 Stack trace: #0 {main} thrown in D:\xampp\htdocs\Aweber\index.php on line 30</p>