Rust API client for onesignal-rust-api
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
Overview
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
- API version: 1.0.1
- Package version: 1.0.0
- Build package:
org.openapitools.codegen.languages.RustClientCodegen
Overview
GitHub repository https://github.com/onesignal/onesignal-rust-api
Installation
Crates.io
You can install this library as a crate dependency https://crates.io/crates/onesignal-rust-api.
Manual installation
Put the package under your project folder in a directory named onesignal
and add the following to Cargo.toml
under [dependencies]
:
onesignal = { path = "./onesignal" }
Examples
Use the following dependency:
use *;
use Configuration;
use RelationType;
use ;
Define the constants. You can find all the values on the dashboard page of your app.
const APP_ID: &str = "<YOUR_APP_ID>";
const APP_KEY_TOKEN: &str = "<YOUR_APP_KEY_TOKEN>";
const USER_KEY_TOKEN: &str = "<YOUR_USER_KEY_TOKEN>";
Creating a configuration object:
Creating a notification object:
Sending a notification:
async
Canceling a scheduled notification
async
Getting a notification
async
Getting a list of notifications
async
Creating a brand new player model
Creating and deleteing a segment on the server
async
Creating and updating a player on the server
async
Upfating player tags
async
Getting a list of players
async
Creating a segment model
Creating and deleting a segment on the server
async
Getting an app
async
Updating an app
async
Getting a list of apps
async
Getting outcomes
async
Documentation for API Endpoints
All URIs are relative to https://onesignal.com/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | cancel_notification | DELETE /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
DefaultApi | create_app | POST /apps | Create an app |
DefaultApi | create_notification | POST /notifications | Create notification |
DefaultApi | create_player | POST /players | Add a device |
DefaultApi | create_segments | POST /apps/{app_id}/segments | Create Segments |
DefaultApi | delete_player | DELETE /players/{player_id} | Delete a user record |
DefaultApi | delete_segments | DELETE /apps/{app_id}/segments/{segment_id} | Delete Segments |
DefaultApi | export_players | POST /players/csv_export?app_id={app_id} | CSV export |
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_player | GET /players/{player_id} | View device |
DefaultApi | get_players | GET /players | View devices |
DefaultApi | update_app | PUT /apps/{app_id} | Update an app |
DefaultApi | update_player | PUT /players/{player_id} | Edit device |
DefaultApi | update_player_tags | PUT /apps/{app_id}/users/{external_user_id} | Edit tags with external user id |
Documentation For Models
- App
- Button
- DeliveryData
- ExportPlayersRequestBody
- Filter
- FilterExpressions
- FilterNotificationTarget
- GetNotificationRequestBody
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse2005
- InlineResponse2007
- InlineResponse2008
- InlineResponse201
- InlineResponse400
- InlineResponse4001
- InlineResponse4002
- InlineResponse4003
- InvalidIdentifierError
- Notification
- Notification200Errors
- NotificationAllOf
- NotificationAllOfAndroidBackgroundLayout
- NotificationSlice
- NotificationTarget
- NotificationWithMeta
- NotificationWithMetaAllOf
- Operator
- OutcomeData
- OutcomesData
- PlatformDeliveryData
- Player
- PlayerNotificationTarget
- PlayerSlice
- Purchase
- Segment
- SegmentNotificationTarget
- StringMap
- UpdatePlayerTagsRequestBody
To get access to the crate's generated documentation, use:
cargo doc --open
Documentation for API Endpoints
All URIs are relative to https://onesignal.com/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | cancel_notification | DELETE /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
DefaultApi | create_app | POST /apps | Create an app |
DefaultApi | create_notification | POST /notifications | Create notification |
DefaultApi | create_player | POST /players | Add a device |
DefaultApi | create_segments | POST /apps/{app_id}/segments | Create Segments |
DefaultApi | delete_player | DELETE /players/{player_id} | Delete a user record |
DefaultApi | delete_segments | DELETE /apps/{app_id}/segments/{segment_id} | Delete Segments |
DefaultApi | export_players | POST /players/csv_export?app_id={app_id} | CSV export |
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_player | GET /players/{player_id} | View device |
DefaultApi | get_players | GET /players | View devices |
DefaultApi | update_app | PUT /apps/{app_id} | Update an app |
DefaultApi | update_player | PUT /players/{player_id} | Edit device |
DefaultApi | update_player_tags | PUT /apps/{app_id}/users/{external_user_id} | Edit tags with external user id |
Documentation For Models
- App
- BasicNotification
- BasicNotificationAllOf
- BasicNotificationAllOfAndroidBackgroundLayout
- Button
- CancelNotificationSuccessResponse
- CreateNotificationBadRequestResponse
- CreateNotificationSuccessResponse
- CreatePlayerSuccessResponse
- CreateSegmentBadRequestResponse
- CreateSegmentConflictResponse
- CreateSegmentSuccessResponse
- DeletePlayerBadRequestResponse
- DeletePlayerNotFoundResponse
- DeletePlayerSuccessResponse
- DeleteSegmentBadRequestResponse
- DeleteSegmentNotFoundResponse
- DeleteSegmentSuccessResponse
- DeliveryData
- ExportPlayersRequestBody
- ExportPlayersSuccessResponse
- Filter
- FilterExpressions
- FilterNotificationTarget
- GetNotificationRequestBody
- InvalidIdentifierError
- Notification
- Notification200Errors
- NotificationAllOf
- NotificationHistoryBadRequestResponse
- NotificationHistorySuccessResponse
- NotificationSlice
- NotificationTarget
- NotificationWithMeta
- NotificationWithMetaAllOf
- Operator
- OutcomeData
- OutcomesData
- PlatformDeliveryData
- PlatformDeliveryDataEmailAllOf
- PlatformDeliveryDataSmsAllOf
- Player
- PlayerNotificationTarget
- PlayerSlice
- Purchase
- Segment
- SegmentNotificationTarget
- StringMap
- UpdatePlayerSuccessResponse
- UpdatePlayerTagsRequestBody
- UpdatePlayerTagsSuccessResponse
To get access to the crate's generated documentation, use:
cargo doc --open