All URIs are relative to https://onesignal.com/api/v1
Method | HTTP request | Description |
---|---|---|
BeginLiveActivity | Post /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity |
CancelNotification | Delete /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
CreateApp | Post /apps | Create an app |
CreateNotification | Post /notifications | Create notification |
CreatePlayer | Post /players | Add a device |
CreateSegments | Post /apps/{app_id}/segments | Create Segments |
CreateSubscription | Post /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | |
CreateUser | Post /apps/{app_id}/users | |
DeleteAlias | Delete /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | |
DeletePlayer | Delete /players/{player_id} | Delete a user record |
DeleteSegments | Delete /apps/{app_id}/segments/{segment_id} | Delete Segments |
DeleteSubscription | Delete /apps/{app_id}/subscriptions/{subscription_id} | |
DeleteUser | Delete /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
EndLiveActivity | Delete /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity |
ExportEvents | Post /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
ExportPlayers | Post /players/csv_export?app_id={app_id} | Export CSV of Players |
FetchAliases | Get /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
FetchUser | Get /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
FetchUserIdentity | Get /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
GetApp | Get /apps/{app_id} | View an app |
GetApps | Get /apps | View apps |
GetEligibleIams | Get /apps/{app_id}/subscriptions/{subscription_id}/iams | |
GetNotification | Get /notifications/{notification_id} | View notification |
GetNotificationHistory | Post /notifications/{notification_id}/history | Notification History |
GetNotifications | Get /notifications | View notifications |
GetOutcomes | Get /apps/{app_id}/outcomes | View Outcomes |
GetPlayer | Get /players/{player_id} | View device |
GetPlayers | Get /players | View devices |
IdentifyUserByAlias | Patch /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
IdentifyUserBySubscriptionId | Patch /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
TransferSubscription | Patch /apps/{app_id}/subscriptions/{subscription_id}/owner | |
UpdateApp | Put /apps/{app_id} | Update an app |
UpdateLiveActivity | Post /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push |
UpdatePlayer | Put /players/{player_id} | Edit device |
UpdatePlayerTags | Put /apps/{app_id}/users/{external_user_id} | Edit tags with external user id |
UpdateSubscription | Patch /apps/{app_id}/subscriptions/{subscription_id} | |
UpdateUser | Patch /apps/{app_id}/users/by/{alias_label}/{alias_id} |
BeginLiveActivity(ctx, appId, activityId).BeginLiveActivityRequest(beginLiveActivityRequest).Execute()
Start Live Activity
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
activityId := "activityId_example" // string | Live Activity record ID
beginLiveActivityRequest := *onesignal.NewBeginLiveActivityRequest("PushToken_example", "SubscriptionId_example") // BeginLiveActivityRequest |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.BeginLiveActivity(appAuth, appId, activityId).BeginLiveActivityRequest(beginLiveActivityRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.BeginLiveActivity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. | |
activityId | string | Live Activity record ID |
Other parameters are passed through a pointer to a apiBeginLiveActivityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
beginLiveActivityRequest | BeginLiveActivityRequest | |
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CancelNotificationSuccessResponse CancelNotification(ctx, notificationId).AppId(appId).Execute()
Stop a scheduled or currently outgoing notification
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
notificationId := "notificationId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CancelNotification(appAuth, notificationId).AppId(appId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CancelNotification``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CancelNotification`: CancelNotificationSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CancelNotification`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
notificationId | string |
Other parameters are passed through a pointer to a apiCancelNotificationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
appId | string |
CancelNotificationSuccessResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
App CreateApp(ctx).App(app).Execute()
Create an app
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
app := *onesignal.NewApp() // App |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CreateApp(userAuth).App(app).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateApp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateApp`: App
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateApp`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateAppRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
app | App |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateNotificationSuccessResponse CreateNotification(ctx).Notification(notification).Execute()
Create notification
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
notification := *onesignal.NewNotification("AppId_example") // Notification |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CreateNotification(appAuth).Notification(notification).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateNotification``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateNotification`: CreateNotificationSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateNotification`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateNotificationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
notification | Notification |
CreateNotificationSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreatePlayerSuccessResponse CreatePlayer(ctx).Player(player).Execute()
Add a device
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
player := *onesignal.NewPlayer(int32(123)) // Player |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CreatePlayer(appAuth).Player(player).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreatePlayer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreatePlayer`: CreatePlayerSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreatePlayer`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreatePlayerRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
player | Player |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateSegmentSuccessResponse CreateSegments(ctx, appId).Segment(segment).Execute()
Create Segments
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
segment := *onesignal.NewSegment("Name_example", []onesignal.FilterExpressions{*onesignal.NewFilterExpressions("Field_example", "Relation_example")}) // Segment | (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CreateSegments(appAuth, appId).Segment(segment).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateSegments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateSegments`: CreateSegmentSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateSegments`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. |
Other parameters are passed through a pointer to a apiCreateSegmentsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
segment | Segment | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse201 CreateSubscription(ctx, appId, aliasLabel, aliasId).CreateSubscriptionRequestBody(createSubscriptionRequestBody).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
createSubscriptionRequestBody := *onesignal.NewCreateSubscriptionRequestBody() // CreateSubscriptionRequestBody |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CreateSubscription(appAuth, appId, aliasLabel, aliasId).CreateSubscriptionRequestBody(createSubscriptionRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateSubscription``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateSubscription`: InlineResponse201
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateSubscription`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string |
Other parameters are passed through a pointer to a apiCreateSubscriptionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
createSubscriptionRequestBody | CreateSubscriptionRequestBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User CreateUser(ctx, appId).User(user).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
user := *onesignal.NewUser() // User |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.CreateUser(appAuth, appId).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateUser`: User
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateUser`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string |
Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
user | User | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200 DeleteAlias(ctx, appId, aliasLabel, aliasId, aliasLabelToDelete).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
aliasLabelToDelete := "aliasLabelToDelete_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.DeleteAlias(appAuth, appId, aliasLabel, aliasId, aliasLabelToDelete).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteAlias``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteAlias`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeleteAlias`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string | ||
aliasLabelToDelete | string |
Other parameters are passed through a pointer to a apiDeleteAliasRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeletePlayerSuccessResponse DeletePlayer(ctx, playerId).AppId(appId).Execute()
Delete a user record
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
playerId := "playerId_example" // string | The OneSignal player_id
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.DeletePlayer(appAuth, playerId).AppId(appId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeletePlayer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeletePlayer`: DeletePlayerSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeletePlayer`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
playerId | string | The OneSignal player_id |
Other parameters are passed through a pointer to a apiDeletePlayerRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteSegmentSuccessResponse DeleteSegments(ctx, appId, segmentId).Execute()
Delete Segments
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
segmentId := "segmentId_example" // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.DeleteSegments(appAuth, appId, segmentId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteSegments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteSegments`: DeleteSegmentSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeleteSegments`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. | |
segmentId | string | The segment_id can be found in the URL of the segment when viewing it in the dashboard. |
Other parameters are passed through a pointer to a apiDeleteSegmentsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteSubscription(ctx, appId, subscriptionId).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
subscriptionId := "subscriptionId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.DeleteSubscription(appAuth, appId, subscriptionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteSubscription``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
subscriptionId | string |
Other parameters are passed through a pointer to a apiDeleteSubscriptionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteUser(ctx, appId, aliasLabel, aliasId).Execute()
No authorization required
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultApi.DeleteUser(, appId, aliasLabel, aliasId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string |
Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EndLiveActivity(ctx, appId, activityId, subscriptionId).Execute()
Stop Live Activity
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
activityId := "activityId_example" // string | Live Activity record ID
subscriptionId := "subscriptionId_example" // string | Subscription ID
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.EndLiveActivity(appAuth, appId, activityId, subscriptionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.EndLiveActivity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. | |
activityId | string | Live Activity record ID | |
subscriptionId | string | Subscription ID |
Other parameters are passed through a pointer to a apiEndLiveActivityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExportEventsSuccessResponse ExportEvents(ctx, notificationId).AppId(appId).Execute()
Export CSV of Events
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
notificationId := "notificationId_example" // string | The ID of the notification to export events from.
appId := "appId_example" // string | The ID of the app that the notification belongs to.
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.ExportEvents(appAuth, notificationId).AppId(appId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ExportEvents``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ExportEvents`: ExportEventsSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ExportEvents`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
notificationId | string | The ID of the notification to export events from. |
Other parameters are passed through a pointer to a apiExportEventsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
appId | string | The ID of the app that the notification belongs to. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExportPlayersSuccessResponse ExportPlayers(ctx, appId).ExportPlayersRequestBody(exportPlayersRequestBody).Execute()
Export CSV of Players
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The app ID that you want to export devices from
exportPlayersRequestBody := *onesignal.NewExportPlayersRequestBody() // ExportPlayersRequestBody | (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.ExportPlayers(appAuth, appId).ExportPlayersRequestBody(exportPlayersRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ExportPlayers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ExportPlayers`: ExportPlayersSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ExportPlayers`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The app ID that you want to export devices from |
Other parameters are passed through a pointer to a apiExportPlayersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
exportPlayersRequestBody | ExportPlayersRequestBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserIdentityResponse FetchAliases(ctx, appId, subscriptionId).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
subscriptionId := "subscriptionId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.FetchAliases(appAuth, appId, subscriptionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FetchAliases``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FetchAliases`: UserIdentityResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FetchAliases`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
subscriptionId | string |
Other parameters are passed through a pointer to a apiFetchAliasesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User FetchUser(ctx, appId, aliasLabel, aliasId).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.FetchUser(appAuth, appId, aliasLabel, aliasId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FetchUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FetchUser`: User
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FetchUser`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string |
Other parameters are passed through a pointer to a apiFetchUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200 FetchUserIdentity(ctx, appId, aliasLabel, aliasId).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.FetchUserIdentity(appAuth, appId, aliasLabel, aliasId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FetchUserIdentity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FetchUserIdentity`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FetchUserIdentity`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string |
Other parameters are passed through a pointer to a apiFetchUserIdentityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
App GetApp(ctx, appId).Execute()
View an app
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | An app id
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetApp(userAuth, appId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetApp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetApp`: App
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetApp`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | An app id |
Other parameters are passed through a pointer to a apiGetAppRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]App GetApps(ctx).Execute()
View apps
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetApps(userAuth).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetApps``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetApps`: []App
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetApps`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetAppsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse2003 GetEligibleIams(ctx, appId, subscriptionId).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
subscriptionId := "subscriptionId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetEligibleIams(appAuth, appId, subscriptionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetEligibleIams``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetEligibleIams`: InlineResponse2003
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetEligibleIams`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
subscriptionId | string |
Other parameters are passed through a pointer to a apiGetEligibleIamsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NotificationWithMeta GetNotification(ctx, notificationId).AppId(appId).Execute()
View notification
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
notificationId := "notificationId_example" // string |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetNotification(appAuth, notificationId).AppId(appId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotification``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetNotification`: NotificationWithMeta
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotification`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
notificationId | string |
Other parameters are passed through a pointer to a apiGetNotificationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
appId | string |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NotificationHistorySuccessResponse GetNotificationHistory(ctx, notificationId).GetNotificationRequestBody(getNotificationRequestBody).Execute()
Notification History
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
notificationId := "notificationId_example" // string | The \"id\" of the message found in the Notification object
getNotificationRequestBody := *onesignal.NewGetNotificationRequestBody() // GetNotificationRequestBody |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetNotificationHistory(appAuth, notificationId).GetNotificationRequestBody(getNotificationRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotificationHistory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetNotificationHistory`: NotificationHistorySuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotificationHistory`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
notificationId | string | The "id" of the message found in the Notification object |
Other parameters are passed through a pointer to a apiGetNotificationHistoryRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
getNotificationRequestBody | GetNotificationRequestBody | |
NotificationHistorySuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NotificationSlice GetNotifications(ctx).AppId(appId).Limit(limit).Offset(offset).Kind(kind).Execute()
View notifications
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The app ID that you want to view notifications from
limit := int32(56) // int32 | How many notifications to return. Max is 50. Default is 50. (optional)
offset := int32(56) // int32 | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional)
kind := int32(56) // int32 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetNotifications(appAuth).AppId(appId).Limit(limit).Offset(offset).Kind(kind).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotifications``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetNotifications`: NotificationSlice
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotifications`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetNotificationsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
appId | string | The app ID that you want to view notifications from | |
limit | int32 | How many notifications to return. Max is 50. Default is 50. | |
offset | int32 | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | |
kind | int32 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OutcomesData GetOutcomes(ctx, appId).OutcomeNames(outcomeNames).OutcomeNames2(outcomeNames2).OutcomeTimeRange(outcomeTimeRange).OutcomePlatforms(outcomePlatforms).OutcomeAttribution(outcomeAttribution).Execute()
View Outcomes
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
outcomeNames := "outcomeNames_example" // string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum
outcomeNames2 := "outcomeNames_example" // string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional)
outcomeTimeRange := "outcomeTimeRange_example" // string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional)
outcomePlatforms := "outcomePlatforms_example" // string | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional)
outcomeAttribution := "outcomeAttribution_example" // string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetOutcomes(appAuth, appId).OutcomeNames(outcomeNames).OutcomeNames2(outcomeNames2).OutcomeTimeRange(outcomeTimeRange).OutcomePlatforms(outcomePlatforms).OutcomeAttribution(outcomeAttribution).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetOutcomes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetOutcomes`: OutcomesData
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetOutcomes`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. |
Other parameters are passed through a pointer to a apiGetOutcomesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
outcomeNames | string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the "os" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | outcomeNames2 | string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where "Sales, Purchase" is the custom outcomes with a comma in the name. | outcomeTimeRange | string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | outcomePlatforms | string | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | outcomeAttribution | string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Player GetPlayer(ctx, playerId).AppId(appId).EmailAuthHash(emailAuthHash).Execute()
View device
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | Your app_id for this device
playerId := "playerId_example" // string | Player's OneSignal ID
emailAuthHash := "emailAuthHash_example" // string | Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetPlayer(appAuth, playerId).AppId(appId).EmailAuthHash(emailAuthHash).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPlayer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetPlayer`: Player
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetPlayer`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
playerId | string | Player's OneSignal ID |
Other parameters are passed through a pointer to a apiGetPlayerRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
appId | string | Your app_id for this device |
emailAuthHash | string | Email - Only required if you have enabled Identity Verification and device_type is email (11). |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PlayerSlice GetPlayers(ctx).AppId(appId).Limit(limit).Offset(offset).Execute()
View devices
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The app ID that you want to view players from
limit := int32(56) // int32 | How many devices to return. Max is 300. Default is 300 (optional)
offset := int32(56) // int32 | Result offset. Default is 0. Results are sorted by id; (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.GetPlayers(appAuth).AppId(appId).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPlayers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetPlayers`: PlayerSlice
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetPlayers`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetPlayersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
appId | string | The app ID that you want to view players from | |
limit | int32 | How many devices to return. Max is 300. Default is 300 | |
offset | int32 | Result offset. Default is 0. Results are sorted by id; |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200 IdentifyUserByAlias(ctx, appId, aliasLabel, aliasId).UserIdentityRequestBody(userIdentityRequestBody).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
userIdentityRequestBody := *onesignal.NewUserIdentityRequestBody() // UserIdentityRequestBody |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.IdentifyUserByAlias(appAuth, appId, aliasLabel, aliasId).UserIdentityRequestBody(userIdentityRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.IdentifyUserByAlias``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `IdentifyUserByAlias`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.IdentifyUserByAlias`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string |
Other parameters are passed through a pointer to a apiIdentifyUserByAliasRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
userIdentityRequestBody | UserIdentityRequestBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserIdentityResponse IdentifyUserBySubscriptionId(ctx, appId, subscriptionId).UserIdentityRequestBody(userIdentityRequestBody).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
subscriptionId := "subscriptionId_example" // string |
userIdentityRequestBody := *onesignal.NewUserIdentityRequestBody() // UserIdentityRequestBody |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.IdentifyUserBySubscriptionId(appAuth, appId, subscriptionId).UserIdentityRequestBody(userIdentityRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.IdentifyUserBySubscriptionId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `IdentifyUserBySubscriptionId`: UserIdentityResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.IdentifyUserBySubscriptionId`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
subscriptionId | string |
Other parameters are passed through a pointer to a apiIdentifyUserBySubscriptionIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
userIdentityRequestBody | UserIdentityRequestBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserIdentityResponse TransferSubscription(ctx, appId, subscriptionId).TransferSubscriptionRequestBody(transferSubscriptionRequestBody).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
subscriptionId := "subscriptionId_example" // string |
transferSubscriptionRequestBody := *onesignal.NewTransferSubscriptionRequestBody() // TransferSubscriptionRequestBody |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.TransferSubscription(appAuth, appId, subscriptionId).TransferSubscriptionRequestBody(transferSubscriptionRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.TransferSubscription``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TransferSubscription`: UserIdentityResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.TransferSubscription`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
subscriptionId | string |
Other parameters are passed through a pointer to a apiTransferSubscriptionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
transferSubscriptionRequestBody | TransferSubscriptionRequestBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
App UpdateApp(ctx, appId).App(app).Execute()
Update an app
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | An app id
app := *onesignal.NewApp() // App |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING")
resp, r, err := apiClient.DefaultApi.UpdateApp(userAuth, appId).App(app).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateApp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateApp`: App
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateApp`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | An app id |
Other parameters are passed through a pointer to a apiUpdateAppRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
app | App | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateLiveActivitySuccessResponse UpdateLiveActivity(ctx, appId, activityId).UpdateLiveActivityRequest(updateLiveActivityRequest).Execute()
Update a Live Activity via Push
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs.
activityId := "activityId_example" // string | Live Activity record ID
updateLiveActivityRequest := *onesignal.NewUpdateLiveActivityRequest("Name_example", "Event_example", map[string]interface{}(123)) // UpdateLiveActivityRequest |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.UpdateLiveActivity(appAuth, appId, activityId).UpdateLiveActivityRequest(updateLiveActivityRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateLiveActivity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateLiveActivity`: UpdateLiveActivitySuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateLiveActivity`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID for your app. Available in Keys & IDs. | |
activityId | string | Live Activity record ID |
Other parameters are passed through a pointer to a apiUpdateLiveActivityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateLiveActivityRequest | UpdateLiveActivityRequest | |
UpdateLiveActivitySuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdatePlayerSuccessResponse UpdatePlayer(ctx, playerId).Player(player).Execute()
Edit device
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
playerId := "playerId_example" // string | Player's OneSignal ID
player := *onesignal.NewPlayer(int32(123)) // Player |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.UpdatePlayer(appAuth, playerId).Player(player).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdatePlayer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdatePlayer`: UpdatePlayerSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdatePlayer`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
playerId | string | Player's OneSignal ID |
Other parameters are passed through a pointer to a apiUpdatePlayerRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
player | Player | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdatePlayerTagsSuccessResponse UpdatePlayerTags(ctx, appId, externalUserId).UpdatePlayerTagsRequestBody(updatePlayerTagsRequestBody).Execute()
Edit tags with external user id
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string | The OneSignal App ID the user record is found under.
externalUserId := "externalUserId_example" // string | The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
updatePlayerTagsRequestBody := *onesignal.NewUpdatePlayerTagsRequestBody() // UpdatePlayerTagsRequestBody | (optional)
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.UpdatePlayerTags(appAuth, appId, externalUserId).UpdatePlayerTagsRequestBody(updatePlayerTagsRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdatePlayerTags``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdatePlayerTags`: UpdatePlayerTagsSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdatePlayerTags`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | The OneSignal App ID the user record is found under. | |
externalUserId | string | The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. |
Other parameters are passed through a pointer to a apiUpdatePlayerTagsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updatePlayerTagsRequestBody | UpdatePlayerTagsRequestBody | |
UpdatePlayerTagsSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateSubscription(ctx, appId, subscriptionId).UpdateSubscriptionRequestBody(updateSubscriptionRequestBody).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
subscriptionId := "subscriptionId_example" // string |
updateSubscriptionRequestBody := *onesignal.NewUpdateSubscriptionRequestBody() // UpdateSubscriptionRequestBody |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.UpdateSubscription(appAuth, appId, subscriptionId).UpdateSubscriptionRequestBody(updateSubscriptionRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateSubscription``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
subscriptionId | string |
Other parameters are passed through a pointer to a apiUpdateSubscriptionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateSubscriptionRequestBody | UpdateSubscriptionRequestBody | |
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse202 UpdateUser(ctx, appId, aliasLabel, aliasId).UpdateUserRequest(updateUserRequest).Execute()
package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api"
)
func main() {
appId := "appId_example" // string |
aliasLabel := "aliasLabel_example" // string |
aliasId := "aliasId_example" // string |
updateUserRequest := *onesignal.NewUpdateUserRequest() // UpdateUserRequest |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING")
resp, r, err := apiClient.DefaultApi.UpdateUser(appAuth, appId, aliasLabel, aliasId).UpdateUserRequest(updateUserRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateUser`: InlineResponse202
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateUser`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
appId | string | ||
aliasLabel | string | ||
aliasId | string |
Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateUserRequest | UpdateUserRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]