{"id":25963583,"url":"https://github.com/drewm/drip","last_synced_at":"2025-03-04T20:47:16.477Z","repository":{"id":56972145,"uuid":"37991380","full_name":"drewm/drip","owner":"drewm","description":"PHP library for making token-based API requests against Drip","archived":false,"fork":false,"pushed_at":"2019-01-31T10:43:23.000Z","size":41,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-09T10:03:50.714Z","etag":null,"topics":["drip","php-library","webhook"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drewm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-24T14:57:56.000Z","updated_at":"2023-07-18T01:59:38.000Z","dependencies_parsed_at":"2022-08-21T10:20:13.578Z","dependency_job_id":null,"html_url":"https://github.com/drewm/drip","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewm%2Fdrip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewm%2Fdrip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewm%2Fdrip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewm%2Fdrip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drewm","download_url":"https://codeload.github.com/drewm/drip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241921824,"owners_count":20042764,"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","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":["drip","php-library","webhook"],"created_at":"2025-03-04T20:47:15.970Z","updated_at":"2025-03-04T20:47:16.470Z","avatar_url":"https://github.com/drewm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drip\nPHP library for making token-based API requests against Drip.\n\n[![Build Status](https://travis-ci.org/drewm/drip.svg)](https://travis-ci.org/drewm/drip)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/drewm/drip/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/drewm/drip/?branch=master)\n\n## Install \n\nEither download and include, or install via Composer:\n\n```\ncomposer require drewm/drip\n```\n\n## Make a simple request\n\nCreate a new Drip object with \n\n1. Your user's API token (Settings \u003e My User Settings \u003e API Token)\n2. Your numeric account ID (Log into the Drip dashboard and it's the first segment in your URL)\n\n```php\nuse DrewM\\Drip\\Drip;\nuse DrewM\\Drip\\Dataset;\n\n$Drip = new Drip('abc123', '1234567')\n```\n\nCreate a new subscriber:\n\n```php\n$data = new Dataset('subscribers', [\n\t\t\t\t'email' =\u003e 'postmaster@example.com',\n\t\t\t]);\n$Response = $Drip-\u003epost('subscribers', $data);\n```\n\nList all subscribers:\n\n```php\n$Response = $Drip-\u003eget('subscribers');\n```\n\nTo request a method without an account ID in the URL, (e.g. list accounts) :\n\n```php\n$Drip = new Drip('abc123');\n$Response = $Drip-\u003egetGlobal('accounts');\n```\n\nTo then subsequently set an account ID:\n\n```php\n$Drip-\u003esetAccountID('1234567');\n```\n\n## Handling responses\n\nMethods return a Response object\n\n```php\nif ($Response-\u003estatus == 200) {\n\t// all is ok!\n\t$subscribers = $Response-\u003esubscribers;\n} else {\n\techo $Response-\u003eerror;\n\techo $Response-\u003emessage;\n}\n```\n\nGet the raw response:\n\n```php\n$raw = $Response-\u003eget();\n```\n\n## Webhooks\n\nYou can listen for webhooks in a couple of ways. The most basic is:\n\n```php\nuse DrewM\\Drip\\Drip;\n$data = Drip::receiveWebhook();\n```\n\nIf you prefer a pub/sub model, you can register listener callables:\n\n```php\nuse DrewM\\Drip\\Drip;\n\nDrip::subscribeToWebhook('subscriber.created', function($data){\n\t// A subscriber was created\n});\n\nDrip::subscribeToWebhook('subscriber.subscribed_to_campaign', function($data){\n\t// A subscriber was added to a campaign\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewm%2Fdrip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrewm%2Fdrip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewm%2Fdrip/lists"}