{"id":50464513,"url":"https://github.com/campaignmonitor/createsend-php","last_synced_at":"2026-06-17T22:01:29.963Z","repository":{"id":1202303,"uuid":"1111135","full_name":"campaignmonitor/createsend-php","owner":"campaignmonitor","description":"A PHP library for the Campaign Monitor API","archived":false,"fork":false,"pushed_at":"2025-06-18T03:31:26.000Z","size":1348,"stargazers_count":283,"open_issues_count":37,"forks_count":101,"subscribers_count":43,"default_branch":"master","last_synced_at":"2026-03-14T22:52:14.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://campaignmonitor.github.io/createsend-php","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/campaignmonitor.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.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}},"created_at":"2010-11-25T03:48:14.000Z","updated_at":"2026-02-02T10:49:24.000Z","dependencies_parsed_at":"2024-01-05T22:20:18.018Z","dependency_job_id":"78a09f6d-8515-4a94-a567-8efd04d05848","html_url":"https://github.com/campaignmonitor/createsend-php","commit_stats":{"total_commits":303,"total_committers":44,"mean_commits":6.886363636363637,"dds":0.7095709570957096,"last_synced_commit":"3ac6d4d2721f6529a2cae2515f7e88a17baa7d19"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/campaignmonitor/createsend-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/campaignmonitor%2Fcreatesend-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/campaignmonitor%2Fcreatesend-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/campaignmonitor%2Fcreatesend-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/campaignmonitor%2Fcreatesend-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/campaignmonitor","download_url":"https://codeload.github.com/campaignmonitor/createsend-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/campaignmonitor%2Fcreatesend-php/sbom","scorecard":{"id":263822,"data":{"date":"2025-08-11","repo":{"name":"github.com/campaignmonitor/createsend-php","commit":"84e87246b855bd262bb51a0bbf76ede5e2066f3e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"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":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":5,"reason":"Found 6/12 approved changesets -- score normalized to 5","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":"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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"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":"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":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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":"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":"SAST","score":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: non-200 OK status code: 502 Bad Gateway body: \"\u003chtml\u003e\\r\\n\u003chead\u003e\u003ctitle\u003e502 Bad Gateway\u003c/title\u003e\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n\u003ccenter\u003e\u003ch1\u003e502 Bad Gateway\u003c/h1\u003e\u003c/center\u003e\\r\\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\"","details":null,"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-17T11:27:42.743Z","repository_id":1202303,"created_at":"2025-08-17T11:27:42.744Z","updated_at":"2025-08-17T11:27:42.744Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34466930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":[],"created_at":"2026-06-01T06:32:45.163Z","updated_at":"2026-06-17T22:01:29.956Z","avatar_url":"https://github.com/campaignmonitor.png","language":"PHP","funding_links":[],"categories":["Table of Contents"],"sub_categories":["Globalization"],"readme":"# createsend [![Build Status](https://app.travis-ci.com/campaignmonitor/createsend-php.svg?branch=master)](https://app.travis-ci.com/campaignmonitor/createsend-php)\nA PHP library which implements the complete functionality of the [Campaign Monitor API](http://www.campaignmonitor.com/api/).\n\n## Installation\n\n### Composer\nIf you use [Composer](http://getcomposer.org/), you can run the following command from the root of your project:\n\n```\ncomposer require campaignmonitor/createsend-php\n```\n\nOr add [campaignmonitor/createsend-php](https://packagist.org/packages/campaignmonitor/createsend-php) to your `composer.json` file:\n\n```json\n{\n    \"require\": {\n        \"campaignmonitor/createsend-php\": \"{version}\"\n    }\n}\n```\n\nFollowed by running:\n\n```\ncomposer update\n```\n\n### Manual Installation\nOtherwise you can simply [download](https://github.com/campaignmonitor/createsend-php/tags) the library and include it in your project.\n\nAfter you have installed the library, simply include the relevant API class, as follows:\n\n```php\nrequire_once 'csrest_campaigns.php'\n```\n\n## Authenticating\n\nThe Campaign Monitor API supports authentication using either OAuth or an API key.\n\n### Using OAuth\n\nDepending on the environment you are developing in, you may wish to use a PHP OAuth library to get access tokens for your users. If you don't use an OAuth library, you will need to get access tokens for your users by following the instructions included in the Campaign Monitor API [documentation](http://www.campaignmonitor.com/api/getting-started/#authenticating_with_oauth). This package provides functionality to help you do this, as described below. You may also wish to reference this [example application](https://gist.github.com/jdennes/4973318), which is implemented using [Slim](http://slimframework.com/) but could easily be adapted for use with any PHP framework.\n\nThe first thing your application should do is redirect your user to the Campaign Monitor authorization URL where they will have the opportunity to approve your application to access their Campaign Monitor account. You can get this authorization URL by using the `CS_REST_General::authorize_url()` method, like so:\n\n```php\nrequire_once 'csrest_general.php';\n\n$authorize_url = CS_REST_General::authorize_url(\n    'Client ID for your application',\n    'Redirect URI for your application',\n    'The permission level your application requires',\n    'Optional state data to be included'\n);\n# Redirect your users to $authorize_url.\n```\n\nIf your user approves your application, they will then be redirected to the `redirect_uri` you specified, which will include a `code` parameter, and optionally a `state` parameter in the query string. Your application should implement a handler which can exchange the code passed to it for an access token, using `CS_REST_General::exchange_token()` like so:\n\n```php\nrequire_once 'csrest_general.php';\n\n$result = CS_REST_General::exchange_token(\n    'Client ID for your application',\n    'Client Secret for your application',\n    'Redirect URI for your application',\n    'A unique code for your user' # Get the code parameter from the query string\n);\n\nif ($result-\u003ewas_successful()) {\n    $access_token = $result-\u003eresponse-\u003eaccess_token;\n    $expires_in = $result-\u003eresponse-\u003eexpires_in;\n    $refresh_token = $result-\u003eresponse-\u003erefresh_token;\n    # Save $access_token, $expires_in, and $refresh_token.\n} else {\n    echo 'An error occurred:\\n';\n    echo $result-\u003eresponse-\u003eerror.': '.$result-\u003eresponse-\u003eerror_description.\"\\n\";\n    # Handle error...\n}\n```\n\nAt this point you have an access token and refresh token for your user which you should store somewhere convenient so that your application can look up these values when your user wants to make future Campaign Monitor API calls.\n\nOnce you have an access token and refresh token for your user, you can authenticate and make further API calls like so:\n\n```php\nrequire_once 'csrest_general.php';\n\n$auth = array(\n    'access_token' =\u003e 'your access token',\n    'refresh_token' =\u003e 'your refresh_token');\n$wrap = new CS_REST_General($auth);\n\n$result = $wrap-\u003eget_clients();\nvar_dump($result-\u003eresponse);\n```\n\nAll OAuth tokens have an expiry time, and can be renewed with a corresponding refresh token. If your access token expires when attempting to make an API call, you will receive an error response, so your code should handle this. Here's an example of how you could do this:\n\n```php\nrequire_once 'csrest_general.php';\n\n$auth = array(\n    'access_token' =\u003e 'your access token',\n    'refresh_token' =\u003e 'your refresh token'\n);\n$wrap = new CS_REST_General($auth);\n$result = $wrap-\u003eget_clients();\nif (!$result-\u003ewas_successful()) {\n    # If you receive '121: Expired OAuth Token', refresh the access token\n    if ($result-\u003eresponse-\u003eCode == 121) {\n        list($new_access_token, $new_expires_in, $new_refresh_token) = \n            $wrap-\u003erefresh_token();\n        # Save $new_access_token, $new_expires_in, and $new_refresh_token\n    }\n    # Make the call again\n    $result = $wrap-\u003eget_clients();\n}\nvar_dump($result-\u003eresponse);\n```\n\n### Using an API key\n\n```php\nrequire_once 'csrest_general.php';\n\n$auth = array('api_key' =\u003e 'your API key');\n$wrap = new CS_REST_General($auth);\n\n$result = $wrap-\u003eget_clients();\nvar_dump($result-\u003eresponse);\n```\n## API Call Timeout\nYou can set your local API call timeout time in createsend-php\\class\\transport.php line 11, in the CS_REST_CALL_TIMEOUT variable. Currently the default is 120 secs.\n\n## Examples\n\nSamples for creating or accessing all resources can be found in the samples directory.\nThese samples can be used as the basis for your own application and provide an outline of \nthe expected inputs for each API call. \n\nFurther documentation of the inputs and outputs of each call can be found in the \ndocumentation in each of the csrest_*.php files or simply by examining the \nvar_dump results in each of the provided samples.\n\n## Contributing\n\nPlease check the [guidelines for contributing](https://github.com/campaignmonitor/createsend-php/blob/master/CONTRIBUTING.md) to this repository.\n\n## Releasing\n\nPlease check the [instructions for releasing](https://github.com/campaignmonitor/createsend-php/blob/master/RELEASE.md) this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcampaignmonitor%2Fcreatesend-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcampaignmonitor%2Fcreatesend-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcampaignmonitor%2Fcreatesend-php/lists"}