Download the PHP package trycourier/courier without Composer
On this page you can find all versions of the php package trycourier/courier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download trycourier/courier
More information about trycourier/courier
Files in trycourier/courier
Package courier
Short Description PHP implementation of Courier's API as an SDK. With additional support for Laravel 5.8+
License MIT
Informations about the package courier
Courier SDK
Courier PHP SDK supporting:
- Send API
- Messages API
- Profiles API
- Preferences API
- Events API
- Brands API
- Lists API
- Notifications API
- Automations API
- Bulk API
- Audiences API
- Token Management API
- Audit Events API
- Tenants API
- Users API
Official Courier API docs
For a full description of request and response payloads and properties, please see the official Courier API docs.
Requirements
- PHP 7.2+
- ext-json
Installation
This library uses HTTPlug as HTTP client. HTTPlug is an abstraction that allows this library to support different HTTP Clients. Therefore, you need to provide it with an client and/or adapter for the HTTP library you prefer. You can find all the available adapters in Packagist. This documentation assumes you use the Guzzle Client, but you can replace it with any client that you prefer.
The recommended way to install courier-php is through Composer:
Configuration
Instantiate the Courier client class with your authorization token OR username and password. Providing just an authorization token will generate a "Bearer" authorization header, while providing a username and password will generate a "Basic" (base64-encoded) authorization header
Options
Many methods allow the passing of optional data to the Courier endpoints. This data should be an associative array of key/value pairs. The exact options supported are dependent on the endpoint being called. Please refer to the official Courier documentation for more information.
Methods
For a full description of request and response payloads and properties, please see the official Courier API docs.
Send API
sendNotification(string $event, string $recipient, string $brand = NULL, object $profile = NULL, object $data = NULL, object $preferences = NULL, object $override = NULL, string $idempotency_key = NULL): object
(Send API)sendEnhancedNotification(object $message, string $idempotency_key = NULL): object
(Send API)sendNotificationToList(string $event, string $list = NULL, string $pattern = NULL, string $brand = NULL, object $data = NULL, object $override = NULL, string $idempotency_key = NULL): object
(Send list API)
Messages API
cancelMessage(string $message_id): object
[?]getMessages(string $cursor = NULL, string $event = NULL, string $list = NULL, string $message_id = NULL, string $notification = NULL, string $recipient = NULL): object
[?]getMessage(string $message_id): object
[?]getMessageHistory(string $message_id, string $type = NULL): object
[?]
Lists API
getLists(string $cursor = NULL, string $pattern = NULL): object
[?]getList(string $list_id): object
[?]putList(string $list_id, string $name): object
[?]deleteList(string $list_id): object
[?]restoreList(string $list_id): object
[?]getListSubscriptions(string $list_id, string $cursor = NULL): object
[?]subscribeMultipleRecipientsToList(string $list_id, array $recipients): object
[?]subscribeRecipientToList(string $list_id, string $recipient_id): object
[?]deleteListSubscription(string $list_id, string $recipient_id): object
[?]
Brands API
getBrands(string $cursor = NULL): object
[?]createBrand(string $id = NULL, string $name, object $settings, object $snippets = NULL, string $idempotency_key = NULL): object
[?]getBrand(string $brand_id): object
[?]replaceBrand(string $brand_id, string $name, object $settings, object $snippets = NULL): object
[?]deleteBrand(string $brand_id): object
[?]
Events API
getEvents(): object
[?]getEvent(string $event_id): object
[?]putEvent(string $event_id, string $id, string $type): object
[?]
Profiles API
getProfile(string $recipient_id): object
[?]upsertProfile(string $recipient_id, object $profile): object
[?]patchProfile(string $recipient_id, array $patch): object
[?]replaceProfile(string $recipient_id, object $profile): object
[?]getProfileLists(string $recipient_id, string $cursor = NULL): object
[?]
Preferences API
getPreferences(string $recipient_id, string $preferred_channel): object
[?]updatePreferences(string $recipient_id, string $preferred_channel): object
[?]
Notifications API
listNotifications(string $cursor = NULL): object
getNotificationContent(string $id): object
getNotificationDraftContent(string $id): object
postNotificationVariations(string $id, array $blocks, array $channels = NULL): object
postNotificationDraftVariations(string $id, array $blocks, array $channels = NULL): object
getNotificationSubmissionChecks(string $id, string $submissionId): object
putNotificationSubmissionChecks(string $id, string $submissionId, array $checks): object
deleteNotificationSubmission(string $id, string $submissionId): object
Automations API
invokeAutomation(object $automation, string $brand = NULL, string $template = NULL, string $recipient = NULL, object $data = NULL, object $profile = NULL): object
[?]invokeAutomationFromTemplate(string $templateId, string $brand = NULL, object $data = NULL, object $profile = NULL, string $recipient = NULL, string $template = NULL): object
[?]getAutomationRun(string $runId): object
Bulk API
createBulkJob(object $message): object
(Create Bulk Job)ingestBulkJob(string $jobId, array $users): object
(Ingest Bulk Job Users)runBulkJob(string $jobId): object
(Run Bulk Job)getBulkJob(string $jobId): object
(Get Bulk Job)getBulkJobUsers(string $jobId): object
(Get Bulk Job Users)
Audiences API
putAudience(object $audience): object
(Create Audience)getAudience(string $audienceId): object
(Get Audience)getAudienceMembers(string $audienceId): object
(List audience members)getAudiences(): object
(List audiences)
Token Management API
putUserTokens(string $user_id, array $tokens): object
(Put User Tokens)putUserToken(string $user_id, array $token): object
(Put User Token)patchUserToken(string $user_id, string $token, array $patch): object
(Patch User Token)getUserToken(string $user_id, string $token): object
(Get User Token)getUserTokens(string $user_id): object
(Get User Tokens)
Audit Events API
getAuditEvent(string $audit_event_id): object
(Get Audit Event)listAuditEvents(string $cursor = NULL): object
(List Audit Events)
Accounts API (only on v1.12.0)
getAccount(): object
(Get Account)listAccounts(string $cursor = NULL): object
(List Accounts)putAccount(string $account_id, object $account): object
(Put Account)deleteAccount(string $account_id): object
(Delete Account)
Tenants API (v2.0.0+)
getTenant(): object
(Get Tenant)listTenants(string $cursor = NULL): object
(List Tenants)putTenant(string $tenant_id, object $tenant): object
(Put Tenant)deleteTenant(string $tenant_id): object
(Delete Tenant)
Users API
putUser(): object
(Put User)putUserTenants(): object
(Put User Tenants)
Errors
All unsuccessful (non 2xx) responses will throw a CourierRequestException
. The full response object is available via the getResponse()
method.
All versions of courier with dependencies
ext-json Version *
psr/http-message Version ^1.0
psr/http-client-implementation Version ^1.0
php-http/httplug Version ^2.0
php-http/message-factory Version ^1.0
php-http/discovery Version ^1.0