Download the PHP package onesignal/onesignal-php-api without Composer

On this page you can find all versions of the php package onesignal/onesignal-php-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package onesignal-php-api

OneSignal

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

For more information, please visit https://onesignal.com.

Installation & Usage

Requirements

PHP 7.3 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

Then run composer install

Usage examples

Imports

Constants

Configure authorization

Notifications

Creating a notification model

Sending a notification immediately

Scheduling a notification to be sent in 24 hours

Sending a notification using Filters

Send this notification only to the users that have not spent any USD on IAP.

Sending a notification immediately

Retrieving a notification

Listing notifications by application ID

Getting notification history

Players

Creating a new Player model

Creating a Player

Getting a Player

Getting a list of Players

Deleting a player

Exporting players into CSV-spreadsheet

Segments

Creating a segment

Setting up the segment itself

Deleting a segment

Working with Apps

Getting an app

Getting a list of apps

Updating an app

Outcomes

Live Activities

Begin Live Activity

Update Live Activity

End Live Activity

Users

Creating a user

Fetch user by an alias

Update user

Delete user

Create subscription

Update subscription

Delete subscription

Delete Alias

Fetch aliases by subscription id

Fetch aliases by another alias

Identify user by subscription id

Identify user by another alias

Transfer subscription to another user

Fetch in app messages

API Endpoints

All URIs are relative to https://api.onesignal.com

Class Method HTTP request Description
DefaultApi beginLiveActivity POST /apps/{app_id}/live_activities/{activity_id}/token Start Live Activity
DefaultApi cancelNotification DELETE /notifications/{notification_id} Stop a scheduled or currently outgoing notification
DefaultApi createApp POST /apps Create an app
DefaultApi createNotification POST /notifications Create notification
DefaultApi createPlayer POST /players Add a device
DefaultApi createSegments POST /apps/{app_id}/segments Create Segments
DefaultApi createSubscription POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions
DefaultApi createUser POST /apps/{app_id}/users
DefaultApi deleteAlias DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}
DefaultApi deletePlayer DELETE /players/{player_id} Delete a user record
DefaultApi deleteSegments DELETE /apps/{app_id}/segments/{segment_id} Delete Segments
DefaultApi deleteSubscription DELETE /apps/{app_id}/subscriptions/{subscription_id}
DefaultApi deleteUser DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApi endLiveActivity DELETE /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} Stop Live Activity
DefaultApi exportEvents POST /notifications/{notification_id}/export_events?app_id={app_id} Export CSV of Events
DefaultApi exportPlayers POST /players/csv_export?app_id={app_id} Export CSV of Players
DefaultApi fetchAliases GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity
DefaultApi fetchUser GET /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApi fetchUserIdentity GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity
DefaultApi getApp GET /apps/{app_id} View an app
DefaultApi getApps GET /apps View apps
DefaultApi getEligibleIams GET /apps/{app_id}/subscriptions/{subscription_id}/iams
DefaultApi getNotification GET /notifications/{notification_id} View notification
DefaultApi getNotificationHistory POST /notifications/{notification_id}/history Notification History
DefaultApi getNotifications GET /notifications View notifications
DefaultApi getOutcomes GET /apps/{app_id}/outcomes View Outcomes
DefaultApi getPlayer GET /players/{player_id} View device
DefaultApi getPlayers GET /players View devices
DefaultApi identifyUserByAlias PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity
DefaultApi identifyUserBySubscriptionId PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity
DefaultApi transferSubscription PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner
DefaultApi updateApp PUT /apps/{app_id} Update an app
DefaultApi updateLiveActivity POST /apps/{app_id}/live_activities/{activity_id}/notifications Update a Live Activity via Push
DefaultApi updatePlayer PUT /players/{player_id} Edit device
DefaultApi updatePlayerTags PUT /apps/{app_id}/users/{external_user_id} Edit tags with external user id
DefaultApi updateSubscription PATCH /apps/{app_id}/subscriptions/{subscription_id}
DefaultApi updateUser PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}

Models

Authorization

All the OneSignal endpoints require either an app_key or user_key tokens for authorization. It is recommended to set up both of those keys during the initial config initialization so that you don't need to worry about which endpoint requires app_key and which user_key. You can get the value of these keys from your user settings pages.

app_key

user_key

Author

[email protected]


All versions of onesignal-php-api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package onesignal/onesignal-php-api contains the following files

Loading the files please wait ....