- Notifications
You must be signed in to change notification settings - Fork17
License
OneSignal/onesignal-dotnet-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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
- SDK version: 5.4.0-beta1
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegenFor more information, please visithttps://onesignal.com
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- RestSharp - 106.13.0 or later
- Json.NET - 12.0.3 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend usingNuGet to obtain the latest version of the packages:
Install-Package RestSharpInstall-Package Newtonsoft.JsonInstall-Package JsonSubTypesInstall-Package System.ComponentModel.AnnotationsNOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. SeeRestSharp#742.NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. SeeRestSharp#1406.
Generate the DLL using your preferred tool (e.g.dotnet build)
Then include the DLL (under thebin folder) in the C# project, and use the namespaces:
usingOneSignalApi.Api;usingOneSignalApi.Client;usingOneSignalApi.Model;
To use the API client with a HTTP proxy, setup aSystem.Net.WebProxy
Configurationc=newConfiguration();System.Net.WebProxywebProxy=newSystem.Net.WebProxy("http://myProxyUrl:80/");webProxy.Credentials=System.Net.CredentialCache.DefaultCredentials;c.Proxy=webProxy;
usingSystem.Collections.Generic;usingSystem.Diagnostics;usingOneSignalApi.Api;usingOneSignalApi.Client;usingOneSignalApi.Model;namespaceExample{publicclassExample{publicstaticvoidMain(){// Configure configuration with organization_api_key Bearer token for authorization to access endpoints// that require the OneSignal Organization API Key.varorgConfig=newConfiguration();orgConfig.BasePath="https://api.onesignal.com";orgConfig.AccessToken="YOUR_ORGANIZATION_API_KEY";// Organization key is only required for creating new apps and other top-level endpointsvaruserInstance=newDefaultApi(orgConfig);try{// Create a new appvarapp=newApp(name:"Sample App");varresult=userInstance.CreateApp(app);Debug.WriteLine(result);}catch(ApiExceptione){Debug.Print("Exception when calling DefaultApi.CreateApp: "+e.Message);Debug.Print("Status Code: "+e.ErrorCode);Debug.Print(e.StackTrace);}// Configure configuration with rest_api_key Bearer token for authorization to access endpoints// that require the OneSignal App REST API Key.varappConfig=newConfiguration();appConfig.BasePath="https://api.onesignal.com";appConfig.AccessToken="YOUR_REST_API_KEY";// App REST API key required for most endpointsvarappInstance=newDefaultApi(appConfig);varappId="appId_example";// string |varnotificationId="notificationId_example";// string |try{// Stop a scheduled or currently outgoing notificationvarresult=appInstance.CancelNotification(appId,notificationId);Debug.WriteLine(result);}catch(ApiExceptione){Debug.Print("Exception when calling DefaultApi.CancelNotification: "+e.Message);Debug.Print("Status Code: "+e.ErrorCode);Debug.Print(e.StackTrace);}}}}
All URIs are relative tohttps://api.onesignal.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | CancelNotification | DELETE /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
| DefaultApi | CopyTemplateToApp | POST /templates/{template_id}/copy_to_app | Copy template to another app |
| DefaultApi | CreateAlias | PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
| DefaultApi | CreateAliasBySubscription | PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
| DefaultApi | CreateApiKey | POST /apps/{app_id}/auth/tokens | Create API key |
| DefaultApi | CreateApp | POST /apps | Create an app |
| DefaultApi | CreateCustomEvents | POST /apps/{app_id}/integrations/custom_events | Create custom events |
| DefaultApi | CreateNotification | POST /notifications | Create notification |
| DefaultApi | CreateSegment | POST /apps/{app_id}/segments | Create Segment |
| DefaultApi | CreateSubscription | POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | |
| DefaultApi | CreateTemplate | POST /templates | Create template |
| 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 | DeleteApiKey | DELETE /apps/{app_id}/auth/tokens/{token_id} | Delete API key |
| DefaultApi | DeleteSegment | DELETE /apps/{app_id}/segments/{segment_id} | Delete Segment |
| DefaultApi | DeleteSubscription | DELETE /apps/{app_id}/subscriptions/{subscription_id} | |
| DefaultApi | DeleteTemplate | DELETE /templates/{template_id} | Delete template |
| DefaultApi | DeleteUser | DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
| DefaultApi | ExportEvents | POST /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
| DefaultApi | ExportSubscriptions | POST /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
| DefaultApi | GetAliases | GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
| DefaultApi | GetAliasesBySubscription | GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
| DefaultApi | GetApp | GET /apps/{app_id} | View an app |
| DefaultApi | GetApps | GET /apps | View apps |
| 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 | GetSegments | GET /apps/{app_id}/segments | Get Segments |
| DefaultApi | GetUser | GET /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
| DefaultApi | RotateApiKey | POST /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key |
| DefaultApi | StartLiveActivity | POST /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity |
| DefaultApi | TransferSubscription | PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner | |
| DefaultApi | UnsubscribeEmailWithToken | POST /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token |
| DefaultApi | UpdateApiKey | PATCH /apps/{app_id}/auth/tokens/{token_id} | Update API key |
| 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 | UpdateSubscription | PATCH /apps/{app_id}/subscriptions/{subscription_id} | |
| DefaultApi | UpdateSubscriptionByToken | PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token |
| DefaultApi | UpdateTemplate | PATCH /templates/{template_id} | Update template |
| DefaultApi | UpdateUser | PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
| DefaultApi | ViewApiKeys | GET /apps/{app_id}/auth/tokens | View API keys |
| DefaultApi | ViewTemplate | GET /templates/{template_id} | View template |
| DefaultApi | ViewTemplates | GET /templates | View templates |
- Model.ApiKeyToken
- Model.ApiKeyTokensListResponse
- Model.App
- Model.BasicNotification
- Model.BasicNotificationAllOf
- Model.BasicNotificationAllOfAndroidBackgroundLayout
- Model.Button
- Model.CopyTemplateRequest
- Model.CreateApiKeyRequest
- Model.CreateApiKeyResponse
- Model.CreateNotificationSuccessResponse
- Model.CreateSegmentConflictResponse
- Model.CreateSegmentSuccessResponse
- Model.CreateTemplateRequest
- Model.CreateUserConflictResponse
- Model.CreateUserConflictResponseErrorsInner
- Model.CreateUserConflictResponseErrorsItemsMeta
- Model.CustomEvent
- Model.CustomEventsRequest
- Model.DeliveryData
- Model.ExportEventsSuccessResponse
- Model.ExportSubscriptionsRequestBody
- Model.ExportSubscriptionsSuccessResponse
- Model.Filter
- Model.FilterExpression
- Model.GenericError
- Model.GenericSuccessBoolResponse
- Model.GetNotificationHistoryRequestBody
- Model.GetSegmentsSuccessResponse
- Model.LanguageStringMap
- Model.Notification
- Model.NotificationAllOf
- Model.NotificationHistorySuccessResponse
- Model.NotificationSlice
- Model.NotificationTarget
- Model.NotificationWithMeta
- Model.NotificationWithMetaAllOf
- Model.Operator
- Model.OutcomeData
- Model.OutcomesData
- Model.PlatformDeliveryData
- Model.PlatformDeliveryDataEmailAllOf
- Model.PlatformDeliveryDataSmsAllOf
- Model.PropertiesBody
- Model.PropertiesDeltas
- Model.PropertiesObject
- Model.Purchase
- Model.RateLimitError
- Model.Segment
- Model.SegmentData
- Model.SegmentNotificationTarget
- Model.StartLiveActivityRequest
- Model.StartLiveActivitySuccessResponse
- Model.Subscription
- Model.SubscriptionBody
- Model.SubscriptionNotificationTarget
- Model.TemplateResource
- Model.TemplatesListResponse
- Model.TransferSubscriptionRequestBody
- Model.UpdateApiKeyRequest
- Model.UpdateLiveActivityRequest
- Model.UpdateLiveActivitySuccessResponse
- Model.UpdateTemplateRequest
- Model.UpdateUserRequest
- Model.User
- Model.UserIdentityBody
- Model.WebButton
- Type: Bearer Authentication
- Type: Bearer Authentication
About
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.