Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no oauth token support - only hapikey #8

Open
johnnagro opened this issue Jan 21, 2013 · 0 comments
Open

no oauth token support - only hapikey #8

johnnagro opened this issue Jan 21, 2013 · 0 comments

Comments

@johnnagro
Copy link

If you trace the code, you'll see it ultimately makes a call like <some_api_url>?hapikey=demo when under some circumstances you really should be doing something like <some_api_url>?access_token=demo

demo code below.

<?php
require_once('lib/haPiHP/class.leads.php');
require_once('lib/haPiHP/class.contacts.php');

$HAPIKey = 'demo';


/* Lead Form Example */
$api_endpoint = "http://demo.app1.hubspot.com/?app=leaddirector&FormName=WebstoreOrders";
$leads = new HubSpot_Leads($HAPIKey);

$val = array( 'email' => 'testemail+'.uniqid().'@emailtest.com', 
              'last_order_datetime' => "Mon Jan 21 15:48:31 EST 2013",
              'last_order_date' => "2013.01.21",
              'last_order_time' => "15:48",
              'last_order_number' => "123",
              'last_order_amount' => "15.99" );

echo $leads->add_lead($api_endpoint, $val) . "\n";




/* Contact API Example */
$contacts = new HubSpot_Contacts($HAPIKey);
$unique_email = 'testemail+'.uniqid().'@emailtest.com';
$params =  array('email' => $unique_email, 'firstname' => 'Webster' );
$createdContact = $contacts->create_contact($params);
print_r($createdContact);

?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant