Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

OneSignal/onesignal-dotnet-api

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

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

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.Annotations

NOTE: 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.

Installation

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;

Usage

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;

Getting Started

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);}}}}

Documentation for API Endpoints

All URIs are relative tohttps://api.onesignal.com

ClassMethodHTTP requestDescription
DefaultApiCancelNotificationDELETE /notifications/{notification_id}Stop a scheduled or currently outgoing notification
DefaultApiCopyTemplateToAppPOST /templates/{template_id}/copy_to_appCopy template to another app
DefaultApiCreateAliasPATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity
DefaultApiCreateAliasBySubscriptionPATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity
DefaultApiCreateApiKeyPOST /apps/{app_id}/auth/tokensCreate API key
DefaultApiCreateAppPOST /appsCreate an app
DefaultApiCreateCustomEventsPOST /apps/{app_id}/integrations/custom_eventsCreate custom events
DefaultApiCreateNotificationPOST /notificationsCreate notification
DefaultApiCreateSegmentPOST /apps/{app_id}/segmentsCreate Segment
DefaultApiCreateSubscriptionPOST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions
DefaultApiCreateTemplatePOST /templatesCreate template
DefaultApiCreateUserPOST /apps/{app_id}/users
DefaultApiDeleteAliasDELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}
DefaultApiDeleteApiKeyDELETE /apps/{app_id}/auth/tokens/{token_id}Delete API key
DefaultApiDeleteSegmentDELETE /apps/{app_id}/segments/{segment_id}Delete Segment
DefaultApiDeleteSubscriptionDELETE /apps/{app_id}/subscriptions/{subscription_id}
DefaultApiDeleteTemplateDELETE /templates/{template_id}Delete template
DefaultApiDeleteUserDELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApiExportEventsPOST /notifications/{notification_id}/export_events?app_id={app_id}Export CSV of Events
DefaultApiExportSubscriptionsPOST /players/csv_export?app_id={app_id}Export CSV of Subscriptions
DefaultApiGetAliasesGET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity
DefaultApiGetAliasesBySubscriptionGET /apps/{app_id}/subscriptions/{subscription_id}/user/identity
DefaultApiGetAppGET /apps/{app_id}View an app
DefaultApiGetAppsGET /appsView apps
DefaultApiGetNotificationGET /notifications/{notification_id}View notification
DefaultApiGetNotificationHistoryPOST /notifications/{notification_id}/historyNotification History
DefaultApiGetNotificationsGET /notificationsView notifications
DefaultApiGetOutcomesGET /apps/{app_id}/outcomesView Outcomes
DefaultApiGetSegmentsGET /apps/{app_id}/segmentsGet Segments
DefaultApiGetUserGET /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApiRotateApiKeyPOST /apps/{app_id}/auth/tokens/{token_id}/rotateRotate API key
DefaultApiStartLiveActivityPOST /apps/{app_id}/activities/activity/{activity_type}Start Live Activity
DefaultApiTransferSubscriptionPATCH /apps/{app_id}/subscriptions/{subscription_id}/owner
DefaultApiUnsubscribeEmailWithTokenPOST /apps/{app_id}/notifications/{notification_id}/unsubscribeUnsubscribe with token
DefaultApiUpdateApiKeyPATCH /apps/{app_id}/auth/tokens/{token_id}Update API key
DefaultApiUpdateAppPUT /apps/{app_id}Update an app
DefaultApiUpdateLiveActivityPOST /apps/{app_id}/live_activities/{activity_id}/notificationsUpdate a Live Activity via Push
DefaultApiUpdateSubscriptionPATCH /apps/{app_id}/subscriptions/{subscription_id}
DefaultApiUpdateSubscriptionByTokenPATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}Update subscription by token
DefaultApiUpdateTemplatePATCH /templates/{template_id}Update template
DefaultApiUpdateUserPATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}
DefaultApiViewApiKeysGET /apps/{app_id}/auth/tokensView API keys
DefaultApiViewTemplateGET /templates/{template_id}View template
DefaultApiViewTemplatesGET /templatesView templates

Documentation for Models

Documentation for Authorization

organization_api_key

  • Type: Bearer Authentication

rest_api_key

  • Type: Bearer Authentication

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp