Coder Social home page Coder Social logo

hubspot-php's Introduction

HubSpot PHP API client

Version Total Downloads License Scrutinizer Code Quality Build Status

A new HubSpot API client. The sequel to my perfectly functional wrapper of HubSpot/haPihP. client. However, this includes some of the new COS/v2 endpoints.

BETA

Please try it out, and let me know if things are working as expected.

Setup

Composer:

"require": {
	"fungku/hubspot-php": "~0.9@dev"
}

Quickstart

Instantiate hubspot service

All following examples assume this step.

Note: The Hubspot class checks for a HUBSPOT_API_KEY environment variable if you don't include one during instantiation.

$hubspot = Fungku\HubSpot\HubSpotService::make('api-key');

Get a single contact:

$contact = $hubspot->contacts()->getByEmail("[email protected]");

Paginate through all contacts:

// Get an array of 10 contacts
// getting only the firstname and lastname properties
// and set the offset to 123456
$collection = $hubspot->contacts()->all([
        'count'     => 10,
        'property'  => ['firstname', 'lastname'],
        'vidOffset' => 123456,
]);

foreach ($collection['contacts'] as $contact) {
    echo $contact['properties']['firstname']['value'];
}

// Info for pagination
echo $collection['has-more'];
echo $collection['vid-offset'];

Get a group of contacts by Ids

$vids = [196189, 196188, 196187];

// Get batch of contacts, and limit properties to firstname
$contacts = $hubspot->contacts()->getBatchByIds($vids, ['property' => 'firstname']);

foreach ($contacts as $contact) {
    echo $contact['properties']['firstname']['value'];
}

Status

(:ballot_box_with_check: Complete, :wavy_dash: In Progress, :white_medium_small_square: Todo, :black_medium_small_square: Not planned)

If you see something not planned, that you want, make an issue and there's a good chance I will add it.

โ˜‘๏ธ Blog (COS) ๐Ÿ†•

โ˜‘๏ธ Blog Posts (COS) ๐Ÿ†•

โ˜‘๏ธ Contacts

โ˜‘๏ธ Contact Lists

โ˜‘๏ธ Contact Properties

โ˜‘๏ธ Email ๐Ÿ†•

โ˜‘๏ธ Email Events ๐Ÿ†•

โ˜‘๏ธ Files (COS) ๐Ÿ†•

โ˜‘๏ธ Forms

โ˜‘๏ธ Keywords

โ˜‘๏ธ Page Publishing (COS) ๐Ÿ†•

โ˜‘๏ธ Social Media

โ˜‘๏ธ Workflows

โ—พ Blog (CMS)

โ—พ Companies ๐Ÿ†•

โ—พ Companies Properties ๐Ÿ†•

โ—พ Deals ๐Ÿ†•

โ—พ MarketPlace

โ—พ Settings

hubspot-php's People

Contributors

nediam avatar ryanwinchester avatar scrutinizer-auto-fixer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.