Skip to content

no oauth token support - only hapikey #8

Description

@johnnagro

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);

?>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions