Skip to content

OneSignal/onesignal-python-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Welcome to @onesignal/python-onesignal πŸ‘‹

Version Documentation Maintenance Twitter: onesignal

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

  • API version: 5.3.0
  • Package version: 5.3.0-beta1
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >=3.6

Installation & Usage

pip install

pip install onesignal-python-api

You can also install directly from GitHub using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

You may need to run pip with root permission:

sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Setuptools

Install via Setuptools.

python setup.py install --user

To install the package for all users:

sudo python setup.py install

Getting Started

Please follow the installation procedure and then run the following:

import onesignal
from onesignal.api import default_api

# See configuration.py for a list of all supported configuration parameters.
# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY.
# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself.
configuration = onesignal.Configuration(
    rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints
    organization_api_key = "YOUR_ORGANIZATION_KEY" # Organization key is only required for creating new apps and other top-level endpoints
)


# Enter a context with an instance of the API client
with onesignal.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)

Documentation for API Endpoints

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

Class Method HTTP request Description
DefaultApi cancel_notification DELETE /notifications/{notification_id} Stop a scheduled or currently outgoing notification
DefaultApi copy_template_to_app POST /templates/{template_id}/copy_to_app Copy template to another app
DefaultApi create_alias PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity
DefaultApi create_alias_by_subscription PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity
DefaultApi create_api_key POST /apps/{app_id}/auth/tokens Create API key
DefaultApi create_app POST /apps Create an app
DefaultApi create_custom_events POST /apps/{app_id}/integrations/custom_events Create custom events
DefaultApi create_notification POST /notifications Create notification
DefaultApi create_segment POST /apps/{app_id}/segments Create Segment
DefaultApi create_subscription POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions
DefaultApi create_template POST /templates Create template
DefaultApi create_user POST /apps/{app_id}/users
DefaultApi delete_alias DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}
DefaultApi delete_api_key DELETE /apps/{app_id}/auth/tokens/{token_id} Delete API key
DefaultApi delete_segment DELETE /apps/{app_id}/segments/{segment_id} Delete Segment
DefaultApi delete_subscription DELETE /apps/{app_id}/subscriptions/{subscription_id}
DefaultApi delete_template DELETE /templates/{template_id} Delete template
DefaultApi delete_user DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApi export_events POST /notifications/{notification_id}/export_events?app_id={app_id} Export CSV of Events
DefaultApi export_subscriptions POST /players/csv_export?app_id={app_id} Export CSV of Subscriptions
DefaultApi get_aliases GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity
DefaultApi get_aliases_by_subscription GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity
DefaultApi get_app GET /apps/{app_id} View an app
DefaultApi get_apps GET /apps View apps
DefaultApi get_notification GET /notifications/{notification_id} View notification
DefaultApi get_notification_history POST /notifications/{notification_id}/history Notification History
DefaultApi get_notifications GET /notifications View notifications
DefaultApi get_outcomes GET /apps/{app_id}/outcomes View Outcomes
DefaultApi get_segments GET /apps/{app_id}/segments Get Segments
DefaultApi get_user GET /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApi rotate_api_key POST /apps/{app_id}/auth/tokens/{token_id}/rotate Rotate API key
DefaultApi start_live_activity POST /apps/{app_id}/activities/activity/{activity_type} Start Live Activity
DefaultApi transfer_subscription PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner
DefaultApi unsubscribe_email_with_token POST /apps/{app_id}/notifications/{notification_id}/unsubscribe Unsubscribe with token
DefaultApi update_api_key PATCH /apps/{app_id}/auth/tokens/{token_id} Update API key
DefaultApi update_app PUT /apps/{app_id} Update an app
DefaultApi update_live_activity POST /apps/{app_id}/live_activities/{activity_id}/notifications Update a Live Activity via Push
DefaultApi update_subscription PATCH /apps/{app_id}/subscriptions/{subscription_id}
DefaultApi update_subscription_by_token PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token} Update subscription by token
DefaultApi update_template PATCH /templates/{template_id} Update template
DefaultApi update_user PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApi view_api_keys GET /apps/{app_id}/auth/tokens View API keys
DefaultApi view_template GET /templates/{template_id} View template
DefaultApi view_templates GET /templates View templates

Documentation For Models

Author

[email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages