{"id":31970517,"url":"https://github.com/hubspot/hubspot-php","last_synced_at":"2025-10-14T19:16:02.773Z","repository":{"id":23058877,"uuid":"26412217","full_name":"HubSpot/hubspot-php","owner":"HubSpot","description":"HubSpot PHP API Client","archived":false,"fork":false,"pushed_at":"2025-06-26T14:45:10.000Z","size":1649,"stargazers_count":366,"open_issues_count":2,"forks_count":195,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-09-12T21:43:03.189Z","etag":null,"topics":["api","api-client","api-rest","api-wrapper","hubspot","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HubSpot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-11-09T22:53:56.000Z","updated_at":"2025-09-05T20:21:03.000Z","dependencies_parsed_at":"2024-06-18T11:08:56.118Z","dependency_job_id":"f6cab818-e237-4755-9657-e15cd40c8891","html_url":"https://github.com/HubSpot/hubspot-php","commit_stats":{"total_commits":630,"total_committers":100,"mean_commits":6.3,"dds":0.680952380952381,"last_synced_commit":"3918e2fdcd7bdb93ac539b4046a5cebf30a5ecdc"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/HubSpot/hubspot-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2Fhubspot-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2Fhubspot-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2Fhubspot-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2Fhubspot-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HubSpot","download_url":"https://codeload.github.com/HubSpot/hubspot-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2Fhubspot-php/sbom","scorecard":{"id":63569,"data":{"date":"2025-08-11","repo":{"name":"github.com/HubSpot/hubspot-php","commit":"2d37f7edce728851f78e1012d448abd3f42201dc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":7,"reason":"9 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating php:8.1.8-cli to php:8.1.8-cli@sha256:ad5e56e971853a682ddb0b600ca47c4141f1dd38827d093a142bd0e86f0fa480","Warn: downloadThenRun not pinned by hash: Dockerfile:3","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'v2'","Warn: branch protection not enabled for branch 'v1'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T02:11:10.858Z","repository_id":23058877,"created_at":"2025-08-15T02:11:10.859Z","updated_at":"2025-08-15T02:11:10.859Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020649,"owners_count":26086895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","api-rest","api-wrapper","hubspot","php"],"created_at":"2025-10-14T19:15:55.736Z","updated_at":"2025-10-14T19:16:02.762Z","avatar_url":"https://github.com/HubSpot.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HubSpot PHP API client\n\n[![Version](https://img.shields.io/packagist/v/hubspot/hubspot-php.svg?style=flat-square)](https://packagist.org/packages/hubspot/hubspot-php)\n[![Total Downloads](https://img.shields.io/packagist/dt/hubspot/hubspot-php.svg?style=flat-square)](https://packagist.org/packages/hubspot/hubspot-php)\n[![Build Status](https://travis-ci.org/hubspot/hubspot-php.svg?branch=master)](https://travis-ci.org/hubspot/hubspot-php)\n[![License](https://img.shields.io/packagist/l/hubspot/hubspot-php.svg?style=flat-square)](https://packagist.org/packages/hubspot/hubspot-php)\n\n[Hubspot](https://www.hubspot.com/) is a marketing, sales, and service software that helps your business grow without compromise. Because “good for the business” should also mean “good for the customer.”\n\n## This library supports only [legacy API](https://legacydocs.hubspot.com/docs/overview)\n\nPlease consider switching to [the latest API](https://github.com/HubSpot/hubspot-api-php).\n\n## Setup\n\n**Composer:**\n\n```bash\ncomposer require \"hubspot/hubspot-php\"\n```\n\n## Sample apps\n\n[Link](https://github.com/HubSpot/integration-examples-php)\n\n## Quickstart\n\n### Examples Using Factory\n\nAll following examples assume this step.\n\n```php\n$hubspot = SevenShores\\Hubspot\\Factory::create('api-key');\n\n// OR create with access token (OAuth2 or Private App)\n\n$hubspot = SevenShores\\Hubspot\\Factory::createWithAccessToken('access-token');\n\n// OR instantiate by passing a configuration array.\n// The only required value is the 'key'\n// Please note: as of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported.\n\n$hubspot = new SevenShores\\Hubspot\\Factory([\n    'key'      =\u003e 'demo',\n    'oauth2'   =\u003e false, // default\n]);\n\n// Then you can call a resource\n// When referencing endpoints, use camelCase\n\n$hubspot-\u003econtactlists\n```\n\nYou can find more information about oauth2 access tokens [here](https://developers.hubspot.com/docs/api/oauth/tokens) and about private app access token [here](https://developers.hubspot.com/docs/api/private-apps).\n\n*Note:* You can prevent any error handling provided by this package by passing following options into client creation routine:\n(applies also to `Factory::create()` and `Factory::createWithAccessToken()`)\n\n```php\n$hubspot = new SevenShores\\Hubspot\\Factory(\n    [\n        'key' =\u003e 'demo',\n    ],\n    null,\n    [\n        'http_errors' =\u003e false // pass any Guzzle related option to any request, e.g. throw no exceptions\n    ],\n    false // return Guzzle Response object for any -\u003erequest(*) call\n);\n```\n\nBy setting `http_errors` to false, you will not receive any exceptions at all, but pure responses.\nFor possible options, see http://docs.guzzlephp.org/en/latest/request-options.html.\n\n#### API Client comes with Middleware for implementation of Rate and Concurrent Limiting\n\nIt provides an ability to turn on retry for failed requests with statuses 429 or 500. You can read more about working within the HubSpot API rate limits [here](https://developers.hubspot.com/docs/faq/working-within-the-hubspot-api-rate-limits).\n\n```php\n$handlerStack = \\GuzzleHttp\\HandlerStack::create();\n$handlerStack-\u003epush(\n    \\SevenShores\\Hubspot\\RetryMiddlewareFactory::createRateLimitMiddleware(\n        \\SevenShores\\Hubspot\\Delay::getConstantDelayFunction()\n    )\n);\n\n$handlerStack-\u003epush(\n    \\SevenShores\\Hubspot\\RetryMiddlewareFactory::createInternalErrorsMiddleware(\n        \\SevenShores\\Hubspot\\Delay::getExponentialDelayFunction(2)\n    )\n);\n\n$guzzleClient = new \\GuzzleHttp\\Client(['handler' =\u003e $handlerStack]);\n\n$config = [\n    'key' =\u003e 'access token',\n    'oauth2' =\u003e true,\n];\n\n$hubspot = new \\SevenShores\\Hubspot\\Factory($config, new \\SevenShores\\Hubspot\\Http\\Client($config, $guzzleClient));\n```\n\n#### Get a single contact\n\n```php\n$contact = $hubspot-\u003econtacts()-\u003egetByEmail(\"test@hubspot.com\");\n\necho $contact-\u003eproperties-\u003eemail-\u003evalue;\n```\n\n#### Paginate through all contacts\n\n```php\n// Get an array of 10 contacts\n// getting only the firstname and lastname properties\n// and set the offset to 123456\n$response = $hubspot-\u003econtacts()-\u003eall([\n    'count'     =\u003e 10,\n    'property'  =\u003e ['firstname', 'lastname'],\n    'vidOffset' =\u003e 123456,\n]);\n```\n\nWorking with the data is easy!\n\n```php\nforeach ($response-\u003econtacts as $contact) {\n    echo sprintf(\n        \"Contact name is %s %s.\" . PHP_EOL,\n        $contact-\u003eproperties-\u003efirstname-\u003evalue,\n        $contact-\u003eproperties-\u003elastname-\u003evalue\n    );\n}\n\n// Info for pagination\necho $response-\u003e{'has-more'};\necho $response-\u003e{'vid-offset'};\n```\n\nor if you prefer to use array access?\n\n```php\nforeach ($response['contacts'] as $contact) {\n    echo sprintf(\n        \"Contact name is %s %s.\" . PHP_EOL,\n        $contact['properties']['firstname']['value'],\n        $contact['properties']['lastname']['value']\n    );\n}\n\n// Info for pagination\necho $response['has-more'];\necho $response['vid-offset'];\n```\n\nNow with response methods implementing [PSR-7 ResponseInterface](https://github.com/php-fig/http-message/tree/master/src)\n\n```php\n$response-\u003egetStatusCode()   // 200;\n$response-\u003egetReasonPhrase() // 'OK';\n// etc...\n```\n\n### Example Without Factory\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse SevenShores\\Hubspot\\Http\\Client;\nuse SevenShores\\Hubspot\\Endpoints\\Contacts;\n\n$client = new Client(['key' =\u003e 'access token', 'oauth2' =\u003e true,]);\n\n$contacts = new Contacts($client);\n\n$response = $contacts-\u003eall();\n\nforeach ($response-\u003econtacts as $contact) {\n    //\n}\n```\n\n### Example of using built in utils\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse SevenShores\\Hubspot\\Utils\\OAuth2;\n\n$authUrl = OAuth2::getAuthUrl(\n    'clientId',\n    'http://localhost/callaback.php',\n    'contacts'\n);\n\n```\n\nor using Factory:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse SevenShores\\Hubspot\\Utils;\n\n$authUrl = Utils::getFactory()-\u003eoAuth2()-\u003egetAuthUrl(\n    'clientId',\n    'http://localhost/callaback.php',\n    'contacts'\n);\n\n```\n\n## Status\n\nIf you see something not planned, that you want, make an [issue](https://github.com/HubSpot/hubspot-php/issues) and there's a good chance I will add it.\n\n- [x] Analytics API\n- [x] Companies API :updated:\n- [x] Company Properties API :updated:\n- [x] Contacts API :updated:\n- [x] Contact Lists API :updated:\n- [x] Contact Properties API :updated:\n- [ ] Conversations Live Chat Widget API (Front End)\n- [x] CMS Blog API (Blogs) :updated:\n- [x] CMS Blog Authors API (BlogAuthors) :updated:\n- [x] CMS Blog Comments API (BlogComments)\n- [x] CMS Blog Post API (BlogPosts)\n- [x] CMS Blog Topics API (BlogTopics)\n- [ ] CMS Domains API\n- [x] CMS Files API (Files)\n- [x] CMS HubDB API (HubDB) :updated:\n- [ ] CMS Layouts API\n- [x] CMS Page Publishing API (Pages)\n- [ ] CMS Site Maps\n- [ ] CMS Site Search API\n- [ ] CMS Templates API\n- [ ] CMS URL Mappings API\n- [x] CRM Associations API\n- [ ] CRM Extensions API\n- [x] CRM Object Properties API (ObjectProperties) :new:\n- [x] CRM Pipelines API (CrmPipelines)\n- [x] Deals API\n- [x] Deal Properties API :updated:\n- [x] Ecommerce Bridge API :updated:\n- [x] Email Subscription API :updated:\n- [x] Email Events API :updated:\n- [x] Engagements API\n- [x] Events API\n- [x] Forms API :updated:\n- [x] Line Items API :new:\n- [ ] Marketing Email API\n- [x] Owners API :updated:\n- [x] Products API :new:\n- [x] Social Media API\n- [x] Tickets API\n- [x] Timeline API :updated:\n- [ ] Tracking Code API\n- [x] Transactional Email API\n- [x] Workflows API :updated:\n- [x] Webhooks API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubspot%2Fhubspot-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhubspot%2Fhubspot-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubspot%2Fhubspot-php/lists"}