diff --git a/README.md b/README.md index 5cb7c051..8de0b16c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # onesignal-java-client OneSignal -- API version: 1.4.0 - - Build date: 2025-04-25T19:31:57.613Z[Etc/UTC] +- API version: 5.0.1 + - Build date: 2025-04-30T16:05:16.972Z[Etc/UTC] A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com @@ -41,7 +41,7 @@ Add this dependency to your project's POM: org.openapitools onesignal-java-client - 1.4.0 + 5.0.1 compile ``` @@ -57,7 +57,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "org.openapitools:onesignal-java-client:1.4.0" + implementation "org.openapitools:onesignal-java-client:5.0.1" } ``` @@ -71,7 +71,7 @@ mvn clean package Then manually install the following JARs: -* `target/onesignal-java-client-1.4.0.jar` +* `target/onesignal-java-client-5.0.1.jar` * `target/lib/*.jar` ## Getting Started @@ -134,41 +134,34 @@ All URIs are relative to *https://api.onesignal.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DefaultApi* | [**beginLiveActivity**](docs/DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity *DefaultApi* | [**cancelNotification**](docs/DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +*DefaultApi* | [**createAlias**](docs/DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**createAliasBySubscription**](docs/DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | *DefaultApi* | [**createApp**](docs/DefaultApi.md#createApp) | **POST** /apps | Create an app *DefaultApi* | [**createNotification**](docs/DefaultApi.md#createNotification) | **POST** /notifications | Create notification -*DefaultApi* | [**createPlayer**](docs/DefaultApi.md#createPlayer) | **POST** /players | Add a device -*DefaultApi* | [**createSegments**](docs/DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments +*DefaultApi* | [**createSegment**](docs/DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment *DefaultApi* | [**createSubscription**](docs/DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | *DefaultApi* | [**createUser**](docs/DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | *DefaultApi* | [**deleteAlias**](docs/DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | -*DefaultApi* | [**deletePlayer**](docs/DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record -*DefaultApi* | [**deleteSegments**](docs/DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +*DefaultApi* | [**deleteSegment**](docs/DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment *DefaultApi* | [**deleteSubscription**](docs/DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | *DefaultApi* | [**deleteUser**](docs/DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -*DefaultApi* | [**endLiveActivity**](docs/DefaultApi.md#endLiveActivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity *DefaultApi* | [**exportEvents**](docs/DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events -*DefaultApi* | [**exportPlayers**](docs/DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players -*DefaultApi* | [**fetchAliases**](docs/DefaultApi.md#fetchAliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | -*DefaultApi* | [**fetchUser**](docs/DefaultApi.md#fetchUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -*DefaultApi* | [**fetchUserIdentity**](docs/DefaultApi.md#fetchUserIdentity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**exportSubscriptions**](docs/DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions +*DefaultApi* | [**getAliases**](docs/DefaultApi.md#getAliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**getAliasesBySubscription**](docs/DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | *DefaultApi* | [**getApp**](docs/DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app *DefaultApi* | [**getApps**](docs/DefaultApi.md#getApps) | **GET** /apps | View apps -*DefaultApi* | [**getEligibleIams**](docs/DefaultApi.md#getEligibleIams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | *DefaultApi* | [**getNotification**](docs/DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification *DefaultApi* | [**getNotificationHistory**](docs/DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History *DefaultApi* | [**getNotifications**](docs/DefaultApi.md#getNotifications) | **GET** /notifications | View notifications *DefaultApi* | [**getOutcomes**](docs/DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes -*DefaultApi* | [**getPlayer**](docs/DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device -*DefaultApi* | [**getPlayers**](docs/DefaultApi.md#getPlayers) | **GET** /players | View devices -*DefaultApi* | [**identifyUserByAlias**](docs/DefaultApi.md#identifyUserByAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | -*DefaultApi* | [**identifyUserBySubscriptionId**](docs/DefaultApi.md#identifyUserBySubscriptionId) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*DefaultApi* | [**getSegments**](docs/DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments +*DefaultApi* | [**getUser**](docs/DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *DefaultApi* | [**transferSubscription**](docs/DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | +*DefaultApi* | [**unsubscribeEmailWithToken**](docs/DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token *DefaultApi* | [**updateApp**](docs/DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app *DefaultApi* | [**updateLiveActivity**](docs/DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push -*DefaultApi* | [**updatePlayer**](docs/DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device -*DefaultApi* | [**updatePlayerTags**](docs/DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id *DefaultApi* | [**updateSubscription**](docs/DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | *DefaultApi* | [**updateUser**](docs/DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | @@ -179,37 +172,25 @@ Class | Method | HTTP request | Description - [BasicNotification](docs/BasicNotification.md) - [BasicNotificationAllOf](docs/BasicNotificationAllOf.md) - [BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md) - - [BeginLiveActivityRequest](docs/BeginLiveActivityRequest.md) - [Button](docs/Button.md) - - [CancelNotificationSuccessResponse](docs/CancelNotificationSuccessResponse.md) - [CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md) - - [CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md) - [CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) - - [CreateSubscriptionRequestBody](docs/CreateSubscriptionRequestBody.md) - [CreateUserConflictResponse](docs/CreateUserConflictResponse.md) - [CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) - [CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) - - [DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md) - - [DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md) - - [DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md) - - [DeleteSegmentSuccessResponse](docs/DeleteSegmentSuccessResponse.md) - [DeliveryData](docs/DeliveryData.md) - [ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md) - - [ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md) - - [ExportPlayersSuccessResponse](docs/ExportPlayersSuccessResponse.md) + - [ExportSubscriptionsRequestBody](docs/ExportSubscriptionsRequestBody.md) + - [ExportSubscriptionsSuccessResponse](docs/ExportSubscriptionsSuccessResponse.md) - [Filter](docs/Filter.md) - - [FilterExpressions](docs/FilterExpressions.md) + - [FilterExpression](docs/FilterExpression.md) - [GenericError](docs/GenericError.md) - - [GenericErrorErrorsInner](docs/GenericErrorErrorsInner.md) - - [GetNotificationRequestBody](docs/GetNotificationRequestBody.md) - - [InlineResponse200](docs/InlineResponse200.md) - - [InlineResponse2003](docs/InlineResponse2003.md) - - [InlineResponse201](docs/InlineResponse201.md) - - [InlineResponse202](docs/InlineResponse202.md) - - [InvalidIdentifierError](docs/InvalidIdentifierError.md) + - [GenericSuccessBoolResponse](docs/GenericSuccessBoolResponse.md) + - [GetNotificationHistoryRequestBody](docs/GetNotificationHistoryRequestBody.md) + - [GetSegmentsSuccessResponse](docs/GetSegmentsSuccessResponse.md) + - [LanguageStringMap](docs/LanguageStringMap.md) - [Notification](docs/Notification.md) - - [Notification200Errors](docs/Notification200Errors.md) - [NotificationAllOf](docs/NotificationAllOf.md) - [NotificationHistorySuccessResponse](docs/NotificationHistorySuccessResponse.md) - [NotificationSlice](docs/NotificationSlice.md) @@ -222,40 +203,34 @@ Class | Method | HTTP request | Description - [PlatformDeliveryData](docs/PlatformDeliveryData.md) - [PlatformDeliveryDataEmailAllOf](docs/PlatformDeliveryDataEmailAllOf.md) - [PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md) - - [Player](docs/Player.md) - - [PlayerNotificationTarget](docs/PlayerNotificationTarget.md) - - [PlayerNotificationTargetIncludeAliases](docs/PlayerNotificationTargetIncludeAliases.md) - - [PlayerSlice](docs/PlayerSlice.md) + - [PropertiesBody](docs/PropertiesBody.md) - [PropertiesDeltas](docs/PropertiesDeltas.md) - [PropertiesObject](docs/PropertiesObject.md) - [Purchase](docs/Purchase.md) - - [RateLimiterError](docs/RateLimiterError.md) + - [RateLimitError](docs/RateLimitError.md) - [Segment](docs/Segment.md) + - [SegmentData](docs/SegmentData.md) - [SegmentNotificationTarget](docs/SegmentNotificationTarget.md) - - [StringMap](docs/StringMap.md) - - [SubscriptionObject](docs/SubscriptionObject.md) + - [Subscription](docs/Subscription.md) + - [SubscriptionBody](docs/SubscriptionBody.md) + - [SubscriptionNotificationTarget](docs/SubscriptionNotificationTarget.md) - [TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md) - [UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) - [UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) - - [UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md) - - [UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md) - - [UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md) - - [UpdateSubscriptionRequestBody](docs/UpdateSubscriptionRequestBody.md) - [UpdateUserRequest](docs/UpdateUserRequest.md) - [User](docs/User.md) - - [UserIdentityRequestBody](docs/UserIdentityRequestBody.md) - - [UserIdentityResponse](docs/UserIdentityResponse.md) - - [UserSubscriptionOptions](docs/UserSubscriptionOptions.md) + - [UserIdentityBody](docs/UserIdentityBody.md) + - [WebButton](docs/WebButton.md) ## Documentation for Authorization Authentication schemes defined for the API: -### app_key +### rest_api_key - **Type**: HTTP basic authentication -### user_key +### user_auth_key - **Type**: HTTP basic authentication diff --git a/api/openapi.yaml b/api/openapi.yaml index b9372958..3b572835 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,7 +8,7 @@ info: customer engagement strategies. Learn more at onesignal.com termsOfService: https://onesignal.com/tos title: OneSignal - version: 1.4.0 + version: 5.0.1 servers: - url: https://api.onesignal.com paths: @@ -77,10 +77,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: View notifications x-accepts: application/json post: @@ -99,14 +99,14 @@ paths: application/json: schema: $ref: '#/components/schemas/CreateNotificationSuccessResponse' - description: "OK, invalid_player_ids, invalid_external_user_ids or No Subscribed\ - \ Players\nIf a message was successfully created, you will get a 200 response\ - \ and an id for the notification.\nIf the 200 response contains \"invalid_player_ids\"\ - \ or \"invalid_external_user_ids\" this will mark devices that exist in\ - \ the provided app_id but are no longer subscribed.\nIf no id is returned,\ - \ then a message was not created and the targeted User IDs do not exist\ - \ under the provided app_id.\nAny User IDs sent in the request that do\ - \ not exist under the specified app_id will be ignored.\n" + description: "OK, invalid_aliases, or No Subscribed Players\nIf a message\ + \ was successfully created, you will get a 200 response and an id for\ + \ the notification.\nIf the 200 response contains \"invalid_aliases\"\ + \ this will mark devices that exist in the provided app_id but are no\ + \ longer subscribed.\nIf no id is returned, then a message was not created\ + \ and the targeted User IDs do not exist under the provided app_id.\n\ + Any User IDs sent in the request that do not exist under the specified\ + \ app_id will be ignored.\n" "400": content: application/json: @@ -117,10 +117,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: Create notification x-content-type: application/json x-accepts: application/json @@ -148,7 +148,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CancelNotificationSuccessResponse' + $ref: '#/components/schemas/GenericSuccessBoolResponse' description: OK "400": content: @@ -156,14 +156,20 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: Stop a scheduled or currently outgoing notification x-accepts: application/json get: @@ -198,14 +204,20 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: View notification x-accepts: application/json /notifications/{notification_id}/history: @@ -235,7 +247,7 @@ paths: type: string style: simple requestBody: - $ref: '#/components/requestBodies/get_notification_request_body' + $ref: '#/components/requestBodies/get_notification_history_request_body' content: application/json: schema: @@ -257,7 +269,7 @@ paths: type: string required: - id - title: get_notification_request_body + title: get_notification_history_request_body type: object required: true responses: @@ -273,14 +285,20 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: Notification History x-content-type: application/json x-accepts: application/json @@ -305,10 +323,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - user_key: [] + - user_auth_key: [] summary: View apps x-accepts: application/json post: @@ -337,10 +355,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - user_key: [] + - user_auth_key: [] summary: Create an app x-content-type: application/json x-accepts: application/json @@ -374,10 +392,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - user_key: [] + - user_auth_key: [] summary: View an app x-accepts: application/json put: @@ -416,24 +434,77 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - user_key: [] + - user_auth_key: [] summary: Update an app x-content-type: application/json x-accepts: application/json /apps/{app_id}/segments: + get: + description: Returns an array of segments from an app. + operationId: get_segments + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: "Segments are listed in ascending order of created_at date. offset\ + \ will omit that number of segments from the beginning of the list. Eg offset\ + \ 5, will remove the 5 earliest created Segments." + explode: true + in: query + name: offset + required: false + schema: + type: integer + style: form + - description: The amount of Segments in the response. Maximum 300. + explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/GetSegmentsSuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Get Segments + x-accepts: application/json post: - description: "Create segments visible and usable in the dashboard and API -\ + description: "Create a segment visible and usable in the dashboard and API -\ \ Required: OneSignal Paid Plan\nThe Create Segment method is used when you\ \ want your server to programmatically create a segment instead of using the\ \ OneSignal Dashboard UI. Just like creating Segments from the dashboard you\ \ can pass in filters with multiple \"AND\" or \"OR\" operator's.\n🚧\n\ Does Not Update Segments\nThis endpoint will only create segments, it does\ \ not edit or update currently created Segments. You will need to use the\ - \ Delete Segments endpoint and re-create it with this endpoint to edit.\n" - operationId: create_segments + \ Delete Segment endpoint and re-create it with this endpoint to edit.\n" + operationId: create_segment parameters: - description: The OneSignal App ID for your app. Available in Keys & IDs. explode: false @@ -472,21 +543,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] - summary: Create Segments + - rest_api_key: [] + summary: Create Segment x-content-type: application/json x-accepts: application/json /apps/{app_id}/segments/{segment_id}: delete: - description: "Delete segments (not user devices) - Required: OneSignal Paid\ + description: "Delete a segment (not user devices) - Required: OneSignal Paid\ \ Plan\nYou can delete a segment under your app by calling this API. You must\ \ provide an API key in the Authorization header that has admin access on\ \ the app.\nThe segment_id can be found in the URL of the segment when viewing\ \ it in the dashboard.\n" - operationId: delete_segments + operationId: delete_segment parameters: - description: The OneSignal App ID for your app. Available in Keys & IDs. explode: false @@ -510,7 +581,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteSegmentSuccessResponse' + $ref: '#/components/schemas/GenericSuccessBoolResponse' description: OK "400": content: @@ -522,17 +593,17 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteSegmentNotFoundResponse' + $ref: '#/components/schemas/GenericSuccessBoolResponse' description: Not Found "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] - summary: Delete Segments + - rest_api_key: [] + summary: Delete Segment x-accepts: application/json /apps/{app_id}/outcomes: get: @@ -622,10 +693,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: View Outcomes x-accepts: application/json /apps/{app_id}/live_activities/{activity_id}/notifications: @@ -672,108 +743,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: Update a Live Activity via Push x-content-type: application/json x-accepts: application/json - /apps/{app_id}/live_activities/{activity_id}/token: - post: - description: Starts a Live Activity - operationId: begin_live_activity - parameters: - - description: The OneSignal App ID for your app. Available in Keys & IDs. - explode: false - in: path - name: app_id - required: true - schema: - type: string - style: simple - - description: Live Activity record ID - explode: false - in: path - name: activity_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BeginLiveActivityRequest' - required: true - responses: - "204": - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - summary: Start Live Activity - x-content-type: application/json - x-accepts: application/json - /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}: - delete: - description: Stops a Live Activity - operationId: end_live_activity - parameters: - - description: The OneSignal App ID for your app. Available in Keys & IDs. - explode: false - in: path - name: app_id - required: true - schema: - type: string - style: simple - - description: Live Activity record ID - explode: false - in: path - name: activity_id - required: true - schema: - type: string - style: simple - - description: Subscription ID - explode: false - in: path - name: subscription_id - required: true - schema: - type: string - style: simple - responses: - "204": - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - summary: Stop Live Activity - x-accepts: application/json /apps/{app_id}/users: post: description: "Creates a User, optionally Subscriptions owned by the User as\ @@ -829,97 +805,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - x-content-type: application/json - x-accepts: application/json - /apps/{app_id}/users/{external_user_id}: - put: - description: "Update an existing device's tags in one of your OneSignal apps\ - \ using the External User ID.\nWarning - Android SDK Data Synchronization\n\ - Tags added through the Android SDK tagging methods may not update if using\ - \ the API to change or update the same tag.\nFor example, if you use SDK method\ - \ sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with\ - \ this API endpoint. You will not be able to set the value back to \"value1\"\ - \ through the SDK, you will need to change it to something different through\ - \ the SDK to be reset.\nRecommendations if using this Endpoint on Android\ - \ Mobile Apps:\n1 - Do not use the same tag keys for SDK and API updates\n\ - 2 - If you want to use the same key for both SDK and API updates, call the\ - \ SDK getTags method first to update the device's tags.\nThis is only applicable\ - \ on the Android Mobile App SDKs.\n📘\nDeleting Tags\nTo delete a tag,\ - \ include its key and set its value to blank. Omitting a key/value will not\ - \ delete it.\nFor example, if I wanted to delete two existing tags rank and\ - \ category while simultaneously adding a new tag class, the tags JSON would\ - \ look like the following:\n\"tags\": {\n \"rank\": \"\",\n \"category\"\ - : \"\",\n \"class\": \"my_new_value\"\n}\n" - operationId: update_player_tags - parameters: - - description: The OneSignal App ID the user record is found under. - explode: false - in: path - name: app_id - required: true - schema: - type: string - style: simple - - description: The External User ID mapped to teh device record in OneSignal. Must - be actively set on the device to be updated. - explode: false - in: path - name: external_user_id - required: true - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/update_player_tags_request_body' - content: - application/json: - schema: - properties: - tags: - description: "Custom tags for the device record. Only support string\ - \ key value pairs. Does not support arrays or other nested objects.\ - \ Example `{\"foo\":\"bar\",\"this\":\"that\"}`.\nLimitations:\n\ - - 100 tags per call\n- Android SDK users: tags cannot be removed\ - \ or changed via API if set through SDK sendTag methods.\nRecommended\ - \ to only tag devices with 1 kilobyte of ata\nPlease consider\ - \ using your own Database to save more than 1 kilobyte of data.\ - \ See: Internal Database & CRM\n" - type: object - title: update_player_tags_request_body - type: object - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePlayerTagsSuccessResponse' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "409": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Conflict - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] - summary: Edit tags with external user id + - rest_api_key: [] x-content-type: application/json x-accepts: application/json /apps/{app_id}/users/by/{alias_label}/{alias_id}: @@ -968,14 +857,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-accepts: application/json get: description: "Returns the User’s properties, Aliases, and Subscriptions." - operationId: fetch_user + operationId: get_user parameters: - explode: false in: path @@ -1011,14 +900,20 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-accepts: application/json patch: description: Updates an existing User’s properties. @@ -1056,7 +951,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_202' + $ref: '#/components/schemas/PropertiesBody' description: ACCEPTED "400": content: @@ -1074,16 +969,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-content-type: application/json x-accepts: application/json /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity: get: description: "Lists all Aliases for the User identified by (:alias_label, :alias_id)." - operationId: fetch_user_identity + operationId: get_aliases parameters: - explode: false in: path @@ -1111,7 +1006,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200' + $ref: '#/components/schemas/UserIdentityBody' description: OK "400": content: @@ -1119,19 +1014,25 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-accepts: application/json patch: description: "Upserts one or more Aliases to an existing User identified by\ \ (:alias_label, :alias_id)." - operationId: identify_user_by_alias + operationId: create_alias parameters: - explode: false in: path @@ -1158,14 +1059,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserIdentityRequestBody' + $ref: '#/components/schemas/UserIdentityBody' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/inline_response_200' + $ref: '#/components/schemas/UserIdentityBody' description: OK "400": content: @@ -1173,6 +1074,12 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1183,10 +1090,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-content-type: application/json x-accepts: application/json /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}: @@ -1227,7 +1134,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200' + $ref: '#/components/schemas/UserIdentityBody' description: OK "400": content: @@ -1235,6 +1142,12 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1245,10 +1158,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-accepts: application/json /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions: post: @@ -1281,20 +1194,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateSubscriptionRequestBody' + $ref: '#/components/schemas/SubscriptionBody' required: true responses: "201": content: application/json: schema: - $ref: '#/components/schemas/inline_response_201' + $ref: '#/components/schemas/SubscriptionBody' description: CREATED "202": content: application/json: schema: - $ref: '#/components/schemas/inline_response_201' + $ref: '#/components/schemas/SubscriptionBody' description: ACCEPTED "400": content: @@ -1302,6 +1215,12 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1313,10 +1232,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-content-type: application/json x-accepts: application/json /apps/{app_id}/subscriptions/{subscription_id}: @@ -1347,6 +1266,12 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1357,10 +1282,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-accepts: application/json patch: description: Updates an existing Subscription’s properties. @@ -1384,17 +1309,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateSubscriptionRequestBody' + $ref: '#/components/schemas/SubscriptionBody' required: true responses: - "202": - description: ACCEPTED + "200": + description: OK "400": content: application/json: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1405,16 +1336,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-content-type: application/json x-accepts: application/json /apps/{app_id}/subscriptions/{subscription_id}/user/identity: get: description: Lists all Aliases for the User identified by :subscription_id. - operationId: fetch_aliases + operationId: get_aliases_by_subscription parameters: - explode: false in: path @@ -1435,7 +1366,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserIdentityResponse' + $ref: '#/components/schemas/UserIdentityBody' description: OK "400": content: @@ -1443,12 +1374,18 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found security: - - app_key: [] + - rest_api_key: [] x-accepts: application/json patch: description: Upserts one or more Aliases for the User identified by :subscription_id. - operationId: identify_user_by_subscription_id + operationId: create_alias_by_subscription parameters: - explode: false in: path @@ -1468,14 +1405,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserIdentityRequestBody' + $ref: '#/components/schemas/UserIdentityBody' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UserIdentityResponse' + $ref: '#/components/schemas/UserIdentityBody' description: OK "400": content: @@ -1483,6 +1420,12 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1493,10 +1436,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-content-type: application/json x-accepts: application/json /apps/{app_id}/subscriptions/{subscription_id}/owner: @@ -1530,7 +1473,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserIdentityResponse' + $ref: '#/components/schemas/UserIdentityBody' description: OK "400": content: @@ -1538,6 +1481,12 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found "409": content: application/json: @@ -1548,289 +1497,50 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] x-content-type: application/json x-accepts: application/json - /apps/{app_id}/subscriptions/{subscription_id}/iams: - get: - description: Manifest of In-App Messages the Subscription is eligible to display - by the SDK. - operationId: get_eligible_iams - parameters: - - explode: false - in: path - name: app_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: subscription_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_200_3' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - x-accepts: application/json - /players: - get: - description: "View the details of multiple devices in one of your OneSignal\ - \ apps\nUnavailable for Apps Over 80,000 Users\nFor performance reasons, this\ - \ method is not available for larger apps. Larger apps should use the CSV\ - \ export API endpoint, which is much more performant.\n" - operationId: get_players - parameters: - - description: The app ID that you want to view players from - explode: true - in: query - name: app_id - required: true - schema: - type: string - style: form - - description: How many devices to return. Max is 300. Default is 300 - explode: true - in: query - name: limit - required: false - schema: - type: integer - style: form - - description: Result offset. Default is 0. Results are sorted by id; - explode: true - in: query - name: offset - required: false - schema: - type: integer - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PlayerSlice' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - summary: View devices - x-accepts: application/json - post: - description: "Register a new device to one of your OneSignal apps\n🚧\n\ - Don't use this\nThis API endpoint is designed to be used from our open source\ - \ Mobile and Web Push SDKs. It is not designed for developers to use it directly,\ - \ unless instructed to do so by OneSignal support.\nIf you use this method\ - \ instead of our SDKs, many OneSignal features such as conversion tracking,\ - \ timezone tracking, language detection, and rich-push won't work out of the\ - \ box. It will also make it harder to identify possible setup issues.\nThis\ - \ method is used to register a new device with OneSignal.\nIf a device is\ - \ already registered with the specified identifier, then this will update\ - \ the existing device record instead of creating a new one.\nThe returned\ - \ player is a player / user ID. Use the returned ID to send push notifications\ - \ to this specific user later, or to include this player when sending to a\ - \ set of users.\n🚧\niOS\nMust set test_type to 1 when building your\ - \ iOS app as development. Omit this field in your production app builds.\n" - operationId: create_player - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Player' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePlayerSuccessResponse' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "409": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Conflict - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - summary: Add a device - x-content-type: application/json - x-accepts: application/json - /players/{player_id}: - delete: - description: "Delete player - Required:\nUsed to delete a single, specific Player\ - \ ID record from a specific OneSignal app.\n" - operationId: delete_player + /apps/{app_id}/notifications/{notification_id}/unsubscribe: + post: + description: Unsubscribe an email with a token when using your own custom email + unsubscribe landing page + operationId: unsubscribe_email_with_token parameters: - description: The OneSignal App ID for your app. Available in Keys & IDs. - explode: true - in: query - name: app_id - required: true - schema: - type: string - style: form - - description: The OneSignal player_id explode: false in: path - name: player_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DeletePlayerSuccessResponse' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/DeletePlayerNotFoundResponse' - description: Not Found - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - summary: Delete a user record - x-accepts: application/json - get: - description: View the details of an existing device in one of your OneSignal - apps - operationId: get_player - parameters: - - description: Your app_id for this device - explode: true - in: query name: app_id required: true schema: type: string - style: form - - description: Player's OneSignal ID + style: simple + - description: "The id of the message found in the creation notification POST\ + \ response, View Notifications GET response, or URL within the Message Report." explode: false in: path - name: player_id + name: notification_id required: true schema: type: string style: simple - - description: Email - Only required if you have enabled Identity Verification - and device_type is email (11). + - description: "The unsubscribe token that is generated via liquid syntax in\ + \ {{subscription.unsubscribe_token}} when personalizing an email." explode: true in: query - name: email_auth_hash - required: false - schema: - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Player' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Bad Request - "429": - content: - application/json: - schema: - $ref: '#/components/schemas/RateLimiterError' - description: Rate Limit Exceeded - security: - - app_key: [] - summary: View device - x-accepts: application/json - put: - description: Update an existing device in one of your OneSignal apps - operationId: update_player - parameters: - - description: Player's OneSignal ID - explode: false - in: path - name: player_id + name: token required: true schema: type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Player' - required: true + style: form responses: - "200": + "202": content: application/json: schema: - $ref: '#/components/schemas/UpdatePlayerSuccessResponse' + $ref: '#/components/schemas/GenericSuccessBoolResponse' description: OK "400": content: @@ -1838,22 +1548,15 @@ paths: schema: $ref: '#/components/schemas/GenericError' description: Bad Request - "409": - content: - application/json: - schema: - $ref: '#/components/schemas/GenericError' - description: Conflict "429": content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] - summary: Edit device - x-content-type: application/json + - rest_api_key: [] + summary: Unsubscribe with token x-accepts: application/json /players/csv_export?app_id={app_id}: post: @@ -1899,7 +1602,7 @@ paths: \ rooted or not |\n | ip | IP Address of the device if being tracked. See\ \ Handling Personal Data. |\n | web_auth | Web Only authorization key. |\n\ \ | web_p256 | Web Only p256 key. |\n" - operationId: export_players + operationId: export_subscriptions parameters: - description: The app ID that you want to export devices from explode: false @@ -1910,7 +1613,7 @@ paths: type: string style: simple requestBody: - $ref: '#/components/requestBodies/export_players_request_body' + $ref: '#/components/requestBodies/export_subscriptions_request_body' content: application/json: schema: @@ -1929,14 +1632,14 @@ paths: segment_name: description: Export all devices belonging to the segment. type: string - title: export_players_request_body + title: export_subscriptions_request_body type: object responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ExportPlayersSuccessResponse' + $ref: '#/components/schemas/ExportSubscriptionsSuccessResponse' description: OK "400": content: @@ -1948,11 +1651,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] - summary: Export CSV of Players + - rest_api_key: [] + summary: Export CSV of Subscriptions x-content-type: application/json x-accepts: application/json /notifications/{notification_id}/export_events?app_id={app_id}: @@ -2001,31 +1704,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' + $ref: '#/components/schemas/RateLimitError' description: Rate Limit Exceeded security: - - app_key: [] + - rest_api_key: [] summary: Export CSV of Events x-accepts: application/json components: requestBodies: - get_notification_request_body: + get_notification_history_request_body: content: application/json: schema: - $ref: '#/components/schemas/get_notification_request_body' + $ref: '#/components/schemas/get_notification_history_request_body' required: true - update_player_tags_request_body: - content: - application/json: - schema: - $ref: '#/components/schemas/update_player_tags_request_body' - required: false - export_players_request_body: + export_subscriptions_request_body: content: application/json: schema: - $ref: '#/components/schemas/export_players_request_body' + $ref: '#/components/schemas/export_subscriptions_request_body' schemas: App: example: @@ -2237,26 +1934,13 @@ components: type: string type: array type: object - PlayerNotificationTarget: + SubscriptionNotificationTarget: properties: - include_player_ids: - deprecated: true - description: "Specific playerids to send your notification to. _Does not\ - \ require API Auth Key.\nDo not combine with other targeting parameters.\ - \ Not compatible with any other targeting parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"\ - ]\nLimit of 2,000 entries per REST API call\n" - items: - type: string - nullable: true - type: array - include_external_user_ids: - deprecated: true - description: "Target specific devices by custom user IDs assigned via API.\n\ - Not compatible with any other targeting parameters\nExample: [\"custom-id-assigned-by-api\"\ - ]\nREQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\ - \ API call.\nNote: If targeting push, email, or sms subscribers with same\ - \ ids, use with channel_for_external_user_ids to indicate you are sending\ - \ a push or email or sms.\n" + include_subscription_ids: + description: "Specific subscription ids to send your notification to. _Does\ + \ not require API Auth Key._\nNot compatible with any other targeting\ + \ parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"]\nLimit\ + \ of 2,000 entries per REST API call\n" items: type: string nullable: true @@ -2279,9 +1963,9 @@ components: type: string type: array include_ios_tokens: - description: "Not Recommended: Please consider using include_player_ids\ - \ or include_external_user_ids instead.\nTarget using iOS device tokens.\n\ - Warning: Only works with Production tokens.\nAll non-alphanumeric characters\ + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using iOS device tokens.\nWarning:\ + \ Only works with Production tokens.\nAll non-alphanumeric characters\ \ must be removed from each token. If a token does not correspond to an\ \ existing user, a new user will be created.\nExample: ce777617da7f548fe7a9ab6febb56cf39fba6d38203...\n\ Limit of 2,000 entries per REST API call\n" @@ -2289,44 +1973,44 @@ components: type: string type: array include_wp_wns_uris: - description: "Not Recommended: Please consider using include_player_ids\ - \ or include_external_user_ids instead.\nTarget using Windows URIs. If\ - \ a token does not correspond to an existing user, a new user will be\ - \ created.\nExample: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-...\n\ - Limit of 2,000 entries per REST API call\n" + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Windows URIs. If a token does\ + \ not correspond to an existing user, a new user will be created.\nExample:\ + \ http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-...\nLimit of 2,000 entries\ + \ per REST API call\n" items: type: string type: array include_amazon_reg_ids: - description: "Not Recommended: Please consider using include_player_ids\ - \ or include_external_user_ids instead.\nTarget using Amazon ADM registration\ - \ IDs. If a token does not correspond to an existing user, a new user\ - \ will be created.\nExample: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV...\n\ + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Amazon ADM registration IDs.\ + \ If a token does not correspond to an existing user, a new user will\ + \ be created.\nExample: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV...\n\ Limit of 2,000 entries per REST API call\n" items: type: string type: array include_chrome_reg_ids: - description: "Not Recommended: Please consider using include_player_ids\ - \ or include_external_user_ids instead.\nTarget using Chrome App registration\ - \ IDs. If a token does not correspond to an existing user, a new user\ - \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ - Limit of 2,000 entries per REST API call\n" + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Chrome App registration IDs.\ + \ If a token does not correspond to an existing user, a new user will\ + \ be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\nLimit\ + \ of 2,000 entries per REST API call\n" items: type: string type: array include_chrome_web_reg_ids: - description: "Not Recommended: Please consider using include_player_ids\ - \ or include_external_user_ids instead.\nTarget using Chrome Web Push\ - \ registration IDs. If a token does not correspond to an existing user,\ - \ a new user will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Chrome Web Push registration\ + \ IDs. If a token does not correspond to an existing user, a new user\ + \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ Limit of 2,000 entries per REST API call\n" items: type: string type: array include_android_reg_ids: - description: "Not Recommended: Please consider using include_player_ids\ - \ or include_external_user_ids instead.\nTarget using Android device registration\ + description: "Not Recommended: Please consider using include_subscription_ids\ + \ or include_aliases instead.\nTarget using Android device registration\ \ IDs. If a token does not correspond to an existing user, a new user\ \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ Limit of 2,000 entries per REST API call\n" @@ -2334,7 +2018,21 @@ components: type: string type: array include_aliases: - $ref: '#/components/schemas/PlayerNotificationTarget_include_aliases' + additionalProperties: + items: + type: string + type: array + description: "Target specific users by aliases assigned via API. An alias\ + \ can be an external_id, onesignal_id, or a custom alias.\nAccepts an\ + \ object where keys are alias labels and values are arrays of alias IDs\ + \ to include\nExample usage: { \"external_id\": [\"exId1\", \"extId2\"\ + ], \"internal_label\": [\"id1\", \"id2\"] }\nNot compatible with any other\ + \ targeting parameters.\nREQUIRED: REST API Key Authentication\nLimit\ + \ of 2,000 entries per REST API call\nNote: If targeting push, email,\ + \ or sms subscribers with same ids, use with target_channel to indicate\ + \ you are sending a push or email or sms." + nullable: true + type: object target_channel: enum: - push @@ -2345,7 +2043,7 @@ components: NotificationTarget: anyOf: - $ref: '#/components/schemas/SegmentNotificationTarget' - - $ref: '#/components/schemas/PlayerNotificationTarget' + - $ref: '#/components/schemas/SubscriptionNotificationTarget' BasicNotification: allOf: - $ref: '#/components/schemas/NotificationTarget' @@ -2373,11 +2071,64 @@ components: required: - id type: object - Buttons: - items: - $ref: '#/components/schemas/Button' - type: array - StringMap: + WebButton: + properties: + id: + type: string + text: + type: string + icon: + type: string + url: + type: string + required: + - id + type: object + LanguageStringMap: + example: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr properties: en: description: Text in English. Will be used as a fallback @@ -2581,7 +2332,7 @@ components: example: amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku properties: sku: @@ -2595,7 +2346,7 @@ components: and conversion of amount. type: string count: - type: number + type: integer required: - amount - iso @@ -2639,8 +2390,8 @@ components: Filter: properties: field: - description: Name of the field to use as the first operand in the filter - expression. + description: Required. Name of the field to use as the first operand in + the filter expression. type: string key: description: "If `field` is `tag`, this field is *required* to specify `key`\ @@ -2650,8 +2401,24 @@ components: description: Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. type: string + hours_ago: + description: "If `field` is session-related, this is *required* to specify\ + \ the number of hours before or after the user's session." + type: string + radius: + description: "If `field` is `location`, this will specify the radius in\ + \ meters from a provided location point. Use with `lat` and `long`." + type: number + lat: + description: "If `field` is `location`, this is *required* to specify the\ + \ user's latitude." + type: number + long: + description: "If `field` is `location`, this is *required* to specify the\ + \ user's longitude." + type: number relation: - description: Operator of a filter expression. + description: Required. Operator of a filter expression. enum: - '>' - < @@ -2662,9 +2429,6 @@ components: - time_elapsed_gt - time_elapsed_lt type: string - required: - - field - - relation type: object Operator: properties: @@ -2676,8 +2440,8 @@ components: - AND type: string type: object - FilterExpressions: - anyOf: + FilterExpression: + oneOf: - $ref: '#/components/schemas/Filter' - $ref: '#/components/schemas/Operator' Segment: @@ -2698,302 +2462,181 @@ components: description: "Filter or operators the segment will have. For a list of\ \ available filters with details, please see Send to Users Based on Filters." items: - $ref: '#/components/schemas/FilterExpressions' + $ref: '#/components/schemas/FilterExpression' type: array required: - filters - name type: object - Player: + SegmentData: example: - country: country - external_user_id_auth_hash: external_user_id_auth_hash - device_model: device_model - timezone: 5 - created_at: 9 - device_type: 5 - language: language - playtime: 3 - long: 1.0246457001441578 - amount_spent: 7.061401241503109 + is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at id: id app_id: app_id - lat: 1.4894159098541704 - identifier: identifier - game_version: game_version - notification_types: 7 - device_os: device_os - email_auth_hash: email_auth_hash - test_type: 1 - external_user_id: external_user_id - tags: "{}" - ad_id: ad_id - session_count: 2 - sdk: sdk - last_active: 4 - invalid_identifier: true - badge_count: 2 properties: id: - description: The device's OneSignal ID - readOnly: true - type: string - invalid_identifier: - description: "If true, this is the equivalent of a user being Unsubscribed" - readOnly: true - type: boolean - app_id: - type: string - device_type: - description: | - Required - The device's platform: - 0 = iOS - 1 = Android - 2 = Amazon - 3 = WindowsPhone (MPNS) - 4 = Chrome Apps / Extensions - 5 = Chrome Web Push - 6 = Windows (WNS) - 7 = Safari - 8 = Firefox - 9 = MacOS - 10 = Alexa - 11 = Email - 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM - 14 = SMS - type: integer - external_user_id: - description: a custom user ID - nullable: true - type: string - external_user_id_auth_hash: - description: Only required if you have enabled Identity Verification and - device_type is NOT 11 email. - type: string - email_auth_hash: - description: Email - Only required if you have enabled Identity Verification - and device_type is email (11). - type: string - identifier: - description: "Recommended: For Push Notifications, this is the Push Token\ - \ Identifier from Google or Apple. For Apple Push identifiers, you must\ - \ strip all non alphanumeric characters.\nExamples:\niOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0\n\ - Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV...\n\ - For Email Addresses, set the full email address email@email.com and make\ - \ sure to set device_type to 11.\n" - nullable: true - type: string - language: - description: "Language code. Typically lower case two letters, except for\ - \ Chinese where it must be one of zh-Hans or zh-Hant. Example: en\n" - type: string - timezone: - description: "Number of seconds away from UTC. Example: -28800\n" - nullable: true - type: integer - game_version: - description: "Version of your app. Example: 1.1\n" - nullable: true - type: string - device_model: - description: "Device make and model. Example: iPhone5,1\n" - nullable: true + description: The segment ID type: string - device_os: - description: "Device operating system version. Example: 7.0.4\n" - nullable: true + name: + description: The segment name type: string - ad_id: - description: | - The ad id for the device's platform: - Android = Advertising Id - iOS = identifierForVendor - WP8.0 = DeviceUniqueId - WP8.1 = AdvertisingId - nullable: true + created_at: + description: Date segment created type: string - sdk: - description: Name and version of the sdk/plugin that's calling this API - method (if any) - nullable: true + updated_at: + description: Date segment last updated type: string - session_count: - description: "Number of times the user has played the game, defaults to\ - \ 1" - type: integer - tags: - description: "Custom tags for the player. Only support string and integer\ - \ key value pairs. Does not support arrays or other nested objects. Setting\ - \ a tag value to null or an empty string will remove the tag. Example:\ - \ {\"foo\":\"bar\",\"this\":\"that\"}\nLimitations:\n- 100 tags per call\n\ - - Android SDK users: tags cannot be removed or changed via API if set\ - \ through SDK sendTag methods.\nRecommended to only tag devices with 1\ - \ kilobyte of data\nPlease consider using your own Database to save more\ - \ than 1 kilobyte of data. See: Internal Database & CRM\n" - nullable: true - type: object - amount_spent: - description: "Amount the user has spent in USD, up to two decimal places" - type: number - created_at: - description: Unixtime when the player joined the game - format: int64 - type: integer - playtime: - description: Seconds player was running your app. - format: int64 - type: integer - badge_count: - description: "Current iOS badge count displayed on the app icon\nNOTE: Not\ - \ supported for apps created after June 2018, since badge count for apps\ - \ created after this date are handled on the client.\n" - type: integer - last_active: - description: Unixtime when the player was last active - type: integer - notification_types: - description: | - 1 = subscribed - -2 = unsubscribed - iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. - Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues. - type: integer - test_type: - description: | - This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. - 1 = Development - 2 = Ad-Hoc - Omit this field for App Store builds. - nullable: true - type: integer - long: - description: "Longitude of the device, used for geotagging to segment on." - type: number - lat: - description: "Latitude of the device, used for geotagging to segment on." - type: number - country: - description: Country code in the ISO 3166-1 Alpha 2 format + app_id: + description: The app id type: string - required: - - device_type + read_only: + description: Is the segment read only? + type: boolean + is_active: + description: Is the segment active? + type: boolean type: object - Players: - items: - $ref: '#/components/schemas/Player' - type: array - PlayerSlice: + GetSegmentsSuccessResponse: example: offset: 6 total_count: 0 - players: - - country: country - external_user_id_auth_hash: external_user_id_auth_hash - device_model: device_model - timezone: 5 - created_at: 9 - device_type: 5 - language: language - playtime: 3 - long: 1.0246457001441578 - amount_spent: 7.061401241503109 + limit: 1 + segments: + - is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at id: id app_id: app_id - lat: 1.4894159098541704 - identifier: identifier - game_version: game_version - notification_types: 7 - device_os: device_os - email_auth_hash: email_auth_hash - test_type: 1 - external_user_id: external_user_id - tags: "{}" - ad_id: ad_id - session_count: 2 - sdk: sdk - last_active: 4 - invalid_identifier: true - badge_count: 2 - - country: country - external_user_id_auth_hash: external_user_id_auth_hash - device_model: device_model - timezone: 5 - created_at: 9 - device_type: 5 - language: language - playtime: 3 - long: 1.0246457001441578 - amount_spent: 7.061401241503109 + - is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at id: id app_id: app_id - lat: 1.4894159098541704 - identifier: identifier - game_version: game_version - notification_types: 7 - device_os: device_os - email_auth_hash: email_auth_hash - test_type: 1 - external_user_id: external_user_id - tags: "{}" - ad_id: ad_id - session_count: 2 - sdk: sdk - last_active: 4 - invalid_identifier: true - badge_count: 2 - limit: 1 properties: total_count: + description: The number of Segments in the response. type: integer offset: + description: Set with the offset query parameter. Default 0. type: integer limit: + description: Maximum number of Segments returned. Default 300. type: integer - players: - items: - $ref: '#/components/schemas/Player' - type: array - type: object - InvalidIdentifierError: - properties: - invalid_external_user_ids: - description: Returned if using include_external_user_ids - items: - type: string - type: array - invalid_player_ids: - description: Returned if using include_player_ids and some were valid and - others were not. + segments: + description: An array containing the Segment information. items: - type: string + $ref: '#/components/schemas/SegmentData' type: array type: object - NoSubscribersError: - description: | - Returned if no subscribed players. - items: - format: string - type: string - type: array - Notification200Errors: - oneOf: - - $ref: '#/components/schemas/InvalidIdentifierError' - - $ref: '#/components/schemas/NoSubscribersError' UpdateLiveActivityRequest: example: event_updates: "{}" - name: headings + stale_date: 0 + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + sound: sound + name: name + headings: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + dismissal_date: 6 event: update - dismiss_at: 0.8008281904610115 + priority: 1 properties: name: - description: Type of live activity - enum: - - headings - - contents - - ios_sound - - priority_level + description: An internal name to assist with your campaign organization. + This does not get displayed in the message itself. type: string event: enum: @@ -3001,30 +2644,44 @@ components: - end type: string event_updates: + description: This must match the ContentState interface you have defined + within your Live Activity in your app. type: object - dismiss_at: - description: Timestamp; only allowed if event is "end" - type: number + contents: + $ref: '#/components/schemas/LanguageStringMap' + headings: + $ref: '#/components/schemas/LanguageStringMap' + sound: + description: Sound file that is included in your app to play instead of + the default device notification sound. Omit to disable vibration and sound + for the notification. + type: string + stale_date: + description: "Accepts Unix timestamp in seconds. When time reaches the configured\ + \ stale date, the system considers the Live Activity out of date, and\ + \ the ActivityState of the Live Activity changes to ActivityState.stale." + type: integer + dismissal_date: + description: Accepts Unix timestamp in seconds; only allowed if event is + "end" + type: integer + priority: + description: "Delivery priority through the the push provider (APNs). Pass\ + \ 10 for higher priority notifications, or 5 for lower priority notifications.\ + \ Lower priority notifications are sent based on the power considerations\ + \ of the end user's device. If not set, defaults to 10. Some providers\ + \ (APNs) allow for a limited budget of high priority notifications per\ + \ hour, and if that budget is exceeded, the provider may throttle notification\ + \ delivery." + type: integer required: - event - event_updates - name type: object - BeginLiveActivityRequest: - example: - subscription_id: subscription_id - push_token: push_token - properties: - push_token: - type: string - subscription_id: - type: string - required: - - push_token - - subscription_id - type: object IdentityObject: - additionalProperties: true + additionalProperties: + type: string type: object PropertiesObject: example: @@ -3032,17 +2689,17 @@ components: purchases: - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku ip: ip timezone_id: timezone_id language: language - first_active: 1.4658129805029452 - last_active: 5.962133916683182 + first_active: 1 + last_active: 5 lat: 0.8008281904610115 long: 6.027456183070403 tags: @@ -3063,9 +2720,9 @@ components: country: type: string first_active: - type: number + type: integer last_active: - type: number + type: integer amount_spent: type: number purchases: @@ -3080,39 +2737,39 @@ components: purchases: - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - session_count: 6.027456183070403 - session_time: 0.8008281904610115 + session_count: 6 + session_time: 0 properties: session_time: - type: number + type: integer session_count: - type: number + type: integer purchases: items: $ref: '#/components/schemas/Purchase' type: array type: object - SubscriptionObject: + Subscription: example: - notification_types: 7.061401241503109 + notification_types: 7 device_model: device_model app_version: app_version web_p256: web_p256 - net_type: 4.145608029883936 + net_type: 4 type: iOSPush device_os: device_os enabled: true - session_time: 9.301444243932576 - test_type: 2.027123023002322 + session_time: 9 + test_type: 2 token: token carrier: carrier - session_count: 3.616076749251911 + session_count: 3 web_auth: web_auth rooted: true id: id @@ -3141,11 +2798,11 @@ components: enabled: type: boolean notification_types: - type: number + type: integer session_time: - type: number + type: integer session_count: - type: number + type: integer sdk: type: string device_model: @@ -3155,11 +2812,11 @@ components: rooted: type: boolean test_type: - type: number + type: integer app_version: type: string net_type: - type: number + type: integer carrier: type: string web_auth: @@ -3170,60 +2827,58 @@ components: User: example: subscriptions: - - notification_types: 7.061401241503109 + - notification_types: 7 device_model: device_model app_version: app_version web_p256: web_p256 - net_type: 4.145608029883936 + net_type: 4 type: iOSPush device_os: device_os enabled: true - session_time: 9.301444243932576 - test_type: 2.027123023002322 + session_time: 9 + test_type: 2 token: token carrier: carrier - session_count: 3.616076749251911 + session_count: 3 web_auth: web_auth rooted: true id: id sdk: sdk - - notification_types: 7.061401241503109 + - notification_types: 7 device_model: device_model app_version: app_version web_p256: web_p256 - net_type: 4.145608029883936 + net_type: 4 type: iOSPush device_os: device_os enabled: true - session_time: 9.301444243932576 - test_type: 2.027123023002322 + session_time: 9 + test_type: 2 token: token carrier: carrier - session_count: 3.616076749251911 + session_count: 3 web_auth: web_auth rooted: true id: id sdk: sdk identity: - key: "" - subscription_options: - retain_previous_owner: true + key: identity properties: country: country purchases: - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku ip: ip timezone_id: timezone_id language: language - first_active: 1.4658129805029452 - last_active: 5.962133916683182 + first_active: 1 + last_active: 5 lat: 0.8008281904610115 long: 6.027456183070403 tags: @@ -3233,14 +2888,13 @@ components: properties: $ref: '#/components/schemas/PropertiesObject' identity: - additionalProperties: true + additionalProperties: + type: string type: object subscriptions: items: - $ref: '#/components/schemas/SubscriptionObject' + $ref: '#/components/schemas/Subscription' type: array - subscription_options: - $ref: '#/components/schemas/User_subscription_options' type: object UpdateUserRequest: example: @@ -3249,30 +2903,30 @@ components: purchases: - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - session_count: 6.027456183070403 - session_time: 0.8008281904610115 + session_count: 6 + session_time: 0 properties: country: country purchases: - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku - amount: amount iso: iso - count: 2.3021358869347655 + count: 2 sku: sku ip: ip timezone_id: timezone_id language: language - first_active: 1.4658129805029452 - last_active: 5.962133916683182 + first_active: 1 + last_active: 5 lat: 0.8008281904610115 long: 6.027456183070403 tags: @@ -3289,23 +2943,20 @@ components: type: object CreateNotificationSuccessResponse: example: - recipients: 0 external_id: external_id id: id - errors: null + errors: "" properties: id: type: string - recipients: - description: Estimated number of subscribers targetted by notification. - type: integer external_id: nullable: true type: string errors: - $ref: '#/components/schemas/Notification200Errors' + description: "Errors include the identifiers that are invalid, or that there\ + \ are no subscribers." type: object - CancelNotificationSuccessResponse: + GenericSuccessBoolResponse: example: success: true properties: @@ -3322,13 +2973,6 @@ components: destination_url: type: string type: object - UpdatePlayerTagsSuccessResponse: - example: - success: true - properties: - success: - type: boolean - type: object CreateSegmentSuccessResponse: example: success: true @@ -3349,48 +2993,7 @@ components: type: string type: array type: object - DeleteSegmentSuccessResponse: - example: - success: true - properties: - success: - type: boolean - type: object - DeleteSegmentNotFoundResponse: - properties: - success: - type: boolean - type: object - CreatePlayerSuccessResponse: - example: - success: true - id: id - properties: - success: - type: boolean - id: - type: string - type: object - DeletePlayerSuccessResponse: - example: - success: true - properties: - success: - type: boolean - type: object - DeletePlayerNotFoundResponse: - properties: - success: - type: boolean - type: object - UpdatePlayerSuccessResponse: - example: - success: true - properties: - success: - type: boolean - type: object - ExportPlayersSuccessResponse: + ExportSubscriptionsSuccessResponse: example: csv_file_url: csv_file_url properties: @@ -3399,13 +3002,10 @@ components: type: object UpdateLiveActivitySuccessResponse: example: - notification_id: notification_id - errors: null + id: id properties: - notification_id: + id: type: string - errors: - $ref: '#/components/schemas/Notification200Errors' type: object CreateUserConflictResponse: properties: @@ -3416,94 +3016,91 @@ components: type: object GenericError: properties: - errors: - items: - $ref: '#/components/schemas/GenericError_errors_inner' - type: array + errors: {} + success: + type: boolean + reference: {} type: object - RateLimiterError: + RateLimitError: properties: errors: items: - $ref: '#/components/schemas/GenericError_errors_inner' + type: string type: array + limit: + type: string type: object - CreateSubscriptionRequestBody: + PropertiesBody: example: - subscription: - notification_types: 7.061401241503109 - device_model: device_model - app_version: app_version - web_p256: web_p256 - net_type: 4.145608029883936 - type: iOSPush - device_os: device_os - enabled: true - session_time: 9.301444243932576 - test_type: 2.027123023002322 - token: token - carrier: carrier - session_count: 3.616076749251911 - web_auth: web_auth - rooted: true - id: id - sdk: sdk - retain_previous_owner: true + properties: + country: country + purchases: + - amount: amount + iso: iso + count: 2 + sku: sku + - amount: amount + iso: iso + count: 2 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 properties: - subscription: - $ref: '#/components/schemas/SubscriptionObject' - retain_previous_owner: - type: boolean + properties: + $ref: '#/components/schemas/PropertiesObject' type: object - UpdateSubscriptionRequestBody: + SubscriptionBody: example: subscription: - notification_types: 7.061401241503109 + notification_types: 7 device_model: device_model app_version: app_version web_p256: web_p256 - net_type: 4.145608029883936 + net_type: 4 type: iOSPush device_os: device_os enabled: true - session_time: 9.301444243932576 - test_type: 2.027123023002322 + session_time: 9 + test_type: 2 token: token carrier: carrier - session_count: 3.616076749251911 + session_count: 3 web_auth: web_auth rooted: true id: id sdk: sdk properties: subscription: - $ref: '#/components/schemas/SubscriptionObject' + $ref: '#/components/schemas/Subscription' type: object TransferSubscriptionRequestBody: example: identity: - key: "" - properties: - identity: - additionalProperties: true - type: object - type: object - UserIdentityRequestBody: - example: - identity: - key: "" + key: identity properties: identity: - additionalProperties: true + additionalProperties: + type: string + maxProperties: 1 + minProperties: 1 type: object type: object - UserIdentityResponse: + UserIdentityBody: example: identity: - key: "" + key: identity properties: identity: - additionalProperties: true + additionalProperties: + type: string type: object type: object ExportEventsSuccessResponse: @@ -3513,7 +3110,7 @@ components: csv_file_url: type: string type: object - get_notification_request_body: + get_notification_history_request_body: properties: events: description: "-> \"sent\" - All the devices by player_id that were sent\ @@ -3532,93 +3129,9 @@ components: type: string required: - id - title: get_notification_request_body - type: object - update_player_tags_request_body: - properties: - tags: - description: "Custom tags for the device record. Only support string key\ - \ value pairs. Does not support arrays or other nested objects. Example\ - \ `{\"foo\":\"bar\",\"this\":\"that\"}`.\nLimitations:\n- 100 tags per\ - \ call\n- Android SDK users: tags cannot be removed or changed via API\ - \ if set through SDK sendTag methods.\nRecommended to only tag devices\ - \ with 1 kilobyte of ata\nPlease consider using your own Database to save\ - \ more than 1 kilobyte of data. See: Internal Database & CRM\n" - type: object - title: update_player_tags_request_body - type: object - inline_response_202: - example: - properties: - country: country - purchases: - - amount: amount - iso: iso - count: 2.3021358869347655 - sku: sku - - amount: amount - iso: iso - count: 2.3021358869347655 - sku: sku - ip: ip - timezone_id: timezone_id - language: language - first_active: 1.4658129805029452 - last_active: 5.962133916683182 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - key: "" - amount_spent: 5.637376656633329 - properties: - properties: - $ref: '#/components/schemas/PropertiesObject' - type: object - inline_response_200: - example: - identity: - key: "" - properties: - identity: - additionalProperties: true - type: object - type: object - inline_response_201: - example: - subscription: - notification_types: 7.061401241503109 - device_model: device_model - app_version: app_version - web_p256: web_p256 - net_type: 4.145608029883936 - type: iOSPush - device_os: device_os - enabled: true - session_time: 9.301444243932576 - test_type: 2.027123023002322 - token: token - carrier: carrier - session_count: 3.616076749251911 - web_auth: web_auth - rooted: true - id: id - sdk: sdk - properties: - subscription: - $ref: '#/components/schemas/SubscriptionObject' - type: object - inline_response_200_3: - example: - in_app_messages: - - "{}" - - "{}" - properties: - in_app_messages: - items: - type: object - type: array + title: get_notification_history_request_body type: object - export_players_request_body: + export_subscriptions_request_body: properties: extra_fields: description: "Additional fields that you wish to include. Currently supports\ @@ -3634,15 +3147,7 @@ components: segment_name: description: Export all devices belonging to the segment. type: string - title: export_players_request_body - type: object - PlayerNotificationTarget_include_aliases: - nullable: true - properties: - alias_label: - items: - type: string - type: array + title: export_subscriptions_request_body type: object BasicNotification_allOf_android_background_layout: description: "Channel: Push Notifications\nPlatform: Android\nAllowing setting\ @@ -3746,14 +3251,6 @@ components: nullable: true type: boolean writeOnly: true - channel_for_external_user_ids: - description: "Indicates if the message type when targeting with include_external_user_ids\ - \ for cases where an email, sms, and/or push subscribers have the same\ - \ external user id.\nExample: Use the string \"push\" to indicate you\ - \ are sending a push notification or the string \"email\"for sending emails\ - \ or \"sms\"for sending SMS.\n" - type: string - writeOnly: true app_id: description: "Required: Your OneSignal Application ID, which can be found\ \ in Keys & IDs.\nIt is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434.\n" @@ -3787,7 +3284,7 @@ components: type: string contents: allOf: - - $ref: '#/components/schemas/StringMap' + - $ref: '#/components/schemas/LanguageStringMap' - description: "Required unless content_available=true or template_id is\ \ set.\nThe message's content (excluding the title), a map of language\ \ codes to text for each language.\nEach hash must have a language code\ @@ -3798,7 +3295,7 @@ components: writeOnly: true headings: allOf: - - $ref: '#/components/schemas/StringMap' + - $ref: '#/components/schemas/LanguageStringMap' - description: "The message's title, a map of language codes to text for\ \ each language. Each hash must have a language code string for a key,\ \ mapped to the localized text you would like users to receive for that\ @@ -3807,7 +3304,7 @@ components: writeOnly: true subtitle: allOf: - - $ref: '#/components/schemas/StringMap' + - $ref: '#/components/schemas/LanguageStringMap' - description: "The message's subtitle, a map of language codes to text\ \ for each language. Each hash must have a language code string for\ \ a key, mapped to the localized text you would like users to receive\ @@ -3944,7 +3441,7 @@ components: text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"\ url\": \"https://yoursite.com\"}]\n" items: - $ref: '#/components/schemas/Button' + $ref: '#/components/schemas/WebButton' nullable: true type: array writeOnly: true @@ -4328,6 +3825,21 @@ components: \ summary_arg\"\n" type: integer writeOnly: true + ios_relevance_score: + description: "Channel: Push Notifications\nPlatform: iOS 15+\nA score to\ + \ be set per notification to indicate how it should be displayed when\ + \ grouped. Use a float between 0-1.\n" + nullable: true + type: number + writeOnly: true + ios_interruption_level: + description: "Channel: Push Notifications\nPlatform: iOS 15+\nFocus Modes\ + \ and Interruption Levels indicate the priority and delivery timing of\ + \ a notification, to \"interrupt\" the user.\nCan choose from options:\ + \ ['active', 'passive', 'time_sensitive', 'critical']. Default is active.\n" + nullable: true + type: string + writeOnly: true email_subject: description: "Channel: Email\nRequired. The subject of the email.\n" nullable: true @@ -4387,7 +3899,7 @@ components: writeOnly: true filters: items: - $ref: '#/components/schemas/Filter' + $ref: '#/components/schemas/FilterExpression' nullable: true type: array custom_data: @@ -4518,13 +4030,6 @@ components: unsubscribe link in this email. nullable: true type: integer - User_subscription_options: - example: - retain_previous_owner: true - properties: - retain_previous_owner: - type: boolean - type: object CreateUserConflictResponse_errorsItems_meta: properties: conflicting_aliases: @@ -4539,18 +4044,11 @@ components: meta: $ref: '#/components/schemas/CreateUserConflictResponse_errorsItems_meta' type: object - GenericError_errors_inner: - properties: - code: - type: string - title: - type: string - type: object securitySchemes: - app_key: + rest_api_key: scheme: bearer type: http - user_key: + user_auth_key: scheme: bearer type: http diff --git a/build.gradle b/build.gradle index e2bcea14..315c05e4 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'org.openapitools' -version = '1.4.0' +version = '5.0.1' buildscript { repositories { diff --git a/build.sbt b/build.sbt index ad68754d..057d3f54 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "org.openapitools", name := "onesignal-java-client", - version := "1.4.0", + version := "5.0.1", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md index 0d3b50a4..9b8f977d 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -9,17 +9,16 @@ |------------ | ------------- | ------------- | -------------| |**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | |**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | |**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | |**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | |**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | | [optional] | |**id** | **String** | | [optional] | |**value** | **Integer** | | [optional] [readonly] | @@ -35,13 +34,12 @@ |**isWPWNS** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | |**isAdm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | |**isChrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -|**channelForExternalUserIds** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | |**appId** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | |**externalId** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | |**idempotencyKey** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -|**contents** | [**StringMap**](StringMap.md) | | [optional] | -|**headings** | [**StringMap**](StringMap.md) | | [optional] | -|**subtitle** | [**StringMap**](StringMap.md) | | [optional] | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | |**data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | |**huaweiMsgType** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | |**url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -58,7 +56,7 @@ |**chromeBigPicture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | |**chromeWebImage** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | |**buttons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -|**webButtons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +|**webButtons** | [**List<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | |**iosCategory** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | |**androidChannelId** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | |**huaweiChannelId** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -104,6 +102,8 @@ |**threadId** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | |**summaryArg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +|**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +|**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | |**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -112,7 +112,7 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -|**filters** | [**List<Filter>**](Filter.md) | | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | |**customData** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | diff --git a/docs/BasicNotificationAllOf.md b/docs/BasicNotificationAllOf.md index 68183e5d..dbb93df5 100644 --- a/docs/BasicNotificationAllOf.md +++ b/docs/BasicNotificationAllOf.md @@ -21,13 +21,12 @@ |**isWPWNS** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | |**isAdm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | |**isChrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -|**channelForExternalUserIds** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | |**appId** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | [optional] | |**externalId** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | |**idempotencyKey** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -|**contents** | [**StringMap**](StringMap.md) | | [optional] | -|**headings** | [**StringMap**](StringMap.md) | | [optional] | -|**subtitle** | [**StringMap**](StringMap.md) | | [optional] | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | |**data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | |**huaweiMsgType** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | |**url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -44,7 +43,7 @@ |**chromeBigPicture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | |**chromeWebImage** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | |**buttons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -|**webButtons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +|**webButtons** | [**List<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | |**iosCategory** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | |**androidChannelId** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | |**huaweiChannelId** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -90,6 +89,8 @@ |**threadId** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | |**summaryArg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +|**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +|**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | |**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -98,7 +99,7 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -|**filters** | [**List<Filter>**](Filter.md) | | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | |**customData** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | diff --git a/docs/CancelNotificationSuccessResponse.md b/docs/CancelNotificationSuccessResponse.md deleted file mode 100644 index b00f424d..00000000 --- a/docs/CancelNotificationSuccessResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CancelNotificationSuccessResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | - - - diff --git a/docs/CreateNotificationSuccessResponse.md b/docs/CreateNotificationSuccessResponse.md index 1d68d6ef..fad90e5b 100644 --- a/docs/CreateNotificationSuccessResponse.md +++ b/docs/CreateNotificationSuccessResponse.md @@ -8,9 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | -|**recipients** | **Integer** | Estimated number of subscribers targetted by notification. | [optional] | |**externalId** | **String** | | [optional] | -|**errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | +|**errors** | **Object** | Errors include the identifiers that are invalid, or that there are no subscribers. | [optional] | diff --git a/docs/CreatePlayerSuccessResponse.md b/docs/CreatePlayerSuccessResponse.md deleted file mode 100644 index 9a43dce3..00000000 --- a/docs/CreatePlayerSuccessResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# CreatePlayerSuccessResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | -|**id** | **String** | | [optional] | - - - diff --git a/docs/CreateSubscriptionRequestBody.md b/docs/CreateSubscriptionRequestBody.md deleted file mode 100644 index 064fbdbe..00000000 --- a/docs/CreateSubscriptionRequestBody.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# CreateSubscriptionRequestBody - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | -|**retainPreviousOwner** | **Boolean** | | [optional] | - - - diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index c180294d..ad21c808 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -4,52 +4,45 @@ All URIs are relative to *https://api.onesignal.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**beginLiveActivity**](DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity | | [**cancelNotification**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification | +| [**createAlias**](DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**createAliasBySubscription**](DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | | [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app | | [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification | -| [**createPlayer**](DefaultApi.md#createPlayer) | **POST** /players | Add a device | -| [**createSegments**](DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments | +| [**createSegment**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment | | [**createSubscription**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | | | [**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | | | [**deleteAlias**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | | -| [**deletePlayer**](DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record | -| [**deleteSegments**](DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments | +| [**deleteSegment**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment | | [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | | | [**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | -| [**endLiveActivity**](DefaultApi.md#endLiveActivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity | | [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events | -| [**exportPlayers**](DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players | -| [**fetchAliases**](DefaultApi.md#fetchAliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | -| [**fetchUser**](DefaultApi.md#fetchUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | -| [**fetchUserIdentity**](DefaultApi.md#fetchUserIdentity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions | +| [**getAliases**](DefaultApi.md#getAliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**getAliasesBySubscription**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | | [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app | | [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps | -| [**getEligibleIams**](DefaultApi.md#getEligibleIams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | | | [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification | | [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History | | [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications | | [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | -| [**getPlayer**](DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device | -| [**getPlayers**](DefaultApi.md#getPlayers) | **GET** /players | View devices | -| [**identifyUserByAlias**](DefaultApi.md#identifyUserByAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | -| [**identifyUserBySubscriptionId**](DefaultApi.md#identifyUserBySubscriptionId) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | +| [**getSegments**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments | +| [**getUser**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | | [**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | | +| [**unsubscribeEmailWithToken**](DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token | | [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app | | [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | -| [**updatePlayer**](DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device | -| [**updatePlayerTags**](DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id | | [**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | | [**updateUser**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | - -# **beginLiveActivity** -> beginLiveActivity(appId, activityId, beginLiveActivityRequest) + +# **cancelNotification** +> GenericSuccessBoolResponse cancelNotification(appId, notificationId) -Start Live Activity +Stop a scheduled or currently outgoing notification -Starts a Live Activity +Used to stop a scheduled or currently outgoing notification ### Example ```java @@ -66,18 +59,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String activityId = "activityId_example"; // String | Live Activity record ID - BeginLiveActivityRequest beginLiveActivityRequest = new BeginLiveActivityRequest(); // BeginLiveActivityRequest | + String appId = "appId_example"; // String | + String notificationId = "notificationId_example"; // String | try { - apiInstance.beginLiveActivity(appId, activityId, beginLiveActivityRequest); + GenericSuccessBoolResponse result = apiInstance.cancelNotification(appId, notificationId); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#beginLiveActivity"); + System.err.println("Exception when calling DefaultApi#cancelNotification"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -91,37 +84,37 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activityId** | **String**| Live Activity record ID | | -| **beginLiveActivityRequest** | [**BeginLiveActivityRequest**](BeginLiveActivityRequest.md)| | | +| **appId** | **String**| | | +| **notificationId** | **String**| | | ### Return type -null (empty response body) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **204** | OK | - | +| **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **cancelNotification** -> CancelNotificationSuccessResponse cancelNotification(appId, notificationId) + +# **createAlias** +> UserIdentityBody createAlias(appId, aliasLabel, aliasId, userIdentityBody) -Stop a scheduled or currently outgoing notification -Used to stop a scheduled or currently outgoing notification + +Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). ### Example ```java @@ -138,18 +131,20 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | - String notificationId = "notificationId_example"; // String | + String aliasLabel = "aliasLabel_example"; // String | + String aliasId = "aliasId_example"; // String | + UserIdentityBody userIdentityBody = new UserIdentityBody(); // UserIdentityBody | try { - CancelNotificationSuccessResponse result = apiInstance.cancelNotification(appId, notificationId); + UserIdentityBody result = apiInstance.createAlias(appId, aliasLabel, aliasId, userIdentityBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#cancelNotification"); + System.err.println("Exception when calling DefaultApi#createAlias"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -164,19 +159,21 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **appId** | **String**| | | -| **notificationId** | **String**| | | +| **aliasLabel** | **String**| | | +| **aliasId** | **String**| | | +| **userIdentityBody** | [**UserIdentityBody**](UserIdentityBody.md)| | | ### Return type -[**CancelNotificationSuccessResponse**](CancelNotificationSuccessResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -184,15 +181,17 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **createApp** -> App createApp(app) + +# **createAliasBySubscription** +> UserIdentityBody createAliasBySubscription(appId, subscriptionId, userIdentityBody) -Create an app -Creates a new OneSignal app + +Upserts one or more Aliases for the User identified by :subscription_id. ### Example ```java @@ -209,17 +208,19 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: user_key - HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); - user_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - App app = new App(); // App | + String appId = "appId_example"; // String | + String subscriptionId = "subscriptionId_example"; // String | + UserIdentityBody userIdentityBody = new UserIdentityBody(); // UserIdentityBody | try { - App result = apiInstance.createApp(app); + UserIdentityBody result = apiInstance.createAliasBySubscription(appId, subscriptionId, userIdentityBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createApp"); + System.err.println("Exception when calling DefaultApi#createAliasBySubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -233,15 +234,17 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **app** | [**App**](App.md)| | | +| **appId** | **String**| | | +| **subscriptionId** | **String**| | | +| **userIdentityBody** | [**UserIdentityBody**](UserIdentityBody.md)| | | ### Return type -[**App**](App.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[user_key](../README.md#user_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -253,15 +256,17 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **createNotification** -> CreateNotificationSuccessResponse createNotification(notification) + +# **createApp** +> App createApp(app) -Create notification +Create an app -Sends notifications to your users +Creates a new OneSignal app ### Example ```java @@ -278,17 +283,17 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: user_auth_key + HttpBearerAuth user_auth_key = (HttpBearerAuth) defaultClient.getAuthentication("user_auth_key"); + user_auth_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - Notification notification = new Notification(); // Notification | + App app = new App(); // App | try { - CreateNotificationSuccessResponse result = apiInstance.createNotification(notification); + App result = apiInstance.createApp(app); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createNotification"); + System.err.println("Exception when calling DefaultApi#createApp"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -302,15 +307,15 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **notification** | [**Notification**](Notification.md)| | | +| **app** | [**App**](App.md)| | | ### Return type -[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md) +[**App**](App.md) ### Authorization -[app_key](../README.md#app_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -320,17 +325,17 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK, invalid_player_ids, invalid_external_user_ids or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_player_ids\" or \"invalid_external_user_ids\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. | - | +| **200** | OK | - | | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **createPlayer** -> CreatePlayerSuccessResponse createPlayer(player) + +# **createNotification** +> CreateNotificationSuccessResponse createNotification(notification) -Add a device +Create notification -Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. +Sends notifications to your users ### Example ```java @@ -347,17 +352,17 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - Player player = new Player(); // Player | + Notification notification = new Notification(); // Notification | try { - CreatePlayerSuccessResponse result = apiInstance.createPlayer(player); + CreateNotificationSuccessResponse result = apiInstance.createNotification(notification); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createPlayer"); + System.err.println("Exception when calling DefaultApi#createNotification"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -371,15 +376,15 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **player** | [**Player**](Player.md)| | | +| **notification** | [**Notification**](Notification.md)| | | ### Return type -[**CreatePlayerSuccessResponse**](CreatePlayerSuccessResponse.md) +[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -389,18 +394,17 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **200** | OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. | - | | **400** | Bad Request | - | -| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **createSegments** -> CreateSegmentSuccessResponse createSegments(appId, segment) + +# **createSegment** +> CreateSegmentSuccessResponse createSegment(appId, segment) -Create Segments +Create Segment -Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. +Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. ### Example ```java @@ -417,18 +421,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. Segment segment = new Segment(); // Segment | try { - CreateSegmentSuccessResponse result = apiInstance.createSegments(appId, segment); + CreateSegmentSuccessResponse result = apiInstance.createSegment(appId, segment); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createSegments"); + System.err.println("Exception when calling DefaultApi#createSegment"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -451,7 +455,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -468,7 +472,7 @@ public class Example { # **createSubscription** -> InlineResponse201 createSubscription(appId, aliasLabel, aliasId, createSubscriptionRequestBody) +> SubscriptionBody createSubscription(appId, aliasLabel, aliasId, subscriptionBody) @@ -489,17 +493,17 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | String aliasLabel = "aliasLabel_example"; // String | String aliasId = "aliasId_example"; // String | - CreateSubscriptionRequestBody createSubscriptionRequestBody = new CreateSubscriptionRequestBody(); // CreateSubscriptionRequestBody | + SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | try { - InlineResponse201 result = apiInstance.createSubscription(appId, aliasLabel, aliasId, createSubscriptionRequestBody); + SubscriptionBody result = apiInstance.createSubscription(appId, aliasLabel, aliasId, subscriptionBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#createSubscription"); @@ -519,15 +523,15 @@ public class Example { | **appId** | **String**| | | | **aliasLabel** | **String**| | | | **aliasId** | **String**| | | -| **createSubscriptionRequestBody** | [**CreateSubscriptionRequestBody**](CreateSubscriptionRequestBody.md)| | | +| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | ### Return type -[**InlineResponse201**](InlineResponse201.md) +[**SubscriptionBody**](SubscriptionBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -540,6 +544,7 @@ public class Example { | **201** | CREATED | - | | **202** | ACCEPTED | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **409** | Operation is not permitted due to user having the maximum number of subscriptions assigned | - | | **429** | Rate Limit Exceeded | - | @@ -566,9 +571,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | @@ -600,7 +605,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -619,7 +624,7 @@ public class Example { # **deleteAlias** -> InlineResponse200 deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete) +> UserIdentityBody deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete) @@ -640,9 +645,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | @@ -650,7 +655,7 @@ public class Example { String aliasId = "aliasId_example"; // String | String aliasLabelToDelete = "aliasLabelToDelete_example"; // String | try { - InlineResponse200 result = apiInstance.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete); + UserIdentityBody result = apiInstance.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#deleteAlias"); @@ -674,83 +679,11 @@ public class Example { ### Return type -[**InlineResponse200**](InlineResponse200.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **409** | Conflict | - | -| **429** | Rate Limit Exceeded | - | - - -# **deletePlayer** -> DeletePlayerSuccessResponse deletePlayer(appId, playerId) - -Delete a user record - -Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String playerId = "playerId_example"; // String | The OneSignal player_id - try { - DeletePlayerSuccessResponse result = apiInstance.deletePlayer(appId, playerId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deletePlayer"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **playerId** | **String**| The OneSignal player_id | | - -### Return type - -[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -763,15 +696,16 @@ public class Example { | **200** | OK | - | | **400** | Bad Request | - | | **404** | Not Found | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **deleteSegments** -> DeleteSegmentSuccessResponse deleteSegments(appId, segmentId) + +# **deleteSegment** +> GenericSuccessBoolResponse deleteSegment(appId, segmentId) -Delete Segments +Delete Segment -Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. +Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. ### Example ```java @@ -788,18 +722,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. String segmentId = "segmentId_example"; // String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. try { - DeleteSegmentSuccessResponse result = apiInstance.deleteSegments(appId, segmentId); + GenericSuccessBoolResponse result = apiInstance.deleteSegment(appId, segmentId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deleteSegments"); + System.err.println("Exception when calling DefaultApi#deleteSegment"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -818,11 +752,11 @@ public class Example { ### Return type -[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -860,9 +794,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | @@ -893,7 +827,7 @@ null (empty response body) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -905,6 +839,7 @@ null (empty response body) |-------------|-------------|------------------| | **202** | ACCEPTED | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | @@ -931,9 +866,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | @@ -966,7 +901,7 @@ null (empty response body) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -981,13 +916,13 @@ null (empty response body) | **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **endLiveActivity** -> endLiveActivity(appId, activityId, subscriptionId) + +# **exportEvents** +> ExportEventsSuccessResponse exportEvents(notificationId, appId) -Stop Live Activity +Export CSV of Events -Stops a Live Activity +Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. ### Example ```java @@ -1004,18 +939,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String activityId = "activityId_example"; // String | Live Activity record ID - String subscriptionId = "subscriptionId_example"; // String | Subscription ID + String notificationId = "notificationId_example"; // String | The ID of the notification to export events from. + String appId = "appId_example"; // String | The ID of the app that the notification belongs to. try { - apiInstance.endLiveActivity(appId, activityId, subscriptionId); + ExportEventsSuccessResponse result = apiInstance.exportEvents(notificationId, appId); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#endLiveActivity"); + System.err.println("Exception when calling DefaultApi#exportEvents"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1029,17 +964,16 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activityId** | **String**| Live Activity record ID | | -| **subscriptionId** | **String**| Subscription ID | | +| **notificationId** | **String**| The ID of the notification to export events from. | | +| **appId** | **String**| The ID of the app that the notification belongs to. | | ### Return type -null (empty response body) +[**ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1049,17 +983,18 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **204** | OK | - | +| **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **exportEvents** -> ExportEventsSuccessResponse exportEvents(notificationId, appId) + +# **exportSubscriptions** +> ExportSubscriptionsSuccessResponse exportSubscriptions(appId, exportSubscriptionsRequestBody) -Export CSV of Events +Export CSV of Subscriptions -Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. +Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | ### Example ```java @@ -1076,18 +1011,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String notificationId = "notificationId_example"; // String | The ID of the notification to export events from. - String appId = "appId_example"; // String | The ID of the app that the notification belongs to. + String appId = "appId_example"; // String | The app ID that you want to export devices from + ExportSubscriptionsRequestBody exportSubscriptionsRequestBody = new ExportSubscriptionsRequestBody(); // ExportSubscriptionsRequestBody | try { - ExportEventsSuccessResponse result = apiInstance.exportEvents(notificationId, appId); + ExportSubscriptionsSuccessResponse result = apiInstance.exportSubscriptions(appId, exportSubscriptionsRequestBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#exportEvents"); + System.err.println("Exception when calling DefaultApi#exportSubscriptions"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1101,20 +1036,20 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **notificationId** | **String**| The ID of the notification to export events from. | | -| **appId** | **String**| The ID of the app that the notification belongs to. | | +| **appId** | **String**| The app ID that you want to export devices from | | +| **exportSubscriptionsRequestBody** | [**ExportSubscriptionsRequestBody**](ExportSubscriptionsRequestBody.md)| | [optional] | ### Return type -[**ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md) +[**ExportSubscriptionsSuccessResponse**](ExportSubscriptionsSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1122,16 +1057,15 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **exportPlayers** -> ExportPlayersSuccessResponse exportPlayers(appId, exportPlayersRequestBody) + +# **getAliases** +> UserIdentityBody getAliases(appId, aliasLabel, aliasId) -Export CSV of Players -Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + +Lists all Aliases for the User identified by (:alias_label, :alias_id). ### Example ```java @@ -1148,18 +1082,19 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The app ID that you want to export devices from - ExportPlayersRequestBody exportPlayersRequestBody = new ExportPlayersRequestBody(); // ExportPlayersRequestBody | + String appId = "appId_example"; // String | + String aliasLabel = "aliasLabel_example"; // String | + String aliasId = "aliasId_example"; // String | try { - ExportPlayersSuccessResponse result = apiInstance.exportPlayers(appId, exportPlayersRequestBody); + UserIdentityBody result = apiInstance.getAliases(appId, aliasLabel, aliasId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#exportPlayers"); + System.err.println("Exception when calling DefaultApi#getAliases"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1173,20 +1108,21 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The app ID that you want to export devices from | | -| **exportPlayersRequestBody** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md)| | [optional] | +| **appId** | **String**| | | +| **aliasLabel** | **String**| | | +| **aliasId** | **String**| | | ### Return type -[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -1194,11 +1130,12 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **fetchAliases** -> UserIdentityResponse fetchAliases(appId, subscriptionId) + +# **getAliasesBySubscription** +> UserIdentityBody getAliasesBySubscription(appId, subscriptionId) @@ -1219,18 +1156,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | String subscriptionId = "subscriptionId_example"; // String | try { - UserIdentityResponse result = apiInstance.fetchAliases(appId, subscriptionId); + UserIdentityBody result = apiInstance.getAliasesBySubscription(appId, subscriptionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#fetchAliases"); + System.err.println("Exception when calling DefaultApi#getAliasesBySubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1249,11 +1186,11 @@ public class Example { ### Return type -[**UserIdentityResponse**](UserIdentityResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1265,14 +1202,15 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | - -# **fetchUser** -> User fetchUser(appId, aliasLabel, aliasId) - + +# **getApp** +> App getApp(appId) +View an app -Returns the User’s properties, Aliases, and Subscriptions. +View the details of a single OneSignal app ### Example ```java @@ -1289,19 +1227,17 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: user_auth_key + HttpBearerAuth user_auth_key = (HttpBearerAuth) defaultClient.getAuthentication("user_auth_key"); + user_auth_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String aliasLabel = "aliasLabel_example"; // String | - String aliasId = "aliasId_example"; // String | + String appId = "appId_example"; // String | An app id try { - User result = apiInstance.fetchUser(appId, aliasLabel, aliasId); + App result = apiInstance.getApp(appId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#fetchUser"); + System.err.println("Exception when calling DefaultApi#getApp"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1315,17 +1251,15 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **aliasLabel** | **String**| | | -| **aliasId** | **String**| | | +| **appId** | **String**| An app id | | ### Return type -[**User**](User.md) +[**App**](App.md) ### Authorization -[app_key](../README.md#app_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -1339,13 +1273,13 @@ public class Example { | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **fetchUserIdentity** -> InlineResponse200 fetchUserIdentity(appId, aliasLabel, aliasId) - + +# **getApps** +> List<App> getApps() +View apps -Lists all Aliases for the User identified by (:alias_label, :alias_id). +View the details of all of your current OneSignal apps ### Example ```java @@ -1362,19 +1296,16 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: user_auth_key + HttpBearerAuth user_auth_key = (HttpBearerAuth) defaultClient.getAuthentication("user_auth_key"); + user_auth_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String aliasLabel = "aliasLabel_example"; // String | - String aliasId = "aliasId_example"; // String | try { - InlineResponse200 result = apiInstance.fetchUserIdentity(appId, aliasLabel, aliasId); + List result = apiInstance.getApps(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#fetchUserIdentity"); + System.err.println("Exception when calling DefaultApi#getApps"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1385,20 +1316,15 @@ public class Example { ``` ### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **aliasLabel** | **String**| | | -| **aliasId** | **String**| | | +This endpoint does not need any parameter. ### Return type -[**InlineResponse200**](InlineResponse200.md) +[**List<App>**](App.md) ### Authorization -[app_key](../README.md#app_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -1412,13 +1338,13 @@ public class Example { | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **getApp** -> App getApp(appId) + +# **getNotification** +> NotificationWithMeta getNotification(appId, notificationId) -View an app +View notification -View the details of a single OneSignal app +View the details of a single notification and outcomes associated with it ### Example ```java @@ -1435,220 +1361,15 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: user_key - HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); - user_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | An app id + String appId = "appId_example"; // String | + String notificationId = "notificationId_example"; // String | try { - App result = apiInstance.getApp(appId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getApp"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **appId** | **String**| An app id | | - -### Return type - -[**App**](App.md) - -### Authorization - -[user_key](../README.md#user_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - - -# **getApps** -> List<App> getApps() - -View apps - -View the details of all of your current OneSignal apps - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: user_key - HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); - user_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - try { - List result = apiInstance.getApps(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getApps"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<App>**](App.md) - -### Authorization - -[user_key](../README.md#user_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - - -# **getEligibleIams** -> InlineResponse2003 getEligibleIams(appId, subscriptionId) - - - -Manifest of In-App Messages the Subscription is eligible to display by the SDK. - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String subscriptionId = "subscriptionId_example"; // String | - try { - InlineResponse2003 result = apiInstance.getEligibleIams(appId, subscriptionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getEligibleIams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **subscriptionId** | **String**| | | - -### Return type - -[**InlineResponse2003**](InlineResponse2003.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - - -# **getNotification** -> NotificationWithMeta getNotification(appId, notificationId) - -View notification - -View the details of a single notification and outcomes associated with it - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String notificationId = "notificationId_example"; // String | - try { - NotificationWithMeta result = apiInstance.getNotification(appId, notificationId); + NotificationWithMeta result = apiInstance.getNotification(appId, notificationId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#getNotification"); @@ -1674,7 +1395,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1686,11 +1407,12 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | # **getNotificationHistory** -> NotificationHistorySuccessResponse getNotificationHistory(notificationId, getNotificationRequestBody) +> NotificationHistorySuccessResponse getNotificationHistory(notificationId, getNotificationHistoryRequestBody) Notification History @@ -1711,15 +1433,15 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String notificationId = "notificationId_example"; // String | The \"id\" of the message found in the Notification object - GetNotificationRequestBody getNotificationRequestBody = new GetNotificationRequestBody(); // GetNotificationRequestBody | + GetNotificationHistoryRequestBody getNotificationHistoryRequestBody = new GetNotificationHistoryRequestBody(); // GetNotificationHistoryRequestBody | try { - NotificationHistorySuccessResponse result = apiInstance.getNotificationHistory(notificationId, getNotificationRequestBody); + NotificationHistorySuccessResponse result = apiInstance.getNotificationHistory(notificationId, getNotificationHistoryRequestBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#getNotificationHistory"); @@ -1737,7 +1459,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **notificationId** | **String**| The \"id\" of the message found in the Notification object | | -| **getNotificationRequestBody** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md)| | | +| **getNotificationHistoryRequestBody** | [**GetNotificationHistoryRequestBody**](GetNotificationHistoryRequestBody.md)| | | ### Return type @@ -1745,7 +1467,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1757,6 +1479,7 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | @@ -1782,9 +1505,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | The app ID that you want to view notifications from @@ -1820,7 +1543,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1857,9 +1580,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. @@ -1899,7 +1622,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1913,13 +1636,13 @@ public class Example { | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **getPlayer** -> Player getPlayer(appId, playerId, emailAuthHash) + +# **getSegments** +> GetSegmentsSuccessResponse getSegments(appId, offset, limit) -View device +Get Segments -View the details of an existing device in one of your OneSignal apps +Returns an array of segments from an app. ### Example ```java @@ -1936,92 +1659,19 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | Your app_id for this device - String playerId = "playerId_example"; // String | Player's OneSignal ID - String emailAuthHash = "emailAuthHash_example"; // String | Email - Only required if you have enabled Identity Verification and device_type is email (11). - try { - Player result = apiInstance.getPlayer(appId, playerId, emailAuthHash); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getPlayer"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **appId** | **String**| Your app_id for this device | | -| **playerId** | **String**| Player's OneSignal ID | | -| **emailAuthHash** | **String**| Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | - -### Return type - -[**Player**](Player.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - - -# **getPlayers** -> PlayerSlice getPlayers(appId, limit, offset) - -View devices - -View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The app ID that you want to view players from - Integer limit = 56; // Integer | How many devices to return. Max is 300. Default is 300 - Integer offset = 56; // Integer | Result offset. Default is 0. Results are sorted by id; + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + Integer offset = 56; // Integer | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. + Integer limit = 56; // Integer | The amount of Segments in the response. Maximum 300. try { - PlayerSlice result = apiInstance.getPlayers(appId, limit, offset); + GetSegmentsSuccessResponse result = apiInstance.getSegments(appId, offset, limit); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getPlayers"); + System.err.println("Exception when calling DefaultApi#getSegments"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2035,17 +1685,17 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The app ID that you want to view players from | | -| **limit** | **Integer**| How many devices to return. Max is 300. Default is 300 | [optional] | -| **offset** | **Integer**| Result offset. Default is 0. Results are sorted by id; | [optional] | +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **offset** | **Integer**| Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. | [optional] | +| **limit** | **Integer**| The amount of Segments in the response. Maximum 300. | [optional] | ### Return type -[**PlayerSlice**](PlayerSlice.md) +[**GetSegmentsSuccessResponse**](GetSegmentsSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2055,17 +1705,17 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **201** | OK | - | | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **identifyUserByAlias** -> InlineResponse200 identifyUserByAlias(appId, aliasLabel, aliasId, userIdentityRequestBody) + +# **getUser** +> User getUser(appId, aliasLabel, aliasId) -Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). +Returns the User’s properties, Aliases, and Subscriptions. ### Example ```java @@ -2082,20 +1732,19 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | String aliasLabel = "aliasLabel_example"; // String | String aliasId = "aliasId_example"; // String | - UserIdentityRequestBody userIdentityRequestBody = new UserIdentityRequestBody(); // UserIdentityRequestBody | try { - InlineResponse200 result = apiInstance.identifyUserByAlias(appId, aliasLabel, aliasId, userIdentityRequestBody); + User result = apiInstance.getUser(appId, aliasLabel, aliasId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#identifyUserByAlias"); + System.err.println("Exception when calling DefaultApi#getUser"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2112,19 +1761,18 @@ public class Example { | **appId** | **String**| | | | **aliasLabel** | **String**| | | | **aliasId** | **String**| | | -| **userIdentityRequestBody** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md)| | | ### Return type -[**InlineResponse200**](InlineResponse200.md) +[**User**](User.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -2132,16 +1780,16 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **409** | Conflict | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **identifyUserBySubscriptionId** -> UserIdentityResponse identifyUserBySubscriptionId(appId, subscriptionId, userIdentityRequestBody) + +# **transferSubscription** +> UserIdentityBody transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody) -Upserts one or more Aliases for the User identified by :subscription_id. +Transfers this Subscription to the User identified by the identity in the payload. ### Example ```java @@ -2158,19 +1806,19 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | String subscriptionId = "subscriptionId_example"; // String | - UserIdentityRequestBody userIdentityRequestBody = new UserIdentityRequestBody(); // UserIdentityRequestBody | + TransferSubscriptionRequestBody transferSubscriptionRequestBody = new TransferSubscriptionRequestBody(); // TransferSubscriptionRequestBody | try { - UserIdentityResponse result = apiInstance.identifyUserBySubscriptionId(appId, subscriptionId, userIdentityRequestBody); + UserIdentityBody result = apiInstance.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#identifyUserBySubscriptionId"); + System.err.println("Exception when calling DefaultApi#transferSubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2186,15 +1834,15 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **appId** | **String**| | | | **subscriptionId** | **String**| | | -| **userIdentityRequestBody** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md)| | | +| **transferSubscriptionRequestBody** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md)| | | ### Return type -[**UserIdentityResponse**](UserIdentityResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2206,16 +1854,17 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **transferSubscription** -> UserIdentityResponse transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody) - + +# **unsubscribeEmailWithToken** +> GenericSuccessBoolResponse unsubscribeEmailWithToken(appId, notificationId, token) +Unsubscribe with token -Transfers this Subscription to the User identified by the identity in the payload. +Unsubscribe an email with a token when using your own custom email unsubscribe landing page ### Example ```java @@ -2232,19 +1881,19 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String subscriptionId = "subscriptionId_example"; // String | - TransferSubscriptionRequestBody transferSubscriptionRequestBody = new TransferSubscriptionRequestBody(); // TransferSubscriptionRequestBody | + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + String notificationId = "notificationId_example"; // String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. + String token = "token_example"; // String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. try { - UserIdentityResponse result = apiInstance.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody); + GenericSuccessBoolResponse result = apiInstance.unsubscribeEmailWithToken(appId, notificationId, token); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#transferSubscription"); + System.err.println("Exception when calling DefaultApi#unsubscribeEmailWithToken"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2258,29 +1907,28 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **subscriptionId** | **String**| | | -| **transferSubscriptionRequestBody** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md)| | | +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **notificationId** | **String**| The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | | +| **token** | **String**| The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | | ### Return type -[**UserIdentityResponse**](UserIdentityResponse.md) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **202** | OK | - | | **400** | Bad Request | - | -| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | @@ -2306,9 +1954,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: user_key - HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); - user_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: user_auth_key + HttpBearerAuth user_auth_key = (HttpBearerAuth) defaultClient.getAuthentication("user_auth_key"); + user_auth_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | An app id @@ -2340,7 +1988,7 @@ public class Example { ### Authorization -[user_key](../README.md#user_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -2377,9 +2025,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. @@ -2413,152 +2061,7 @@ public class Example { ### Authorization -[app_key](../README.md#app_key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - - -# **updatePlayer** -> UpdatePlayerSuccessResponse updatePlayer(playerId, player) - -Edit device - -Update an existing device in one of your OneSignal apps - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - String playerId = "playerId_example"; // String | Player's OneSignal ID - Player player = new Player(); // Player | - try { - UpdatePlayerSuccessResponse result = apiInstance.updatePlayer(playerId, player); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#updatePlayer"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **playerId** | **String**| Player's OneSignal ID | | -| **player** | [**Player**](Player.md)| | | - -### Return type - -[**UpdatePlayerSuccessResponse**](UpdatePlayerSuccessResponse.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **400** | Bad Request | - | -| **409** | Conflict | - | -| **429** | Rate Limit Exceeded | - | - - -# **updatePlayerTags** -> UpdatePlayerTagsSuccessResponse updatePlayerTags(appId, externalUserId, updatePlayerTagsRequestBody) - -Edit tags with external user id - -Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - -### Example -```java -// Import classes: -import com.onesignal.client.ApiClient; -import com.onesignal.client.ApiException; -import com.onesignal.client.Configuration; -import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; -import com.onesignal.client.api.DefaultApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.onesignal.com"); - - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID the user record is found under. - String 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 updatePlayerTagsRequestBody = new UpdatePlayerTagsRequestBody(); // UpdatePlayerTagsRequestBody | - try { - UpdatePlayerTagsSuccessResponse result = apiInstance.updatePlayerTags(appId, externalUserId, updatePlayerTagsRequestBody); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#updatePlayerTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **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. | | -| **updatePlayerTagsRequestBody** | [**UpdatePlayerTagsRequestBody**](UpdatePlayerTagsRequestBody.md)| | [optional] | - -### Return type - -[**UpdatePlayerTagsSuccessResponse**](UpdatePlayerTagsSuccessResponse.md) - -### Authorization - -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2570,12 +2073,11 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | # **updateSubscription** -> updateSubscription(appId, subscriptionId, updateSubscriptionRequestBody) +> updateSubscription(appId, subscriptionId, subscriptionBody) @@ -2596,16 +2098,16 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | String subscriptionId = "subscriptionId_example"; // String | - UpdateSubscriptionRequestBody updateSubscriptionRequestBody = new UpdateSubscriptionRequestBody(); // UpdateSubscriptionRequestBody | + SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | try { - apiInstance.updateSubscription(appId, subscriptionId, updateSubscriptionRequestBody); + apiInstance.updateSubscription(appId, subscriptionId, subscriptionBody); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#updateSubscription"); System.err.println("Status code: " + e.getCode()); @@ -2623,7 +2125,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **appId** | **String**| | | | **subscriptionId** | **String**| | | -| **updateSubscriptionRequestBody** | [**UpdateSubscriptionRequestBody**](UpdateSubscriptionRequestBody.md)| | | +| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | ### Return type @@ -2631,7 +2133,7 @@ null (empty response body) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2641,14 +2143,15 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **202** | ACCEPTED | - | +| **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | # **updateUser** -> InlineResponse202 updateUser(appId, aliasLabel, aliasId, updateUserRequest) +> PropertiesBody updateUser(appId, aliasLabel, aliasId, updateUserRequest) @@ -2669,9 +2172,9 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: app_key - HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); - app_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | @@ -2679,7 +2182,7 @@ public class Example { String aliasId = "aliasId_example"; // String | UpdateUserRequest updateUserRequest = new UpdateUserRequest(); // UpdateUserRequest | try { - InlineResponse202 result = apiInstance.updateUser(appId, aliasLabel, aliasId, updateUserRequest); + PropertiesBody result = apiInstance.updateUser(appId, aliasLabel, aliasId, updateUserRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#updateUser"); @@ -2703,11 +2206,11 @@ public class Example { ### Return type -[**InlineResponse202**](InlineResponse202.md) +[**PropertiesBody**](PropertiesBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers diff --git a/docs/DeletePlayerNotFoundResponse.md b/docs/DeletePlayerNotFoundResponse.md deleted file mode 100644 index 2b2a865e..00000000 --- a/docs/DeletePlayerNotFoundResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# DeletePlayerNotFoundResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | - - - diff --git a/docs/DeleteSegmentSuccessResponse.md b/docs/DeleteSegmentSuccessResponse.md deleted file mode 100644 index 8a82bd30..00000000 --- a/docs/DeleteSegmentSuccessResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# DeleteSegmentSuccessResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | - - - diff --git a/docs/ExportPlayersRequestBody.md b/docs/ExportSubscriptionsRequestBody.md similarity index 94% rename from docs/ExportPlayersRequestBody.md rename to docs/ExportSubscriptionsRequestBody.md index 5082a4f5..08fb5b95 100644 --- a/docs/ExportPlayersRequestBody.md +++ b/docs/ExportSubscriptionsRequestBody.md @@ -1,6 +1,6 @@ -# ExportPlayersRequestBody +# ExportSubscriptionsRequestBody ## Properties diff --git a/docs/ExportPlayersSuccessResponse.md b/docs/ExportSubscriptionsSuccessResponse.md similarity index 82% rename from docs/ExportPlayersSuccessResponse.md rename to docs/ExportSubscriptionsSuccessResponse.md index 25e23c3f..451ef790 100644 --- a/docs/ExportPlayersSuccessResponse.md +++ b/docs/ExportSubscriptionsSuccessResponse.md @@ -1,6 +1,6 @@ -# ExportPlayersSuccessResponse +# ExportSubscriptionsSuccessResponse ## Properties diff --git a/docs/Filter.md b/docs/Filter.md index 341396bc..c5abaf97 100644 --- a/docs/Filter.md +++ b/docs/Filter.md @@ -7,10 +7,14 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**field** | **String** | Name of the field to use as the first operand in the filter expression. | | +|**field** | **String** | Required. Name of the field to use as the first operand in the filter expression. | [optional] | |**key** | **String** | If `field` is `tag`, this field is *required* to specify `key` inside the tags. | [optional] | |**value** | **String** | Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. | [optional] | -|**relation** | [**RelationEnum**](#RelationEnum) | Operator of a filter expression. | | +|**hoursAgo** | **String** | If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. | [optional] | +|**radius** | **BigDecimal** | If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. | [optional] | +|**lat** | **BigDecimal** | If `field` is `location`, this is *required* to specify the user's latitude. | [optional] | +|**_long** | **BigDecimal** | If `field` is `location`, this is *required* to specify the user's longitude. | [optional] | +|**relation** | [**RelationEnum**](#RelationEnum) | Required. Operator of a filter expression. | [optional] | diff --git a/docs/FilterExpressions.md b/docs/FilterExpression.md similarity index 55% rename from docs/FilterExpressions.md rename to docs/FilterExpression.md index 4bf08d4f..1269779c 100644 --- a/docs/FilterExpressions.md +++ b/docs/FilterExpression.md @@ -1,16 +1,20 @@ -# FilterExpressions +# FilterExpression ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**field** | **String** | Name of the field to use as the first operand in the filter expression. | | +|**field** | **String** | Required. Name of the field to use as the first operand in the filter expression. | [optional] | |**key** | **String** | If `field` is `tag`, this field is *required* to specify `key` inside the tags. | [optional] | |**value** | **String** | Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. | [optional] | -|**relation** | [**RelationEnum**](#RelationEnum) | Operator of a filter expression. | | +|**hoursAgo** | **String** | If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. | [optional] | +|**radius** | **BigDecimal** | If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. | [optional] | +|**lat** | **BigDecimal** | If `field` is `location`, this is *required* to specify the user's latitude. | [optional] | +|**_long** | **BigDecimal** | If `field` is `location`, this is *required* to specify the user's longitude. | [optional] | +|**relation** | [**RelationEnum**](#RelationEnum) | Required. Operator of a filter expression. | [optional] | |**operator** | [**OperatorEnum**](#OperatorEnum) | Strictly, this must be either `\"OR\"`, or `\"AND\"`. It can be used to compose Filters as part of a Filters object. | [optional] | diff --git a/docs/GenericError.md b/docs/GenericError.md index aa09c1d8..4bcf74c4 100644 --- a/docs/GenericError.md +++ b/docs/GenericError.md @@ -7,7 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**errors** | [**List<GenericErrorErrorsInner>**](GenericErrorErrorsInner.md) | | [optional] | +|**errors** | **Object** | | [optional] | +|**success** | **Boolean** | | [optional] | +|**reference** | **Object** | | [optional] | diff --git a/docs/DeletePlayerSuccessResponse.md b/docs/GenericSuccessBoolResponse.md similarity index 84% rename from docs/DeletePlayerSuccessResponse.md rename to docs/GenericSuccessBoolResponse.md index 3b4c9764..d221551e 100644 --- a/docs/DeletePlayerSuccessResponse.md +++ b/docs/GenericSuccessBoolResponse.md @@ -1,6 +1,6 @@ -# DeletePlayerSuccessResponse +# GenericSuccessBoolResponse ## Properties diff --git a/docs/GetNotificationRequestBody.md b/docs/GetNotificationHistoryRequestBody.md similarity index 95% rename from docs/GetNotificationRequestBody.md rename to docs/GetNotificationHistoryRequestBody.md index bfbf4edc..3523d360 100644 --- a/docs/GetNotificationRequestBody.md +++ b/docs/GetNotificationHistoryRequestBody.md @@ -1,6 +1,6 @@ -# GetNotificationRequestBody +# GetNotificationHistoryRequestBody ## Properties diff --git a/docs/GetSegmentsSuccessResponse.md b/docs/GetSegmentsSuccessResponse.md new file mode 100644 index 00000000..c4d8ea9f --- /dev/null +++ b/docs/GetSegmentsSuccessResponse.md @@ -0,0 +1,16 @@ + + +# GetSegmentsSuccessResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totalCount** | **Integer** | The number of Segments in the response. | [optional] | +|**offset** | **Integer** | Set with the offset query parameter. Default 0. | [optional] | +|**limit** | **Integer** | Maximum number of Segments returned. Default 300. | [optional] | +|**segments** | [**List<SegmentData>**](SegmentData.md) | An array containing the Segment information. | [optional] | + + + diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md deleted file mode 100644 index d81a7813..00000000 --- a/docs/InlineResponse2003.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# InlineResponse2003 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**inAppMessages** | **List<Object>** | | [optional] | - - - diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md deleted file mode 100644 index eb24ce84..00000000 --- a/docs/InlineResponse201.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# InlineResponse201 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | - - - diff --git a/docs/InvalidIdentifierError.md b/docs/InvalidIdentifierError.md deleted file mode 100644 index 1b976e44..00000000 --- a/docs/InvalidIdentifierError.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# InvalidIdentifierError - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**invalidExternalUserIds** | **List<String>** | Returned if using include_external_user_ids | [optional] | -|**invalidPlayerIds** | **List<String>** | Returned if using include_player_ids and some were valid and others were not. | [optional] | - - - diff --git a/docs/StringMap.md b/docs/LanguageStringMap.md similarity index 99% rename from docs/StringMap.md rename to docs/LanguageStringMap.md index 5a474161..94e01c97 100644 --- a/docs/StringMap.md +++ b/docs/LanguageStringMap.md @@ -1,6 +1,6 @@ -# StringMap +# LanguageStringMap ## Properties diff --git a/docs/Notification.md b/docs/Notification.md index 936df4d2..df5e22a5 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -9,17 +9,16 @@ |------------ | ------------- | ------------- | -------------| |**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | |**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | |**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | |**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | |**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | | [optional] | |**id** | **String** | | [optional] | |**value** | **Integer** | | [optional] [readonly] | @@ -35,13 +34,12 @@ |**isWPWNS** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | |**isAdm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | |**isChrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -|**channelForExternalUserIds** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | |**appId** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | |**externalId** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | |**idempotencyKey** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -|**contents** | [**StringMap**](StringMap.md) | | [optional] | -|**headings** | [**StringMap**](StringMap.md) | | [optional] | -|**subtitle** | [**StringMap**](StringMap.md) | | [optional] | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | |**data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | |**huaweiMsgType** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | |**url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -58,7 +56,7 @@ |**chromeBigPicture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | |**chromeWebImage** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | |**buttons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -|**webButtons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +|**webButtons** | [**List<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | |**iosCategory** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | |**androidChannelId** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | |**huaweiChannelId** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -104,6 +102,8 @@ |**threadId** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | |**summaryArg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +|**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +|**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | |**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -112,7 +112,7 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -|**filters** | [**List<Filter>**](Filter.md) | | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | |**customData** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | |**sendAfter** | **OffsetDateTime** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | diff --git a/docs/Notification200Errors.md b/docs/Notification200Errors.md deleted file mode 100644 index 21dff4b6..00000000 --- a/docs/Notification200Errors.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Notification200Errors - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**invalidExternalUserIds** | **List<String>** | Returned if using include_external_user_ids | [optional] | -|**invalidPlayerIds** | **List<String>** | Returned if using include_player_ids and some were valid and others were not. | [optional] | - - - diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md index c27de391..77846de8 100644 --- a/docs/NotificationTarget.md +++ b/docs/NotificationTarget.md @@ -9,17 +9,16 @@ |------------ | ------------- | ------------- | -------------| |**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | |**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | |**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | |**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | |**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | | [optional] | diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index b7fb2fb4..bd6bf264 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -9,17 +9,16 @@ |------------ | ------------- | ------------- | -------------| |**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | |**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | |**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | |**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | |**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | | [optional] | |**id** | **String** | | [optional] | |**value** | **Integer** | | [optional] [readonly] | @@ -35,13 +34,12 @@ |**isWPWNS** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | |**isAdm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | |**isChrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -|**channelForExternalUserIds** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | |**appId** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | |**externalId** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | |**idempotencyKey** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -|**contents** | [**StringMap**](StringMap.md) | | [optional] | -|**headings** | [**StringMap**](StringMap.md) | | [optional] | -|**subtitle** | [**StringMap**](StringMap.md) | | [optional] | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | |**data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | |**huaweiMsgType** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | |**url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -58,7 +56,7 @@ |**chromeBigPicture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | |**chromeWebImage** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | |**buttons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -|**webButtons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +|**webButtons** | [**List<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | |**iosCategory** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | |**androidChannelId** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | |**huaweiChannelId** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -104,6 +102,8 @@ |**threadId** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | |**summaryArg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +|**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +|**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | |**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -112,7 +112,7 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -|**filters** | [**List<Filter>**](Filter.md) | | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | |**customData** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | |**successful** | **Integer** | Number of notifications that were successfully delivered. | [optional] | |**failed** | **Integer** | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional] | diff --git a/docs/Player.md b/docs/Player.md deleted file mode 100644 index 33d7baa6..00000000 --- a/docs/Player.md +++ /dev/null @@ -1,39 +0,0 @@ - - -# Player - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | The device's OneSignal ID | [optional] [readonly] | -|**invalidIdentifier** | **Boolean** | If true, this is the equivalent of a user being Unsubscribed | [optional] [readonly] | -|**appId** | **String** | | [optional] | -|**deviceType** | **Integer** | Required The device's platform: 0 = iOS 1 = Android 2 = Amazon 3 = WindowsPhone (MPNS) 4 = Chrome Apps / Extensions 5 = Chrome Web Push 6 = Windows (WNS) 7 = Safari 8 = Firefox 9 = MacOS 10 = Alexa 11 = Email 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM 14 = SMS | | -|**externalUserId** | **String** | a custom user ID | [optional] | -|**externalUserIdAuthHash** | **String** | Only required if you have enabled Identity Verification and device_type is NOT 11 email. | [optional] | -|**emailAuthHash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | -|**identifier** | **String** | Recommended: For Push Notifications, this is the Push Token Identifier from Google or Apple. For Apple Push identifiers, you must strip all non alphanumeric characters. Examples: iOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0 Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV... For Email Addresses, set the full email address email@email.com and make sure to set device_type to 11. | [optional] | -|**language** | **String** | Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: en | [optional] | -|**timezone** | **Integer** | Number of seconds away from UTC. Example: -28800 | [optional] | -|**gameVersion** | **String** | Version of your app. Example: 1.1 | [optional] | -|**deviceModel** | **String** | Device make and model. Example: iPhone5,1 | [optional] | -|**deviceOs** | **String** | Device operating system version. Example: 7.0.4 | [optional] | -|**adId** | **String** | The ad id for the device's platform: Android = Advertising Id iOS = identifierForVendor WP8.0 = DeviceUniqueId WP8.1 = AdvertisingId | [optional] | -|**sdk** | **String** | Name and version of the sdk/plugin that's calling this API method (if any) | [optional] | -|**sessionCount** | **Integer** | Number of times the user has played the game, defaults to 1 | [optional] | -|**tags** | **Object** | Custom tags for the player. Only support string and integer key value pairs. Does not support arrays or other nested objects. Setting a tag value to null or an empty string will remove the tag. Example: {\"foo\":\"bar\",\"this\":\"that\"} Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of data Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | -|**amountSpent** | **BigDecimal** | Amount the user has spent in USD, up to two decimal places | [optional] | -|**createdAt** | **Long** | Unixtime when the player joined the game | [optional] | -|**playtime** | **Long** | Seconds player was running your app. | [optional] | -|**badgeCount** | **Integer** | Current iOS badge count displayed on the app icon NOTE: Not supported for apps created after June 2018, since badge count for apps created after this date are handled on the client. | [optional] | -|**lastActive** | **Integer** | Unixtime when the player was last active | [optional] | -|**notificationTypes** | **Integer** | 1 = subscribed -2 = unsubscribed iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues. | [optional] | -|**testType** | **Integer** | This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. 1 = Development 2 = Ad-Hoc Omit this field for App Store builds. | [optional] | -|**_long** | **BigDecimal** | Longitude of the device, used for geotagging to segment on. | [optional] | -|**lat** | **BigDecimal** | Latitude of the device, used for geotagging to segment on. | [optional] | -|**country** | **String** | Country code in the ISO 3166-1 Alpha 2 format | [optional] | - - - diff --git a/docs/PlayerNotificationTarget.md b/docs/PlayerNotificationTarget.md deleted file mode 100644 index 462f8f70..00000000 --- a/docs/PlayerNotificationTarget.md +++ /dev/null @@ -1,34 +0,0 @@ - - -# PlayerNotificationTarget - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | -|**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | -|**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -|**includeAliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | -|**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | | [optional] | - - - -## Enum: TargetChannelEnum - -| Name | Value | -|---- | -----| -| PUSH | "push" | -| EMAIL | "email" | -| SMS | "sms" | - - - diff --git a/docs/PlayerNotificationTargetIncludeAliases.md b/docs/PlayerNotificationTargetIncludeAliases.md deleted file mode 100644 index 6554de24..00000000 --- a/docs/PlayerNotificationTargetIncludeAliases.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PlayerNotificationTargetIncludeAliases - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**aliasLabel** | **List<String>** | | [optional] | - - - diff --git a/docs/PlayerSlice.md b/docs/PlayerSlice.md deleted file mode 100644 index 030cf7c2..00000000 --- a/docs/PlayerSlice.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# PlayerSlice - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalCount** | **Integer** | | [optional] | -|**offset** | **Integer** | | [optional] | -|**limit** | **Integer** | | [optional] | -|**players** | [**List<Player>**](Player.md) | | [optional] | - - - diff --git a/docs/InlineResponse202.md b/docs/PropertiesBody.md similarity index 91% rename from docs/InlineResponse202.md rename to docs/PropertiesBody.md index c92b8efa..759eb870 100644 --- a/docs/InlineResponse202.md +++ b/docs/PropertiesBody.md @@ -1,6 +1,6 @@ -# InlineResponse202 +# PropertiesBody ## Properties diff --git a/docs/PropertiesDeltas.md b/docs/PropertiesDeltas.md index 685e515e..d1328ad9 100644 --- a/docs/PropertiesDeltas.md +++ b/docs/PropertiesDeltas.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**sessionTime** | **BigDecimal** | | [optional] | -|**sessionCount** | **BigDecimal** | | [optional] | +|**sessionTime** | **Integer** | | [optional] | +|**sessionCount** | **Integer** | | [optional] | |**purchases** | [**List<Purchase>**](Purchase.md) | | [optional] | diff --git a/docs/PropertiesObject.md b/docs/PropertiesObject.md index 330862bd..d5e92a40 100644 --- a/docs/PropertiesObject.md +++ b/docs/PropertiesObject.md @@ -13,8 +13,8 @@ |**lat** | **BigDecimal** | | [optional] | |**_long** | **BigDecimal** | | [optional] | |**country** | **String** | | [optional] | -|**firstActive** | **BigDecimal** | | [optional] | -|**lastActive** | **BigDecimal** | | [optional] | +|**firstActive** | **Integer** | | [optional] | +|**lastActive** | **Integer** | | [optional] | |**amountSpent** | **BigDecimal** | | [optional] | |**purchases** | [**List<Purchase>**](Purchase.md) | | [optional] | |**ip** | **String** | | [optional] | diff --git a/docs/Purchase.md b/docs/Purchase.md index b87e0dc4..c169b0b2 100644 --- a/docs/Purchase.md +++ b/docs/Purchase.md @@ -10,7 +10,7 @@ |**sku** | **String** | The unique identifier of the purchased item. | | |**amount** | **String** | The amount, in USD, spent purchasing the item. | | |**iso** | **String** | The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. | | -|**count** | **BigDecimal** | | [optional] | +|**count** | **Integer** | | [optional] | diff --git a/docs/BeginLiveActivityRequest.md b/docs/RateLimitError.md similarity index 51% rename from docs/BeginLiveActivityRequest.md rename to docs/RateLimitError.md index af0f8eef..12d68667 100644 --- a/docs/BeginLiveActivityRequest.md +++ b/docs/RateLimitError.md @@ -1,14 +1,14 @@ -# BeginLiveActivityRequest +# RateLimitError ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**pushToken** | **String** | | | -|**subscriptionId** | **String** | | | +|**errors** | **List<String>** | | [optional] | +|**limit** | **String** | | [optional] | diff --git a/docs/Segment.md b/docs/Segment.md index 71d5e7dc..480ebe0a 100644 --- a/docs/Segment.md +++ b/docs/Segment.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | UUID of the segment. If left empty, it will be assigned automaticaly. | [optional] | |**name** | **String** | Name of the segment. You'll see this name on the Web UI. | | -|**filters** | [**List<FilterExpressions>**](FilterExpressions.md) | Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. | | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. | | diff --git a/docs/SegmentData.md b/docs/SegmentData.md new file mode 100644 index 00000000..340e7b84 --- /dev/null +++ b/docs/SegmentData.md @@ -0,0 +1,19 @@ + + +# SegmentData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The segment ID | [optional] | +|**name** | **String** | The segment name | [optional] | +|**createdAt** | **String** | Date segment created | [optional] | +|**updatedAt** | **String** | Date segment last updated | [optional] | +|**appId** | **String** | The app id | [optional] | +|**readOnly** | **Boolean** | Is the segment read only? | [optional] | +|**isActive** | **Boolean** | Is the segment active? | [optional] | + + + diff --git a/docs/SubscriptionObject.md b/docs/Subscription.md similarity index 81% rename from docs/SubscriptionObject.md rename to docs/Subscription.md index 6df7391c..6b2997a9 100644 --- a/docs/SubscriptionObject.md +++ b/docs/Subscription.md @@ -1,6 +1,6 @@ -# SubscriptionObject +# Subscription ## Properties @@ -11,16 +11,16 @@ |**type** | [**TypeEnum**](#TypeEnum) | | [optional] | |**token** | **String** | | [optional] | |**enabled** | **Boolean** | | [optional] | -|**notificationTypes** | **BigDecimal** | | [optional] | -|**sessionTime** | **BigDecimal** | | [optional] | -|**sessionCount** | **BigDecimal** | | [optional] | +|**notificationTypes** | **Integer** | | [optional] | +|**sessionTime** | **Integer** | | [optional] | +|**sessionCount** | **Integer** | | [optional] | |**sdk** | **String** | | [optional] | |**deviceModel** | **String** | | [optional] | |**deviceOs** | **String** | | [optional] | |**rooted** | **Boolean** | | [optional] | -|**testType** | **BigDecimal** | | [optional] | +|**testType** | **Integer** | | [optional] | |**appVersion** | **String** | | [optional] | -|**netType** | **BigDecimal** | | [optional] | +|**netType** | **Integer** | | [optional] | |**carrier** | **String** | | [optional] | |**webAuth** | **String** | | [optional] | |**webP256** | **String** | | [optional] | diff --git a/docs/DeleteSegmentNotFoundResponse.md b/docs/SubscriptionBody.md similarity index 56% rename from docs/DeleteSegmentNotFoundResponse.md rename to docs/SubscriptionBody.md index 09415e5a..c0216b6f 100644 --- a/docs/DeleteSegmentNotFoundResponse.md +++ b/docs/SubscriptionBody.md @@ -1,13 +1,13 @@ -# DeleteSegmentNotFoundResponse +# SubscriptionBody ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | +|**subscription** | [**Subscription**](Subscription.md) | | [optional] | diff --git a/docs/SubscriptionNotificationTarget.md b/docs/SubscriptionNotificationTarget.md new file mode 100644 index 00000000..7c3f05ca --- /dev/null +++ b/docs/SubscriptionNotificationTarget.md @@ -0,0 +1,33 @@ + + +# SubscriptionNotificationTarget + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | +|**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | +|**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | +|**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | | [optional] | + + + +## Enum: TargetChannelEnum + +| Name | Value | +|---- | -----| +| PUSH | "push" | +| EMAIL | "email" | +| SMS | "sms" | + + + diff --git a/docs/TransferSubscriptionRequestBody.md b/docs/TransferSubscriptionRequestBody.md index 4cd13a57..6d0f30d3 100644 --- a/docs/TransferSubscriptionRequestBody.md +++ b/docs/TransferSubscriptionRequestBody.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**identity** | **Map<String, Object>** | | [optional] | +|**identity** | **Map<String, String>** | | [optional] | diff --git a/docs/UpdateLiveActivityRequest.md b/docs/UpdateLiveActivityRequest.md index f76d6b9c..d4d319f5 100644 --- a/docs/UpdateLiveActivityRequest.md +++ b/docs/UpdateLiveActivityRequest.md @@ -7,21 +7,15 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | [**NameEnum**](#NameEnum) | Type of live activity | | +|**name** | **String** | An internal name to assist with your campaign organization. This does not get displayed in the message itself. | | |**event** | [**EventEnum**](#EventEnum) | | | -|**eventUpdates** | **Object** | | | -|**dismissAt** | **BigDecimal** | Timestamp; only allowed if event is \"end\" | [optional] | - - - -## Enum: NameEnum - -| Name | Value | -|---- | -----| -| HEADINGS | "headings" | -| CONTENTS | "contents" | -| IOS_SOUND | "ios_sound" | -| PRIORITY_LEVEL | "priority_level" | +|**eventUpdates** | **Object** | This must match the ContentState interface you have defined within your Live Activity in your app. | | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**sound** | **String** | Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. | [optional] | +|**staleDate** | **Integer** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] | +|**dismissalDate** | **Integer** | Accepts Unix timestamp in seconds; only allowed if event is \"end\" | [optional] | +|**priority** | **Integer** | Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery. | [optional] | diff --git a/docs/UpdateLiveActivitySuccessResponse.md b/docs/UpdateLiveActivitySuccessResponse.md index 079186d6..6dfa0b9c 100644 --- a/docs/UpdateLiveActivitySuccessResponse.md +++ b/docs/UpdateLiveActivitySuccessResponse.md @@ -7,8 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**notificationId** | **String** | | [optional] | -|**errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | +|**id** | **String** | | [optional] | diff --git a/docs/UpdatePlayerSuccessResponse.md b/docs/UpdatePlayerSuccessResponse.md deleted file mode 100644 index e25f5699..00000000 --- a/docs/UpdatePlayerSuccessResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UpdatePlayerSuccessResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | - - - diff --git a/docs/UpdatePlayerTagsRequestBody.md b/docs/UpdatePlayerTagsRequestBody.md deleted file mode 100644 index 03af3442..00000000 --- a/docs/UpdatePlayerTagsRequestBody.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UpdatePlayerTagsRequestBody - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | **Object** | Custom tags for the device record. Only support string key value pairs. Does not support arrays or other nested objects. Example `{\"foo\":\"bar\",\"this\":\"that\"}`. Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of ata Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | - - - diff --git a/docs/UpdatePlayerTagsSuccessResponse.md b/docs/UpdatePlayerTagsSuccessResponse.md deleted file mode 100644 index c20ff264..00000000 --- a/docs/UpdatePlayerTagsSuccessResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UpdatePlayerTagsSuccessResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**success** | **Boolean** | | [optional] | - - - diff --git a/docs/UpdateSubscriptionRequestBody.md b/docs/UpdateSubscriptionRequestBody.md deleted file mode 100644 index 29b2b27e..00000000 --- a/docs/UpdateSubscriptionRequestBody.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UpdateSubscriptionRequestBody - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | - - - diff --git a/docs/User.md b/docs/User.md index 41494e84..2e3d88d8 100644 --- a/docs/User.md +++ b/docs/User.md @@ -8,9 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**properties** | [**PropertiesObject**](PropertiesObject.md) | | [optional] | -|**identity** | **Map<String, Object>** | | [optional] | -|**subscriptions** | [**List<SubscriptionObject>**](SubscriptionObject.md) | | [optional] | -|**subscriptionOptions** | [**UserSubscriptionOptions**](UserSubscriptionOptions.md) | | [optional] | +|**identity** | **Map<String, String>** | | [optional] | +|**subscriptions** | [**List<Subscription>**](Subscription.md) | | [optional] | diff --git a/docs/InlineResponse200.md b/docs/UserIdentityBody.md similarity index 59% rename from docs/InlineResponse200.md rename to docs/UserIdentityBody.md index 1676c035..985dc1ec 100644 --- a/docs/InlineResponse200.md +++ b/docs/UserIdentityBody.md @@ -1,13 +1,13 @@ -# InlineResponse200 +# UserIdentityBody ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**identity** | **Map<String, Object>** | | [optional] | +|**identity** | **Map<String, String>** | | [optional] | diff --git a/docs/UserIdentityRequestBody.md b/docs/UserIdentityRequestBody.md deleted file mode 100644 index 4d5a6529..00000000 --- a/docs/UserIdentityRequestBody.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UserIdentityRequestBody - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**identity** | **Map<String, Object>** | | [optional] | - - - diff --git a/docs/UserIdentityResponse.md b/docs/UserIdentityResponse.md deleted file mode 100644 index 66d98f71..00000000 --- a/docs/UserIdentityResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UserIdentityResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**identity** | **Map<String, Object>** | | [optional] | - - - diff --git a/docs/UserSubscriptionOptions.md b/docs/UserSubscriptionOptions.md deleted file mode 100644 index 0d5f0de7..00000000 --- a/docs/UserSubscriptionOptions.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# UserSubscriptionOptions - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**retainPreviousOwner** | **Boolean** | | [optional] | - - - diff --git a/docs/WebButton.md b/docs/WebButton.md new file mode 100644 index 00000000..eafae48f --- /dev/null +++ b/docs/WebButton.md @@ -0,0 +1,16 @@ + + +# WebButton + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**text** | **String** | | [optional] | +|**icon** | **String** | | [optional] | +|**url** | **String** | | [optional] | + + + diff --git a/pom.xml b/pom.xml index 49e5194c..8d1657ba 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ onesignal-java-client jar onesignal-java-client - 1.4.0 + 5.0.1 https://github.com/openapitools/openapi-generator OpenAPI Java diff --git a/src/main/java/com/onesignal/client/ApiCallback.java b/src/main/java/com/onesignal/client/ApiCallback.java index 1ad29ebd..7f016274 100644 --- a/src/main/java/com/onesignal/client/ApiCallback.java +++ b/src/main/java/com/onesignal/client/ApiCallback.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java index 66c9dd6f..74f77958 100644 --- a/src/main/java/com/onesignal/client/ApiClient.java +++ b/src/main/java/com/onesignal/client/ApiClient.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -90,8 +90,8 @@ public ApiClient() { initHttpClient(); // Setup authentications (key: authentication name, value: authentication). - authentications.put("app_key", new HttpBearerAuth("Key")); - authentications.put("user_key", new HttpBearerAuth("Key")); + authentications.put("rest_api_key", new HttpBearerAuth("Key")); + authentications.put("user_auth_key", new HttpBearerAuth("Key")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -107,8 +107,8 @@ public ApiClient(OkHttpClient client) { httpClient = client; // Setup authentications (key: authentication name, value: authentication). - authentications.put("app_key", new HttpBearerAuth("Key")); - authentications.put("user_key", new HttpBearerAuth("Key")); + authentications.put("rest_api_key", new HttpBearerAuth("Key")); + authentications.put("user_auth_key", new HttpBearerAuth("Key")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -133,7 +133,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.4.0/java"); + setUserAgent("OpenAPI-Generator/5.0.1/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/onesignal/client/ApiException.java b/src/main/java/com/onesignal/client/ApiException.java index 3a2ec0b5..c81c18f5 100644 --- a/src/main/java/com/onesignal/client/ApiException.java +++ b/src/main/java/com/onesignal/client/ApiException.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,7 +22,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/com/onesignal/client/ApiResponse.java b/src/main/java/com/onesignal/client/ApiResponse.java index 3b54550a..4e512863 100644 --- a/src/main/java/com/onesignal/client/ApiResponse.java +++ b/src/main/java/com/onesignal/client/ApiResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/Configuration.java b/src/main/java/com/onesignal/client/Configuration.java index 232097d2..bdaf87f1 100644 --- a/src/main/java/com/onesignal/client/Configuration.java +++ b/src/main/java/com/onesignal/client/Configuration.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package com.onesignal.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java index 65a14d63..669d3515 100644 --- a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java +++ b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java index a5a3492f..73c51bd5 100644 --- a/src/main/java/com/onesignal/client/JSON.java +++ b/src/main/java/com/onesignal/client/JSON.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -97,37 +97,25 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotification.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotificationAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.BeginLiveActivityRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Button.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.CancelNotificationSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateNotificationSuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.CreatePlayerSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSegmentConflictResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSegmentSuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSubscriptionRequestBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateUserConflictResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateUserConflictResponseErrorsInner.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateUserConflictResponseErrorsItemsMeta.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.DeletePlayerNotFoundResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.DeletePlayerSuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.DeleteSegmentNotFoundResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.DeleteSegmentSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ExportEventsSuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.ExportPlayersRequestBody.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.ExportPlayersSuccessResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.ExportSubscriptionsRequestBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.ExportSubscriptionsSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Filter.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.FilterExpressions.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.FilterExpression.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.GenericError.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.GenericErrorErrorsInner.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.GetNotificationRequestBody.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse200.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse2003.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse201.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse202.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.InvalidIdentifierError.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.GenericSuccessBoolResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.GetNotificationHistoryRequestBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.GetSegmentsSuccessResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.LanguageStringMap.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Notification.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.Notification200Errors.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationHistorySuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationSlice.CustomTypeAdapterFactory()) @@ -140,30 +128,24 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.PlatformDeliveryData.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.PlatformDeliveryDataEmailAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.PlatformDeliveryDataSmsAllOf.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.Player.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.PlayerNotificationTarget.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.PlayerNotificationTargetIncludeAliases.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.PlayerSlice.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.PropertiesBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.PropertiesDeltas.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.PropertiesObject.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Purchase.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.RateLimiterError.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.RateLimitError.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Segment.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentData.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentNotificationTarget.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.StringMap.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.SubscriptionObject.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Subscription.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.SubscriptionBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.SubscriptionNotificationTarget.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.TransferSubscriptionRequestBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivityRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivitySuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UpdatePlayerSuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UpdatePlayerTagsRequestBody.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UpdatePlayerTagsSuccessResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateSubscriptionRequestBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateUserRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.User.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UserIdentityRequestBody.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UserIdentityResponse.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new com.onesignal.client.model.UserSubscriptionOptions.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UserIdentityBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.WebButton.CustomTypeAdapterFactory()) .create(); } diff --git a/src/main/java/com/onesignal/client/Pair.java b/src/main/java/com/onesignal/client/Pair.java index 16fa1001..cb63cc9d 100644 --- a/src/main/java/com/onesignal/client/Pair.java +++ b/src/main/java/com/onesignal/client/Pair.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package com.onesignal.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/onesignal/client/ProgressRequestBody.java b/src/main/java/com/onesignal/client/ProgressRequestBody.java index 5ac9678d..9146577d 100644 --- a/src/main/java/com/onesignal/client/ProgressRequestBody.java +++ b/src/main/java/com/onesignal/client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ProgressResponseBody.java b/src/main/java/com/onesignal/client/ProgressResponseBody.java index b03e2693..71597fed 100644 --- a/src/main/java/com/onesignal/client/ProgressResponseBody.java +++ b/src/main/java/com/onesignal/client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/StringUtil.java b/src/main/java/com/onesignal/client/StringUtil.java index f3a4e7af..0802ebdf 100644 --- a/src/main/java/com/onesignal/client/StringUtil.java +++ b/src/main/java/com/onesignal/client/StringUtil.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java index 4441fa52..2f2aa6c0 100644 --- a/src/main/java/com/onesignal/client/api/DefaultApi.java +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,47 +28,32 @@ import com.onesignal.client.model.App; -import com.onesignal.client.model.BeginLiveActivityRequest; -import com.onesignal.client.model.CancelNotificationSuccessResponse; import com.onesignal.client.model.CreateNotificationSuccessResponse; -import com.onesignal.client.model.CreatePlayerSuccessResponse; import com.onesignal.client.model.CreateSegmentConflictResponse; import com.onesignal.client.model.CreateSegmentSuccessResponse; -import com.onesignal.client.model.CreateSubscriptionRequestBody; import com.onesignal.client.model.CreateUserConflictResponse; -import com.onesignal.client.model.DeletePlayerNotFoundResponse; -import com.onesignal.client.model.DeletePlayerSuccessResponse; -import com.onesignal.client.model.DeleteSegmentNotFoundResponse; -import com.onesignal.client.model.DeleteSegmentSuccessResponse; import com.onesignal.client.model.ExportEventsSuccessResponse; -import com.onesignal.client.model.ExportPlayersRequestBody; -import com.onesignal.client.model.ExportPlayersSuccessResponse; +import com.onesignal.client.model.ExportSubscriptionsRequestBody; +import com.onesignal.client.model.ExportSubscriptionsSuccessResponse; import com.onesignal.client.model.GenericError; -import com.onesignal.client.model.GetNotificationRequestBody; -import com.onesignal.client.model.InlineResponse200; -import com.onesignal.client.model.InlineResponse2003; -import com.onesignal.client.model.InlineResponse201; -import com.onesignal.client.model.InlineResponse202; +import com.onesignal.client.model.GenericSuccessBoolResponse; +import com.onesignal.client.model.GetNotificationHistoryRequestBody; +import com.onesignal.client.model.GetSegmentsSuccessResponse; import com.onesignal.client.model.Notification; import com.onesignal.client.model.NotificationHistorySuccessResponse; import com.onesignal.client.model.NotificationSlice; import com.onesignal.client.model.NotificationWithMeta; import com.onesignal.client.model.OutcomesData; -import com.onesignal.client.model.Player; -import com.onesignal.client.model.PlayerSlice; -import com.onesignal.client.model.RateLimiterError; +import com.onesignal.client.model.PropertiesBody; +import com.onesignal.client.model.RateLimitError; import com.onesignal.client.model.Segment; +import com.onesignal.client.model.SubscriptionBody; import com.onesignal.client.model.TransferSubscriptionRequestBody; import com.onesignal.client.model.UpdateLiveActivityRequest; import com.onesignal.client.model.UpdateLiveActivitySuccessResponse; -import com.onesignal.client.model.UpdatePlayerSuccessResponse; -import com.onesignal.client.model.UpdatePlayerTagsRequestBody; -import com.onesignal.client.model.UpdatePlayerTagsSuccessResponse; -import com.onesignal.client.model.UpdateSubscriptionRequestBody; import com.onesignal.client.model.UpdateUserRequest; import com.onesignal.client.model.User; -import com.onesignal.client.model.UserIdentityRequestBody; -import com.onesignal.client.model.UserIdentityResponse; +import com.onesignal.client.model.UserIdentityBody; import java.lang.reflect.Type; import java.util.ArrayList; @@ -115,22 +100,22 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for beginLiveActivity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param beginLiveActivityRequest (required) + * Build call for cancelNotification + * @param appId (required) + * @param notificationId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call beginLiveActivityCall(String appId, String activityId, BeginLiveActivityRequest beginLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelNotificationCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -144,12 +129,11 @@ public okhttp3.Call beginLiveActivityCall(String appId, String activityId, Begin basePath = null; } - Object localVarPostBody = beginLiveActivityRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/token" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); + String localVarPath = "/notifications/{notification_id}" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -158,7 +142,11 @@ public okhttp3.Call beginLiveActivityCall(String appId, String activityId, Begin Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } final String[] localVarAccepts = { "application/json" @@ -169,108 +157,109 @@ public okhttp3.Call beginLiveActivityCall(String appId, String activityId, Begin } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call beginLiveActivityValidateBeforeCall(String appId, String activityId, BeginLiveActivityRequest beginLiveActivityRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call cancelNotificationValidateBeforeCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling beginLiveActivity(Async)"); - } - - // verify the required parameter 'activityId' is set - if (activityId == null) { - throw new ApiException("Missing the required parameter 'activityId' when calling beginLiveActivity(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling cancelNotification(Async)"); } - // verify the required parameter 'beginLiveActivityRequest' is set - if (beginLiveActivityRequest == null) { - throw new ApiException("Missing the required parameter 'beginLiveActivityRequest' when calling beginLiveActivity(Async)"); + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling cancelNotification(Async)"); } - okhttp3.Call localVarCall = beginLiveActivityCall(appId, activityId, beginLiveActivityRequest, _callback); + okhttp3.Call localVarCall = cancelNotificationCall(appId, notificationId, _callback); return localVarCall; } /** - * Start Live Activity - * Starts a Live Activity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param beginLiveActivityRequest (required) + * Stop a scheduled or currently outgoing notification + * Used to stop a scheduled or currently outgoing notification + * @param appId (required) + * @param notificationId (required) + * @return GenericSuccessBoolResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public void beginLiveActivity(String appId, String activityId, BeginLiveActivityRequest beginLiveActivityRequest) throws ApiException { - beginLiveActivityWithHttpInfo(appId, activityId, beginLiveActivityRequest); + public GenericSuccessBoolResponse cancelNotification(String appId, String notificationId) throws ApiException { + ApiResponse localVarResp = cancelNotificationWithHttpInfo(appId, notificationId); + return localVarResp.getData(); } /** - * Start Live Activity - * Starts a Live Activity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param beginLiveActivityRequest (required) - * @return ApiResponse<Void> + * Stop a scheduled or currently outgoing notification + * Used to stop a scheduled or currently outgoing notification + * @param appId (required) + * @param notificationId (required) + * @return ApiResponse<GenericSuccessBoolResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse beginLiveActivityWithHttpInfo(String appId, String activityId, BeginLiveActivityRequest beginLiveActivityRequest) throws ApiException { - okhttp3.Call localVarCall = beginLiveActivityValidateBeforeCall(appId, activityId, beginLiveActivityRequest, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse cancelNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { + okhttp3.Call localVarCall = cancelNotificationValidateBeforeCall(appId, notificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Start Live Activity (asynchronously) - * Starts a Live Activity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param beginLiveActivityRequest (required) + * Stop a scheduled or currently outgoing notification (asynchronously) + * Used to stop a scheduled or currently outgoing notification + * @param appId (required) + * @param notificationId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call beginLiveActivityAsync(String appId, String activityId, BeginLiveActivityRequest beginLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = beginLiveActivityValidateBeforeCall(appId, activityId, beginLiveActivityRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = cancelNotificationValidateBeforeCall(appId, notificationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for cancelNotification + * Build call for createAlias * @param appId (required) - * @param notificationId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param userIdentityBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -279,10 +268,12 @@ public okhttp3.Call beginLiveActivityAsync(String appId, String activityId, Begi Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call cancelNotificationCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAliasCall(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -296,11 +287,13 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = userIdentityBody; // create path and map variables - String localVarPath = "/notifications/{notification_id}" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -309,11 +302,7 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -324,82 +313,102 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelNotificationValidateBeforeCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createAliasValidateBeforeCall(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling cancelNotification(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling createAlias(Async)"); } - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling cancelNotification(Async)"); + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling createAlias(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling createAlias(Async)"); + } + + // verify the required parameter 'userIdentityBody' is set + if (userIdentityBody == null) { + throw new ApiException("Missing the required parameter 'userIdentityBody' when calling createAlias(Async)"); } - okhttp3.Call localVarCall = cancelNotificationCall(appId, notificationId, _callback); + okhttp3.Call localVarCall = createAliasCall(appId, aliasLabel, aliasId, userIdentityBody, _callback); return localVarCall; } /** - * Stop a scheduled or currently outgoing notification - * Used to stop a scheduled or currently outgoing notification + * + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). * @param appId (required) - * @param notificationId (required) - * @return CancelNotificationSuccessResponse + * @param aliasLabel (required) + * @param aliasId (required) + * @param userIdentityBody (required) + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public CancelNotificationSuccessResponse cancelNotification(String appId, String notificationId) throws ApiException { - ApiResponse localVarResp = cancelNotificationWithHttpInfo(appId, notificationId); + public UserIdentityBody createAlias(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody) throws ApiException { + ApiResponse localVarResp = createAliasWithHttpInfo(appId, aliasLabel, aliasId, userIdentityBody); return localVarResp.getData(); } /** - * Stop a scheduled or currently outgoing notification - * Used to stop a scheduled or currently outgoing notification + * + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). * @param appId (required) - * @param notificationId (required) - * @return ApiResponse<CancelNotificationSuccessResponse> + * @param aliasLabel (required) + * @param aliasId (required) + * @param userIdentityBody (required) + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse cancelNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { - okhttp3.Call localVarCall = cancelNotificationValidateBeforeCall(appId, notificationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody) throws ApiException { + okhttp3.Call localVarCall = createAliasValidateBeforeCall(appId, aliasLabel, aliasId, userIdentityBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Stop a scheduled or currently outgoing notification (asynchronously) - * Used to stop a scheduled or currently outgoing notification + * (asynchronously) + * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). * @param appId (required) - * @param notificationId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param userIdentityBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -408,19 +417,23 @@ public ApiResponse cancelNotificationWithHttp Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call cancelNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAliasAsync(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = cancelNotificationValidateBeforeCall(appId, notificationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createAliasValidateBeforeCall(appId, aliasLabel, aliasId, userIdentityBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createApp - * @param app (required) + * Build call for createAliasBySubscription + * @param appId (required) + * @param subscriptionId (required) + * @param userIdentityBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -429,10 +442,12 @@ public okhttp3.Call cancelNotificationAsync(String appId, String notificationId, Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAliasBySubscriptionCall(String appId, String subscriptionId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -446,10 +461,12 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A basePath = null; } - Object localVarPostBody = app; + Object localVarPostBody = userIdentityBody; // create path and map variables - String localVarPath = "/apps"; + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/user/identity" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -458,7 +475,7 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -476,67 +493,87 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "user_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createAppValidateBeforeCall(App app, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createAliasBySubscriptionValidateBeforeCall(String appId, String subscriptionId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'app' is set - if (app == null) { - throw new ApiException("Missing the required parameter 'app' when calling createApp(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling createAliasBySubscription(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling createAliasBySubscription(Async)"); + } + + // verify the required parameter 'userIdentityBody' is set + if (userIdentityBody == null) { + throw new ApiException("Missing the required parameter 'userIdentityBody' when calling createAliasBySubscription(Async)"); } - okhttp3.Call localVarCall = createAppCall(app, _callback); + okhttp3.Call localVarCall = createAliasBySubscriptionCall(appId, subscriptionId, userIdentityBody, _callback); return localVarCall; } /** - * Create an app - * Creates a new OneSignal app - * @param app (required) - * @return App + * + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param appId (required) + * @param subscriptionId (required) + * @param userIdentityBody (required) + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public App createApp(App app) throws ApiException { - ApiResponse localVarResp = createAppWithHttpInfo(app); + public UserIdentityBody createAliasBySubscription(String appId, String subscriptionId, UserIdentityBody userIdentityBody) throws ApiException { + ApiResponse localVarResp = createAliasBySubscriptionWithHttpInfo(appId, subscriptionId, userIdentityBody); return localVarResp.getData(); } /** - * Create an app - * Creates a new OneSignal app - * @param app (required) - * @return ApiResponse<App> + * + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param appId (required) + * @param subscriptionId (required) + * @param userIdentityBody (required) + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse createAppWithHttpInfo(App app) throws ApiException { - okhttp3.Call localVarCall = createAppValidateBeforeCall(app, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createAliasBySubscriptionWithHttpInfo(String appId, String subscriptionId, UserIdentityBody userIdentityBody) throws ApiException { + okhttp3.Call localVarCall = createAliasBySubscriptionValidateBeforeCall(appId, subscriptionId, userIdentityBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create an app (asynchronously) - * Creates a new OneSignal app - * @param app (required) + * (asynchronously) + * Upserts one or more Aliases for the User identified by :subscription_id. + * @param appId (required) + * @param subscriptionId (required) + * @param userIdentityBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -545,31 +582,33 @@ public ApiResponse createAppWithHttpInfo(App app) throws ApiException { Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAliasBySubscriptionAsync(String appId, String subscriptionId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createAppValidateBeforeCall(app, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createAliasBySubscriptionValidateBeforeCall(appId, subscriptionId, userIdentityBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNotification - * @param notification (required) + * Build call for createApp + * @param app (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 OK, invalid_player_ids, invalid_external_user_ids or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_player_ids\" or \"invalid_external_user_ids\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createNotificationCall(Notification notification, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -583,10 +622,10 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC basePath = null; } - Object localVarPostBody = notification; + Object localVarPostBody = app; // create path and map variables - String localVarPath = "/notifications"; + String localVarPath = "/apps"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -595,7 +634,7 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -613,101 +652,100 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "user_auth_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createNotificationValidateBeforeCall(Notification notification, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createAppValidateBeforeCall(App app, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'notification' is set - if (notification == null) { - throw new ApiException("Missing the required parameter 'notification' when calling createNotification(Async)"); + // verify the required parameter 'app' is set + if (app == null) { + throw new ApiException("Missing the required parameter 'app' when calling createApp(Async)"); } - okhttp3.Call localVarCall = createNotificationCall(notification, _callback); + okhttp3.Call localVarCall = createAppCall(app, _callback); return localVarCall; } /** - * Create notification - * Sends notifications to your users - * @param notification (required) - * @return CreateNotificationSuccessResponse + * Create an app + * Creates a new OneSignal app + * @param app (required) + * @return App * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK, invalid_player_ids, invalid_external_user_ids or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_player_ids\" or \"invalid_external_user_ids\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public CreateNotificationSuccessResponse createNotification(Notification notification) throws ApiException { - ApiResponse localVarResp = createNotificationWithHttpInfo(notification); + public App createApp(App app) throws ApiException { + ApiResponse localVarResp = createAppWithHttpInfo(app); return localVarResp.getData(); } /** - * Create notification - * Sends notifications to your users - * @param notification (required) - * @return ApiResponse<CreateNotificationSuccessResponse> + * Create an app + * Creates a new OneSignal app + * @param app (required) + * @return ApiResponse<App> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK, invalid_player_ids, invalid_external_user_ids or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_player_ids\" or \"invalid_external_user_ids\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public ApiResponse createNotificationWithHttpInfo(Notification notification) throws ApiException { - okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createAppWithHttpInfo(App app) throws ApiException { + okhttp3.Call localVarCall = createAppValidateBeforeCall(app, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create notification (asynchronously) - * Sends notifications to your users - * @param notification (required) + * Create an app (asynchronously) + * Creates a new OneSignal app + * @param app (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
Status Code Description Response Headers
200 OK, invalid_player_ids, invalid_external_user_ids or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_player_ids\" or \"invalid_external_user_ids\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createNotificationAsync(Notification notification, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createAppValidateBeforeCall(app, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createPlayer - * @param player (required) + * Build call for createNotification + * @param notification (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + -
Status Code Description Response Headers
200 OK -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createPlayerCall(Player player, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createNotificationCall(Notification notification, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -721,10 +759,10 @@ public okhttp3.Call createPlayerCall(Player player, final ApiCallback _callback) basePath = null; } - Object localVarPostBody = player; + Object localVarPostBody = notification; // create path and map variables - String localVarPath = "/players"; + String localVarPath = "/notifications"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -733,7 +771,7 @@ public okhttp3.Call createPlayerCall(Player player, final ApiCallback _callback) Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -751,90 +789,87 @@ public okhttp3.Call createPlayerCall(Player player, final ApiCallback _callback) localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createPlayerValidateBeforeCall(Player player, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createNotificationValidateBeforeCall(Notification notification, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'player' is set - if (player == null) { - throw new ApiException("Missing the required parameter 'player' when calling createPlayer(Async)"); + // verify the required parameter 'notification' is set + if (notification == null) { + throw new ApiException("Missing the required parameter 'notification' when calling createNotification(Async)"); } - okhttp3.Call localVarCall = createPlayerCall(player, _callback); + okhttp3.Call localVarCall = createNotificationCall(notification, _callback); return localVarCall; } /** - * Add a device - * Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. - * @param player (required) - * @return CreatePlayerSuccessResponse + * Create notification + * Sends notifications to your users + * @param notification (required) + * @return CreateNotificationSuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + -
Status Code Description Response Headers
200 OK -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public CreatePlayerSuccessResponse createPlayer(Player player) throws ApiException { - ApiResponse localVarResp = createPlayerWithHttpInfo(player); + public CreateNotificationSuccessResponse createNotification(Notification notification) throws ApiException { + ApiResponse localVarResp = createNotificationWithHttpInfo(notification); return localVarResp.getData(); } /** - * Add a device - * Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. - * @param player (required) - * @return ApiResponse<CreatePlayerSuccessResponse> + * Create notification + * Sends notifications to your users + * @param notification (required) + * @return ApiResponse<CreateNotificationSuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + -
Status Code Description Response Headers
200 OK -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse createPlayerWithHttpInfo(Player player) throws ApiException { - okhttp3.Call localVarCall = createPlayerValidateBeforeCall(player, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createNotificationWithHttpInfo(Notification notification) throws ApiException { + okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add a device (asynchronously) - * Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. - * @param player (required) + * Create notification (asynchronously) + * Sends notifications to your users + * @param notification (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - + -
Status Code Description Response Headers
200 OK -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createPlayerAsync(Player player, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createNotificationAsync(Notification notification, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createPlayerValidateBeforeCall(player, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createSegments + * Build call for createSegment * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segment (optional) * @param _callback Callback for upload/download progress @@ -849,7 +884,7 @@ public okhttp3.Call createPlayerAsync(Player player, final ApiCallback 429 Rate Limit Exceeded - */ - public okhttp3.Call createSegmentsCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -876,7 +911,7 @@ public okhttp3.Call createSegmentsCall(String appId, Segment segment, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -894,27 +929,27 @@ public okhttp3.Call createSegmentsCall(String appId, Segment segment, final ApiC localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createSegmentsValidateBeforeCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createSegmentValidateBeforeCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling createSegments(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling createSegment(Async)"); } - okhttp3.Call localVarCall = createSegmentsCall(appId, segment, _callback); + okhttp3.Call localVarCall = createSegmentCall(appId, segment, _callback); return localVarCall; } /** - * Create Segments - * Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + * Create Segment + * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segment (optional) * @return CreateSegmentSuccessResponse @@ -928,14 +963,14 @@ private okhttp3.Call createSegmentsValidateBeforeCall(String appId, Segment segm 429 Rate Limit Exceeded - */ - public CreateSegmentSuccessResponse createSegments(String appId, Segment segment) throws ApiException { - ApiResponse localVarResp = createSegmentsWithHttpInfo(appId, segment); + public CreateSegmentSuccessResponse createSegment(String appId, Segment segment) throws ApiException { + ApiResponse localVarResp = createSegmentWithHttpInfo(appId, segment); return localVarResp.getData(); } /** - * Create Segments - * Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + * Create Segment + * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segment (optional) * @return ApiResponse<CreateSegmentSuccessResponse> @@ -949,15 +984,15 @@ public CreateSegmentSuccessResponse createSegments(String appId, Segment segment 429 Rate Limit Exceeded - */ - public ApiResponse createSegmentsWithHttpInfo(String appId, Segment segment) throws ApiException { - okhttp3.Call localVarCall = createSegmentsValidateBeforeCall(appId, segment, null); + public ApiResponse createSegmentWithHttpInfo(String appId, Segment segment) throws ApiException { + okhttp3.Call localVarCall = createSegmentValidateBeforeCall(appId, segment, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Segments (asynchronously) - * Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + * Create Segment (asynchronously) + * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segment (optional) * @param _callback The callback to be executed when the API call finishes @@ -972,9 +1007,9 @@ public ApiResponse createSegmentsWithHttpInfo(Stri 429 Rate Limit Exceeded - */ - public okhttp3.Call createSegmentsAsync(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSegmentAsync(String appId, Segment segment, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createSegmentsValidateBeforeCall(appId, segment, _callback); + okhttp3.Call localVarCall = createSegmentValidateBeforeCall(appId, segment, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -984,7 +1019,7 @@ public okhttp3.Call createSegmentsAsync(String appId, Segment segment, final Api * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param createSubscriptionRequestBody (required) + * @param subscriptionBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -994,11 +1029,12 @@ public okhttp3.Call createSegmentsAsync(String appId, Segment segment, final Api 201 CREATED - 202 ACCEPTED - 400 Bad Request - + 404 Not Found - 409 Operation is not permitted due to user having the maximum number of subscriptions assigned - 429 Rate Limit Exceeded - */ - public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, String aliasId, CreateSubscriptionRequestBody createSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1012,7 +1048,7 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri basePath = null; } - Object localVarPostBody = createSubscriptionRequestBody; + Object localVarPostBody = subscriptionBody; // create path and map variables String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions" @@ -1027,7 +1063,7 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1045,12 +1081,12 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String aliasLabel, String aliasId, CreateSubscriptionRequestBody createSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { @@ -1067,13 +1103,13 @@ private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String a throw new ApiException("Missing the required parameter 'aliasId' when calling createSubscription(Async)"); } - // verify the required parameter 'createSubscriptionRequestBody' is set - if (createSubscriptionRequestBody == null) { - throw new ApiException("Missing the required parameter 'createSubscriptionRequestBody' when calling createSubscription(Async)"); + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling createSubscription(Async)"); } - okhttp3.Call localVarCall = createSubscriptionCall(appId, aliasLabel, aliasId, createSubscriptionRequestBody, _callback); + okhttp3.Call localVarCall = createSubscriptionCall(appId, aliasLabel, aliasId, subscriptionBody, _callback); return localVarCall; } @@ -1084,8 +1120,8 @@ private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String a * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param createSubscriptionRequestBody (required) - * @return InlineResponse201 + * @param subscriptionBody (required) + * @return SubscriptionBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1093,12 +1129,13 @@ private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String a +
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public InlineResponse201 createSubscription(String appId, String aliasLabel, String aliasId, CreateSubscriptionRequestBody createSubscriptionRequestBody) throws ApiException { - ApiResponse localVarResp = createSubscriptionWithHttpInfo(appId, aliasLabel, aliasId, createSubscriptionRequestBody); + public SubscriptionBody createSubscription(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody) throws ApiException { + ApiResponse localVarResp = createSubscriptionWithHttpInfo(appId, aliasLabel, aliasId, subscriptionBody); return localVarResp.getData(); } @@ -1108,8 +1145,8 @@ public InlineResponse201 createSubscription(String appId, String aliasLabel, Str * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param createSubscriptionRequestBody (required) - * @return ApiResponse<InlineResponse201> + * @param subscriptionBody (required) + * @return ApiResponse<SubscriptionBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1117,13 +1154,14 @@ public InlineResponse201 createSubscription(String appId, String aliasLabel, Str +
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public ApiResponse createSubscriptionWithHttpInfo(String appId, String aliasLabel, String aliasId, CreateSubscriptionRequestBody createSubscriptionRequestBody) throws ApiException { - okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, createSubscriptionRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createSubscriptionWithHttpInfo(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, subscriptionBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1133,7 +1171,7 @@ public ApiResponse createSubscriptionWithHttpInfo(String appI * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param createSubscriptionRequestBody (required) + * @param subscriptionBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1143,14 +1181,15 @@ public ApiResponse createSubscriptionWithHttpInfo(String appI 201 CREATED - 202 ACCEPTED - 400 Bad Request - + 404 Not Found - 409 Operation is not permitted due to user having the maximum number of subscriptions assigned - 429 Rate Limit Exceeded - */ - public okhttp3.Call createSubscriptionAsync(String appId, String aliasLabel, String aliasId, CreateSubscriptionRequestBody createSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSubscriptionAsync(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, createSubscriptionRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, subscriptionBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1199,7 +1238,7 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1217,7 +1256,7 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -1327,6 +1366,7 @@ public okhttp3.Call createUserAsync(String appId, User user, final ApiCallback Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - @@ -1361,7 +1401,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1379,7 +1419,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -1419,19 +1459,20 @@ private okhttp3.Call deleteAliasValidateBeforeCall(String appId, String aliasLab * @param aliasLabel (required) * @param aliasId (required) * @param aliasLabelToDelete (required) - * @return InlineResponse200 + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public InlineResponse200 deleteAlias(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { - ApiResponse localVarResp = deleteAliasWithHttpInfo(appId, aliasLabel, aliasId, aliasLabelToDelete); + public UserIdentityBody deleteAlias(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { + ApiResponse localVarResp = deleteAliasWithHttpInfo(appId, aliasLabel, aliasId, aliasLabelToDelete); return localVarResp.getData(); } @@ -1442,20 +1483,21 @@ public InlineResponse200 deleteAlias(String appId, String aliasLabel, String ali * @param aliasLabel (required) * @param aliasId (required) * @param aliasLabelToDelete (required) - * @return ApiResponse<InlineResponse200> + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse deleteAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { + public ApiResponse deleteAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(appId, aliasLabel, aliasId, aliasLabelToDelete, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1474,174 +1516,20 @@ public ApiResponse deleteAliasWithHttpInfo(String appId, Stri Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call deleteAliasAsync(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAliasAsync(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(appId, aliasLabel, aliasId, aliasLabelToDelete, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deletePlayer - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param playerId The OneSignal player_id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call deletePlayerCall(String appId, String playerId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/players/{player_id}" - .replaceAll("\\{" + "player_id" + "\\}", localVarApiClient.escapeString(playerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deletePlayerValidateBeforeCall(String appId, String playerId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling deletePlayer(Async)"); - } - - // verify the required parameter 'playerId' is set - if (playerId == null) { - throw new ApiException("Missing the required parameter 'playerId' when calling deletePlayer(Async)"); - } - - - okhttp3.Call localVarCall = deletePlayerCall(appId, playerId, _callback); - return localVarCall; - - } - - /** - * Delete a user record - * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param playerId The OneSignal player_id (required) - * @return DeletePlayerSuccessResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
- */ - public DeletePlayerSuccessResponse deletePlayer(String appId, String playerId) throws ApiException { - ApiResponse localVarResp = deletePlayerWithHttpInfo(appId, playerId); - return localVarResp.getData(); - } - - /** - * Delete a user record - * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param playerId The OneSignal player_id (required) - * @return ApiResponse<DeletePlayerSuccessResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
- */ - public ApiResponse deletePlayerWithHttpInfo(String appId, String playerId) throws ApiException { - okhttp3.Call localVarCall = deletePlayerValidateBeforeCall(appId, playerId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Delete a user record (asynchronously) - * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param playerId The OneSignal player_id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call deletePlayerAsync(String appId, String playerId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deletePlayerValidateBeforeCall(appId, playerId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteSegments + * Build call for deleteSegment * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * @param _callback Callback for upload/download progress @@ -1656,7 +1544,7 @@ public okhttp3.Call deletePlayerAsync(String appId, String playerId, final ApiCa 429 Rate Limit Exceeded - */ - public okhttp3.Call deleteSegmentsCall(String appId, String segmentId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1684,7 +1572,7 @@ public okhttp3.Call deleteSegmentsCall(String appId, String segmentId, final Api Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1702,35 +1590,35 @@ public okhttp3.Call deleteSegmentsCall(String appId, String segmentId, final Api localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSegmentsValidateBeforeCall(String appId, String segmentId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteSegmentValidateBeforeCall(String appId, String segmentId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling deleteSegments(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling deleteSegment(Async)"); } // verify the required parameter 'segmentId' is set if (segmentId == null) { - throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegments(Async)"); + throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegment(Async)"); } - okhttp3.Call localVarCall = deleteSegmentsCall(appId, segmentId, _callback); + okhttp3.Call localVarCall = deleteSegmentCall(appId, segmentId, _callback); return localVarCall; } /** - * Delete Segments - * Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + * Delete Segment + * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * @return DeleteSegmentSuccessResponse + * @return GenericSuccessBoolResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1741,17 +1629,17 @@ private okhttp3.Call deleteSegmentsValidateBeforeCall(String appId, String segme
429 Rate Limit Exceeded -
*/ - public DeleteSegmentSuccessResponse deleteSegments(String appId, String segmentId) throws ApiException { - ApiResponse localVarResp = deleteSegmentsWithHttpInfo(appId, segmentId); + public GenericSuccessBoolResponse deleteSegment(String appId, String segmentId) throws ApiException { + ApiResponse localVarResp = deleteSegmentWithHttpInfo(appId, segmentId); return localVarResp.getData(); } /** - * Delete Segments - * Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + * Delete Segment + * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * @return ApiResponse<DeleteSegmentSuccessResponse> + * @return ApiResponse<GenericSuccessBoolResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1762,15 +1650,15 @@ public DeleteSegmentSuccessResponse deleteSegments(String appId, String segmentI
429 Rate Limit Exceeded -
*/ - public ApiResponse deleteSegmentsWithHttpInfo(String appId, String segmentId) throws ApiException { - okhttp3.Call localVarCall = deleteSegmentsValidateBeforeCall(appId, segmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse deleteSegmentWithHttpInfo(String appId, String segmentId) throws ApiException { + okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(appId, segmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Segments (asynchronously) - * Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + * Delete Segment (asynchronously) + * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * @param _callback The callback to be executed when the API call finishes @@ -1785,10 +1673,10 @@ public ApiResponse deleteSegmentsWithHttpInfo(Stri 429 Rate Limit Exceeded - */ - public okhttp3.Call deleteSegmentsAsync(String appId, String segmentId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSegmentAsync(String appId, String segmentId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteSegmentsValidateBeforeCall(appId, segmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(appId, segmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1804,6 +1692,7 @@ public okhttp3.Call deleteSegmentsAsync(String appId, String segmentId, final Ap Status Code Description Response Headers 202 ACCEPTED - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - @@ -1836,7 +1725,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1854,7 +1743,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -1888,6 +1777,7 @@ private okhttp3.Call deleteSubscriptionValidateBeforeCall(String appId, String s Status Code Description Response Headers 202 ACCEPTED - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - @@ -1908,6 +1798,7 @@ public void deleteSubscription(String appId, String subscriptionId) throws ApiEx Status Code Description Response Headers 202 ACCEPTED - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - @@ -1930,6 +1821,7 @@ public ApiResponse deleteSubscriptionWithHttpInfo(String appId, String sub Status Code Description Response Headers 202 ACCEPTED - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - @@ -1986,7 +1878,7 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2004,7 +1896,7 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -2099,22 +1991,22 @@ public okhttp3.Call deleteUserAsync(String appId, String aliasLabel, String alia return localVarCall; } /** - * Build call for endLiveActivity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param subscriptionId Subscription ID (required) + * Build call for exportEvents + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call endLiveActivityCall(String appId, String activityId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportEventsCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2131,10 +2023,8 @@ public okhttp3.Call endLiveActivityCall(String appId, String activityId, String Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + String localVarPath = "/notifications/{notification_id}/export_events?app_id={app_id}" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2143,7 +2033,11 @@ public okhttp3.Call endLiveActivityCall(String appId, String activityId, String Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } final String[] localVarAccepts = { "application/json" @@ -2161,101 +2055,100 @@ public okhttp3.Call endLiveActivityCall(String appId, String activityId, String localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call endLiveActivityValidateBeforeCall(String appId, String activityId, String subscriptionId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling endLiveActivity(Async)"); - } + private okhttp3.Call exportEventsValidateBeforeCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'activityId' is set - if (activityId == null) { - throw new ApiException("Missing the required parameter 'activityId' when calling endLiveActivity(Async)"); + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling exportEvents(Async)"); } - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling endLiveActivity(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling exportEvents(Async)"); } - okhttp3.Call localVarCall = endLiveActivityCall(appId, activityId, subscriptionId, _callback); + okhttp3.Call localVarCall = exportEventsCall(notificationId, appId, _callback); return localVarCall; } /** - * Stop Live Activity - * Stops a Live Activity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param subscriptionId Subscription ID (required) + * Export CSV of Events + * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) + * @return ExportEventsSuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public void endLiveActivity(String appId, String activityId, String subscriptionId) throws ApiException { - endLiveActivityWithHttpInfo(appId, activityId, subscriptionId); + public ExportEventsSuccessResponse exportEvents(String notificationId, String appId) throws ApiException { + ApiResponse localVarResp = exportEventsWithHttpInfo(notificationId, appId); + return localVarResp.getData(); } /** - * Stop Live Activity - * Stops a Live Activity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param subscriptionId Subscription ID (required) - * @return ApiResponse<Void> + * Export CSV of Events + * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) + * @return ApiResponse<ExportEventsSuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse endLiveActivityWithHttpInfo(String appId, String activityId, String subscriptionId) throws ApiException { - okhttp3.Call localVarCall = endLiveActivityValidateBeforeCall(appId, activityId, subscriptionId, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse exportEventsWithHttpInfo(String notificationId, String appId) throws ApiException { + okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Stop Live Activity (asynchronously) - * Stops a Live Activity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param subscriptionId Subscription ID (required) + * Export CSV of Events (asynchronously) + * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - + +
Status Code Description Response Headers
204 OK -
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call endLiveActivityAsync(String appId, String activityId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportEventsAsync(String notificationId, String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = endLiveActivityValidateBeforeCall(appId, activityId, subscriptionId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for exportEvents - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) + * Build call for exportSubscriptions + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2264,11 +2157,10 @@ public okhttp3.Call endLiveActivityAsync(String appId, String activityId, String Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportEventsCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2282,11 +2174,11 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = exportSubscriptionsRequestBody; // create path and map variables - String localVarPath = "/notifications/{notification_id}/export_events?app_id={app_id}" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); + String localVarPath = "/players/csv_export?app_id={app_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2295,11 +2187,7 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2310,84 +2198,77 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call exportEventsValidateBeforeCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling exportEvents(Async)"); - } + private okhttp3.Call exportSubscriptionsValidateBeforeCall(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling exportEvents(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling exportSubscriptions(Async)"); } - okhttp3.Call localVarCall = exportEventsCall(notificationId, appId, _callback); + okhttp3.Call localVarCall = exportSubscriptionsCall(appId, exportSubscriptionsRequestBody, _callback); return localVarCall; } /** - * Export CSV of Events - * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) - * @return ExportEventsSuccessResponse + * Export CSV of Subscriptions + * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) + * @return ExportSubscriptionsSuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ExportEventsSuccessResponse exportEvents(String notificationId, String appId) throws ApiException { - ApiResponse localVarResp = exportEventsWithHttpInfo(notificationId, appId); + public ExportSubscriptionsSuccessResponse exportSubscriptions(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody) throws ApiException { + ApiResponse localVarResp = exportSubscriptionsWithHttpInfo(appId, exportSubscriptionsRequestBody); return localVarResp.getData(); } /** - * Export CSV of Events - * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) - * @return ApiResponse<ExportEventsSuccessResponse> + * Export CSV of Subscriptions + * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) + * @return ApiResponse<ExportSubscriptionsSuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse exportEventsWithHttpInfo(String notificationId, String appId) throws ApiException { - okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse exportSubscriptionsWithHttpInfo(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody) throws ApiException { + okhttp3.Call localVarCall = exportSubscriptionsValidateBeforeCall(appId, exportSubscriptionsRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Export CSV of Events (asynchronously) - * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) + * Export CSV of Subscriptions (asynchronously) + * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -2396,21 +2277,21 @@ public ApiResponse exportEventsWithHttpInfo(String Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportEventsAsync(String notificationId, String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportSubscriptionsAsync(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = exportSubscriptionsValidateBeforeCall(appId, exportSubscriptionsRequestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for exportPlayers - * @param appId The app ID that you want to export devices from (required) - * @param exportPlayersRequestBody (optional) + * Build call for getAliases + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2419,10 +2300,11 @@ public okhttp3.Call exportEventsAsync(String notificationId, String appId, final Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportPlayersCall(String appId, ExportPlayersRequestBody exportPlayersRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2436,11 +2318,13 @@ public okhttp3.Call exportPlayersCall(String appId, ExportPlayersRequestBody exp basePath = null; } - Object localVarPostBody = exportPlayersRequestBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/players/csv_export?app_id={app_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2449,7 +2333,7 @@ public okhttp3.Call exportPlayersCall(String appId, ExportPlayersRequestBody exp Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2460,77 +2344,92 @@ public okhttp3.Call exportPlayersCall(String appId, ExportPlayersRequestBody exp } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call exportPlayersValidateBeforeCall(String appId, ExportPlayersRequestBody exportPlayersRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAliasesValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling exportPlayers(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getAliases(Async)"); + } + + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling getAliases(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling getAliases(Async)"); } - okhttp3.Call localVarCall = exportPlayersCall(appId, exportPlayersRequestBody, _callback); + okhttp3.Call localVarCall = getAliasesCall(appId, aliasLabel, aliasId, _callback); return localVarCall; } /** - * Export CSV of Players - * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - * @param appId The app ID that you want to export devices from (required) - * @param exportPlayersRequestBody (optional) - * @return ExportPlayersSuccessResponse + * + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ExportPlayersSuccessResponse exportPlayers(String appId, ExportPlayersRequestBody exportPlayersRequestBody) throws ApiException { - ApiResponse localVarResp = exportPlayersWithHttpInfo(appId, exportPlayersRequestBody); + public UserIdentityBody getAliases(String appId, String aliasLabel, String aliasId) throws ApiException { + ApiResponse localVarResp = getAliasesWithHttpInfo(appId, aliasLabel, aliasId); return localVarResp.getData(); } /** - * Export CSV of Players - * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - * @param appId The app ID that you want to export devices from (required) - * @param exportPlayersRequestBody (optional) - * @return ApiResponse<ExportPlayersSuccessResponse> + * + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse exportPlayersWithHttpInfo(String appId, ExportPlayersRequestBody exportPlayersRequestBody) throws ApiException { - okhttp3.Call localVarCall = exportPlayersValidateBeforeCall(appId, exportPlayersRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAliasesWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { + okhttp3.Call localVarCall = getAliasesValidateBeforeCall(appId, aliasLabel, aliasId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Export CSV of Players (asynchronously) - * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - * @param appId The app ID that you want to export devices from (required) - * @param exportPlayersRequestBody (optional) + * (asynchronously) + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -2539,18 +2438,19 @@ public ApiResponse exportPlayersWithHttpInfo(Strin Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportPlayersAsync(String appId, ExportPlayersRequestBody exportPlayersRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = exportPlayersValidateBeforeCall(appId, exportPlayersRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAliasesValidateBeforeCall(appId, aliasLabel, aliasId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for fetchAliases + * Build call for getAliasesBySubscription * @param appId (required) * @param subscriptionId (required) * @param _callback Callback for upload/download progress @@ -2561,9 +2461,10 @@ public okhttp3.Call exportPlayersAsync(String appId, ExportPlayersRequestBody ex Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - */ - public okhttp3.Call fetchAliasesCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2591,7 +2492,7 @@ public okhttp3.Call fetchAliasesCall(String appId, String subscriptionId, final Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2609,25 +2510,25 @@ public okhttp3.Call fetchAliasesCall(String appId, String subscriptionId, final localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call fetchAliasesValidateBeforeCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAliasesBySubscriptionValidateBeforeCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling fetchAliases(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getAliasesBySubscription(Async)"); } // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling fetchAliases(Async)"); + throw new ApiException("Missing the required parameter 'subscriptionId' when calling getAliasesBySubscription(Async)"); } - okhttp3.Call localVarCall = fetchAliasesCall(appId, subscriptionId, _callback); + okhttp3.Call localVarCall = getAliasesBySubscriptionCall(appId, subscriptionId, _callback); return localVarCall; } @@ -2637,17 +2538,18 @@ private okhttp3.Call fetchAliasesValidateBeforeCall(String appId, String subscri * Lists all Aliases for the User identified by :subscription_id. * @param appId (required) * @param subscriptionId (required) - * @return UserIdentityResponse + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
*/ - public UserIdentityResponse fetchAliases(String appId, String subscriptionId) throws ApiException { - ApiResponse localVarResp = fetchAliasesWithHttpInfo(appId, subscriptionId); + public UserIdentityBody getAliasesBySubscription(String appId, String subscriptionId) throws ApiException { + ApiResponse localVarResp = getAliasesBySubscriptionWithHttpInfo(appId, subscriptionId); return localVarResp.getData(); } @@ -2656,18 +2558,19 @@ public UserIdentityResponse fetchAliases(String appId, String subscriptionId) th * Lists all Aliases for the User identified by :subscription_id. * @param appId (required) * @param subscriptionId (required) - * @return ApiResponse<UserIdentityResponse> + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
*/ - public ApiResponse fetchAliasesWithHttpInfo(String appId, String subscriptionId) throws ApiException { - okhttp3.Call localVarCall = fetchAliasesValidateBeforeCall(appId, subscriptionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAliasesBySubscriptionWithHttpInfo(String appId, String subscriptionId) throws ApiException { + okhttp3.Call localVarCall = getAliasesBySubscriptionValidateBeforeCall(appId, subscriptionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2684,20 +2587,19 @@ public ApiResponse fetchAliasesWithHttpInfo(String appId, Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - */ - public okhttp3.Call fetchAliasesAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesBySubscriptionAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = fetchAliasesValidateBeforeCall(appId, subscriptionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAliasesBySubscriptionValidateBeforeCall(appId, subscriptionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for fetchUser - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * Build call for getApp + * @param appId An app id (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2709,7 +2611,7 @@ public okhttp3.Call fetchAliasesAsync(String appId, String subscriptionId, final 429 Rate Limit Exceeded - */ - public okhttp3.Call fetchUserCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2726,10 +2628,8 @@ public okhttp3.Call fetchUserCall(String appId, String aliasLabel, String aliasI Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + String localVarPath = "/apps/{app_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2738,7 +2638,7 @@ public okhttp3.Call fetchUserCall(String appId, String aliasLabel, String aliasI Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2756,41 +2656,29 @@ public okhttp3.Call fetchUserCall(String appId, String aliasLabel, String aliasI localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "user_auth_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call fetchUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAppValidateBeforeCall(String appId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling fetchUser(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling fetchUser(Async)"); - } - - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling fetchUser(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getApp(Async)"); } - okhttp3.Call localVarCall = fetchUserCall(appId, aliasLabel, aliasId, _callback); + okhttp3.Call localVarCall = getAppCall(appId, _callback); return localVarCall; } /** - * - * Returns the User’s properties, Aliases, and Subscriptions. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return User + * View an app + * View the details of a single OneSignal app + * @param appId An app id (required) + * @return App * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2800,18 +2688,16 @@ private okhttp3.Call fetchUserValidateBeforeCall(String appId, String aliasLabel
429 Rate Limit Exceeded -
*/ - public User fetchUser(String appId, String aliasLabel, String aliasId) throws ApiException { - ApiResponse localVarResp = fetchUserWithHttpInfo(appId, aliasLabel, aliasId); + public App getApp(String appId) throws ApiException { + ApiResponse localVarResp = getAppWithHttpInfo(appId); return localVarResp.getData(); } /** - * - * Returns the User’s properties, Aliases, and Subscriptions. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return ApiResponse<User> + * View an app + * View the details of a single OneSignal app + * @param appId An app id (required) + * @return ApiResponse<App> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2821,18 +2707,16 @@ public User fetchUser(String appId, String aliasLabel, String aliasId) throws Ap
429 Rate Limit Exceeded -
*/ - public ApiResponse fetchUserWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { - okhttp3.Call localVarCall = fetchUserValidateBeforeCall(appId, aliasLabel, aliasId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAppWithHttpInfo(String appId) throws ApiException { + okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Returns the User’s properties, Aliases, and Subscriptions. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * View an app (asynchronously) + * View the details of a single OneSignal app + * @param appId An app id (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -2844,18 +2728,15 @@ public ApiResponse fetchUserWithHttpInfo(String appId, String aliasLabel, 429 Rate Limit Exceeded - */ - public okhttp3.Call fetchUserAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAppAsync(String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = fetchUserValidateBeforeCall(appId, aliasLabel, aliasId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for fetchUserIdentity - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * Build call for getApps * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2867,7 +2748,7 @@ public okhttp3.Call fetchUserAsync(String appId, String aliasLabel, String alias 429 Rate Limit Exceeded - */ - public okhttp3.Call fetchUserIdentityCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2884,10 +2765,7 @@ public okhttp3.Call fetchUserIdentityCall(String appId, String aliasLabel, Strin Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + String localVarPath = "/apps"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2896,7 +2774,7 @@ public okhttp3.Call fetchUserIdentityCall(String appId, String aliasLabel, Strin Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2914,41 +2792,23 @@ public okhttp3.Call fetchUserIdentityCall(String appId, String aliasLabel, Strin localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "user_auth_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call fetchUserIdentityValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling fetchUserIdentity(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling fetchUserIdentity(Async)"); - } - - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling fetchUserIdentity(Async)"); - } + private okhttp3.Call getAppsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = fetchUserIdentityCall(appId, aliasLabel, aliasId, _callback); + okhttp3.Call localVarCall = getAppsCall(_callback); return localVarCall; } /** - * - * Lists all Aliases for the User identified by (:alias_label, :alias_id). - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return InlineResponse200 + * View apps + * View the details of all of your current OneSignal apps + * @return List<App> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2958,18 +2818,15 @@ private okhttp3.Call fetchUserIdentityValidateBeforeCall(String appId, String al
429 Rate Limit Exceeded -
*/ - public InlineResponse200 fetchUserIdentity(String appId, String aliasLabel, String aliasId) throws ApiException { - ApiResponse localVarResp = fetchUserIdentityWithHttpInfo(appId, aliasLabel, aliasId); + public List getApps() throws ApiException { + ApiResponse> localVarResp = getAppsWithHttpInfo(); return localVarResp.getData(); } /** - * - * Lists all Aliases for the User identified by (:alias_label, :alias_id). - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return ApiResponse<InlineResponse200> + * View apps + * View the details of all of your current OneSignal apps + * @return ApiResponse<List<App>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2979,18 +2836,15 @@ public InlineResponse200 fetchUserIdentity(String appId, String aliasLabel, Stri
429 Rate Limit Exceeded -
*/ - public ApiResponse fetchUserIdentityWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { - okhttp3.Call localVarCall = fetchUserIdentityValidateBeforeCall(appId, aliasLabel, aliasId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse> getAppsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAppsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Lists all Aliases for the User identified by (:alias_label, :alias_id). - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * View apps (asynchronously) + * View the details of all of your current OneSignal apps * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -3002,16 +2856,17 @@ public ApiResponse fetchUserIdentityWithHttpInfo(String appId 429 Rate Limit Exceeded - */ - public okhttp3.Call fetchUserIdentityAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAppsAsync(final ApiCallback> _callback) throws ApiException { - okhttp3.Call localVarCall = fetchUserIdentityValidateBeforeCall(appId, aliasLabel, aliasId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAppsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getApp - * @param appId An app id (required) + * Build call for getNotification + * @param appId (required) + * @param notificationId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3020,10 +2875,11 @@ public okhttp3.Call fetchUserIdentityAsync(String appId, String aliasLabel, Stri Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getNotificationCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3040,8 +2896,8 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/notifications/{notification_id}" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3050,7 +2906,11 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } final String[] localVarAccepts = { "application/json" @@ -3068,806 +2928,77 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "user_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAppValidateBeforeCall(String appId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getNotificationValidateBeforeCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getApp(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getNotification(Async)"); + } + + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling getNotification(Async)"); } - okhttp3.Call localVarCall = getAppCall(appId, _callback); + okhttp3.Call localVarCall = getNotificationCall(appId, notificationId, _callback); return localVarCall; } /** - * View an app - * View the details of a single OneSignal app - * @param appId An app id (required) - * @return App + * View notification + * View the details of a single notification and outcomes associated with it + * @param appId (required) + * @param notificationId (required) + * @return NotificationWithMeta * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public App getApp(String appId) throws ApiException { - ApiResponse localVarResp = getAppWithHttpInfo(appId); + public NotificationWithMeta getNotification(String appId, String notificationId) throws ApiException { + ApiResponse localVarResp = getNotificationWithHttpInfo(appId, notificationId); return localVarResp.getData(); } /** - * View an app - * View the details of a single OneSignal app - * @param appId An app id (required) - * @return ApiResponse<App> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public ApiResponse getAppWithHttpInfo(String appId) throws ApiException { - okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * View an app (asynchronously) - * View the details of a single OneSignal app - * @param appId An app id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getAppAsync(String appId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getApps - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apps"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "user_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAppsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getAppsCall(_callback); - return localVarCall; - - } - - /** - * View apps - * View the details of all of your current OneSignal apps - * @return List<App> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public List getApps() throws ApiException { - ApiResponse> localVarResp = getAppsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * View apps - * View the details of all of your current OneSignal apps - * @return ApiResponse<List<App>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public ApiResponse> getAppsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getAppsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * View apps (asynchronously) - * View the details of all of your current OneSignal apps - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getAppsAsync(final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = getAppsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getEligibleIams - * @param appId (required) - * @param subscriptionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getEligibleIamsCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/iams" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getEligibleIamsValidateBeforeCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getEligibleIams(Async)"); - } - - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling getEligibleIams(Async)"); - } - - - okhttp3.Call localVarCall = getEligibleIamsCall(appId, subscriptionId, _callback); - return localVarCall; - - } - - /** - * - * Manifest of In-App Messages the Subscription is eligible to display by the SDK. - * @param appId (required) - * @param subscriptionId (required) - * @return InlineResponse2003 - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public InlineResponse2003 getEligibleIams(String appId, String subscriptionId) throws ApiException { - ApiResponse localVarResp = getEligibleIamsWithHttpInfo(appId, subscriptionId); - return localVarResp.getData(); - } - - /** - * - * Manifest of In-App Messages the Subscription is eligible to display by the SDK. - * @param appId (required) - * @param subscriptionId (required) - * @return ApiResponse<InlineResponse2003> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public ApiResponse getEligibleIamsWithHttpInfo(String appId, String subscriptionId) throws ApiException { - okhttp3.Call localVarCall = getEligibleIamsValidateBeforeCall(appId, subscriptionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Manifest of In-App Messages the Subscription is eligible to display by the SDK. - * @param appId (required) - * @param subscriptionId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getEligibleIamsAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getEligibleIamsValidateBeforeCall(appId, subscriptionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getNotification - * @param appId (required) - * @param notificationId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getNotificationCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/notifications/{notification_id}" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getNotificationValidateBeforeCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getNotification(Async)"); - } - - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling getNotification(Async)"); - } - - - okhttp3.Call localVarCall = getNotificationCall(appId, notificationId, _callback); - return localVarCall; - - } - - /** - * View notification - * View the details of a single notification and outcomes associated with it - * @param appId (required) - * @param notificationId (required) - * @return NotificationWithMeta - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public NotificationWithMeta getNotification(String appId, String notificationId) throws ApiException { - ApiResponse localVarResp = getNotificationWithHttpInfo(appId, notificationId); - return localVarResp.getData(); - } - - /** - * View notification - * View the details of a single notification and outcomes associated with it - * @param appId (required) - * @param notificationId (required) - * @return ApiResponse<NotificationWithMeta> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public ApiResponse getNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { - okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * View notification (asynchronously) - * View the details of a single notification and outcomes associated with it - * @param appId (required) - * @param notificationId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getNotificationHistory - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationRequestBody (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotificationRequestBody getNotificationRequestBody, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = getNotificationRequestBody; - - // create path and map variables - String localVarPath = "/notifications/{notification_id}/history" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getNotificationHistoryValidateBeforeCall(String notificationId, GetNotificationRequestBody getNotificationRequestBody, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling getNotificationHistory(Async)"); - } - - // verify the required parameter 'getNotificationRequestBody' is set - if (getNotificationRequestBody == null) { - throw new ApiException("Missing the required parameter 'getNotificationRequestBody' when calling getNotificationHistory(Async)"); - } - - - okhttp3.Call localVarCall = getNotificationHistoryCall(notificationId, getNotificationRequestBody, _callback); - return localVarCall; - - } - - /** - * Notification History - * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationRequestBody (required) - * @return NotificationHistorySuccessResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public NotificationHistorySuccessResponse getNotificationHistory(String notificationId, GetNotificationRequestBody getNotificationRequestBody) throws ApiException { - ApiResponse localVarResp = getNotificationHistoryWithHttpInfo(notificationId, getNotificationRequestBody); - return localVarResp.getData(); - } - - /** - * Notification History - * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationRequestBody (required) - * @return ApiResponse<NotificationHistorySuccessResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public ApiResponse getNotificationHistoryWithHttpInfo(String notificationId, GetNotificationRequestBody getNotificationRequestBody) throws ApiException { - okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Notification History (asynchronously) - * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationRequestBody (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getNotificationHistoryAsync(String notificationId, GetNotificationRequestBody getNotificationRequestBody, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getNotifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset 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) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/notifications"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (kind != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("kind", kind)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getNotificationsValidateBeforeCall(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getNotifications(Async)"); - } - - - okhttp3.Call localVarCall = getNotificationsCall(appId, limit, offset, kind, _callback); - return localVarCall; - - } - - /** - * View notifications - * View the details of multiple notifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset 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) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) - * @return NotificationSlice - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public NotificationSlice getNotifications(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { - ApiResponse localVarResp = getNotificationsWithHttpInfo(appId, limit, offset, kind); - return localVarResp.getData(); - } - - /** - * View notifications - * View the details of multiple notifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset 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) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) - * @return ApiResponse<NotificationSlice> + * View notification + * View the details of a single notification and outcomes associated with it + * @param appId (required) + * @param notificationId (required) + * @return ApiResponse<NotificationWithMeta> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse getNotificationsWithHttpInfo(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { - okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { + okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View notifications (asynchronously) - * View the details of multiple notifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset 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) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * View notification (asynchronously) + * View the details of a single notification and outcomes associated with it + * @param appId (required) + * @param notificationId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -3876,24 +3007,21 @@ public ApiResponse getNotificationsWithHttpInfo(String appId, Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getNotificationsAsync(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getOutcomes - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames 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 (required) - * @param outcomeNames2 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) - * @param outcomeTimeRange 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) - * @param outcomePlatforms 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) - * @param outcomeAttribution 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) + * Build call for getNotificationHistory + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3902,10 +3030,11 @@ public okhttp3.Call getNotificationsAsync(String appId, Integer limit, Integer o Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3919,11 +3048,11 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = getNotificationHistoryRequestBody; // create path and map variables - String localVarPath = "/apps/{app_id}/outcomes" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/notifications/{notification_id}/history" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3932,27 +3061,7 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (outcomeNames != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); - } - - if (outcomeNames2 != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names[]", outcomeNames2)); - } - - if (outcomeTimeRange != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_time_range", outcomeTimeRange)); - } - - if (outcomePlatforms != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_platforms", outcomePlatforms)); - } - - if (outcomeAttribution != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_attribution", outcomeAttribution)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -3963,253 +3072,84 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou } final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getOutcomesValidateBeforeCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getOutcomes(Async)"); - } - - // verify the required parameter 'outcomeNames' is set - if (outcomeNames == null) { - throw new ApiException("Missing the required parameter 'outcomeNames' when calling getOutcomes(Async)"); - } - - - okhttp3.Call localVarCall = getOutcomesCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); - return localVarCall; - - } - - /** - * View Outcomes - * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames 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 (required) - * @param outcomeNames2 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) - * @param outcomeTimeRange 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) - * @param outcomePlatforms 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) - * @param outcomeAttribution 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) - * @return OutcomesData - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public OutcomesData getOutcomes(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { - ApiResponse localVarResp = getOutcomesWithHttpInfo(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution); - return localVarResp.getData(); - } - - /** - * View Outcomes - * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames 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 (required) - * @param outcomeNames2 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) - * @param outcomeTimeRange 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) - * @param outcomePlatforms 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) - * @param outcomeAttribution 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) - * @return ApiResponse<OutcomesData> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public ApiResponse getOutcomesWithHttpInfo(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { - okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * View Outcomes (asynchronously) - * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames 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 (required) - * @param outcomeNames2 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) - * @param outcomeTimeRange 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) - * @param outcomePlatforms 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) - * @param outcomeAttribution 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) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getOutcomesAsync(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getPlayer - * @param appId Your app_id for this device (required) - * @param playerId Player's OneSignal ID (required) - * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
- */ - public okhttp3.Call getPlayerCall(String appId, String playerId, String emailAuthHash, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/players/{player_id}" - .replaceAll("\\{" + "player_id" + "\\}", localVarApiClient.escapeString(playerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } - - if (emailAuthHash != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("email_auth_hash", emailAuthHash)); - } - - final String[] localVarAccepts = { "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getPlayerValidateBeforeCall(String appId, String playerId, String emailAuthHash, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getNotificationHistoryValidateBeforeCall(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getPlayer(Async)"); + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling getNotificationHistory(Async)"); } - // verify the required parameter 'playerId' is set - if (playerId == null) { - throw new ApiException("Missing the required parameter 'playerId' when calling getPlayer(Async)"); + // verify the required parameter 'getNotificationHistoryRequestBody' is set + if (getNotificationHistoryRequestBody == null) { + throw new ApiException("Missing the required parameter 'getNotificationHistoryRequestBody' when calling getNotificationHistory(Async)"); } - okhttp3.Call localVarCall = getPlayerCall(appId, playerId, emailAuthHash, _callback); + okhttp3.Call localVarCall = getNotificationHistoryCall(notificationId, getNotificationHistoryRequestBody, _callback); return localVarCall; } /** - * View device - * View the details of an existing device in one of your OneSignal apps - * @param appId Your app_id for this device (required) - * @param playerId Player's OneSignal ID (required) - * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) - * @return Player + * Notification History + * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (required) + * @return NotificationHistorySuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public Player getPlayer(String appId, String playerId, String emailAuthHash) throws ApiException { - ApiResponse localVarResp = getPlayerWithHttpInfo(appId, playerId, emailAuthHash); + public NotificationHistorySuccessResponse getNotificationHistory(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody) throws ApiException { + ApiResponse localVarResp = getNotificationHistoryWithHttpInfo(notificationId, getNotificationHistoryRequestBody); return localVarResp.getData(); } /** - * View device - * View the details of an existing device in one of your OneSignal apps - * @param appId Your app_id for this device (required) - * @param playerId Player's OneSignal ID (required) - * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) - * @return ApiResponse<Player> + * Notification History + * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (required) + * @return ApiResponse<NotificationHistorySuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse getPlayerWithHttpInfo(String appId, String playerId, String emailAuthHash) throws ApiException { - okhttp3.Call localVarCall = getPlayerValidateBeforeCall(appId, playerId, emailAuthHash, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getNotificationHistoryWithHttpInfo(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody) throws ApiException { + okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationHistoryRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View device (asynchronously) - * View the details of an existing device in one of your OneSignal apps - * @param appId Your app_id for this device (required) - * @param playerId Player's OneSignal ID (required) - * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * Notification History (asynchronously) + * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -4218,21 +3158,23 @@ public ApiResponse getPlayerWithHttpInfo(String appId, String playerId, Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getPlayerAsync(String appId, String playerId, String emailAuthHash, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getNotificationHistoryAsync(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPlayerValidateBeforeCall(appId, playerId, emailAuthHash, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationHistoryRequestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getPlayers - * @param appId The app ID that you want to view players from (required) - * @param limit How many devices to return. Max is 300. Default is 300 (optional) - * @param offset Result offset. Default is 0. Results are sorted by id; (optional) + * Build call for getNotifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset 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) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4244,7 +3186,7 @@ public okhttp3.Call getPlayerAsync(String appId, String playerId, String emailAu 429 Rate Limit Exceeded - */ - public okhttp3.Call getPlayersCall(String appId, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4261,7 +3203,7 @@ public okhttp3.Call getPlayersCall(String appId, Integer limit, Integer offset, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/players"; + String localVarPath = "/notifications"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4270,7 +3212,7 @@ public okhttp3.Call getPlayersCall(String appId, Integer limit, Integer offset, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4284,6 +3226,10 @@ public okhttp3.Call getPlayersCall(String appId, Integer limit, Integer offset, localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); } + if (kind != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("kind", kind)); + } + final String[] localVarAccepts = { "application/json" }; @@ -4300,31 +3246,32 @@ public okhttp3.Call getPlayersCall(String appId, Integer limit, Integer offset, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getPlayersValidateBeforeCall(String appId, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getNotificationsValidateBeforeCall(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling getPlayers(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getNotifications(Async)"); } - okhttp3.Call localVarCall = getPlayersCall(appId, limit, offset, _callback); + okhttp3.Call localVarCall = getNotificationsCall(appId, limit, offset, kind, _callback); return localVarCall; } /** - * View devices - * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - * @param appId The app ID that you want to view players from (required) - * @param limit How many devices to return. Max is 300. Default is 300 (optional) - * @param offset Result offset. Default is 0. Results are sorted by id; (optional) - * @return PlayerSlice + * View notifications + * View the details of multiple notifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset 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) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @return NotificationSlice * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4334,18 +3281,19 @@ private okhttp3.Call getPlayersValidateBeforeCall(String appId, Integer limit, I
429 Rate Limit Exceeded -
*/ - public PlayerSlice getPlayers(String appId, Integer limit, Integer offset) throws ApiException { - ApiResponse localVarResp = getPlayersWithHttpInfo(appId, limit, offset); + public NotificationSlice getNotifications(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { + ApiResponse localVarResp = getNotificationsWithHttpInfo(appId, limit, offset, kind); return localVarResp.getData(); } /** - * View devices - * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - * @param appId The app ID that you want to view players from (required) - * @param limit How many devices to return. Max is 300. Default is 300 (optional) - * @param offset Result offset. Default is 0. Results are sorted by id; (optional) - * @return ApiResponse<PlayerSlice> + * View notifications + * View the details of multiple notifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset 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) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @return ApiResponse<NotificationSlice> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4355,18 +3303,19 @@ public PlayerSlice getPlayers(String appId, Integer limit, Integer offset) throw
429 Rate Limit Exceeded -
*/ - public ApiResponse getPlayersWithHttpInfo(String appId, Integer limit, Integer offset) throws ApiException { - okhttp3.Call localVarCall = getPlayersValidateBeforeCall(appId, limit, offset, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getNotificationsWithHttpInfo(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { + okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View devices (asynchronously) - * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - * @param appId The app ID that you want to view players from (required) - * @param limit How many devices to return. Max is 300. Default is 300 (optional) - * @param offset Result offset. Default is 0. Results are sorted by id; (optional) + * View notifications (asynchronously) + * View the details of multiple notifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset 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) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -4378,19 +3327,21 @@ public ApiResponse getPlayersWithHttpInfo(String appId, Integer lim 429 Rate Limit Exceeded - */ - public okhttp3.Call getPlayersAsync(String appId, Integer limit, Integer offset, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getNotificationsAsync(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPlayersValidateBeforeCall(appId, limit, offset, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for identifyUserByAlias - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param userIdentityRequestBody (required) + * Build call for getOutcomes + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames 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 (required) + * @param outcomeNames2 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) + * @param outcomeTimeRange 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) + * @param outcomePlatforms 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) + * @param outcomeAttribution 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) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4399,11 +3350,10 @@ public okhttp3.Call getPlayersAsync(String appId, Integer limit, Integer offset, Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call identifyUserByAliasCall(String appId, String aliasLabel, String aliasId, UserIdentityRequestBody userIdentityRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4417,13 +3367,11 @@ public okhttp3.Call identifyUserByAliasCall(String appId, String aliasLabel, Str basePath = null; } - Object localVarPostBody = userIdentityRequestBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + String localVarPath = "/apps/{app_id}/outcomes" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4432,7 +3380,27 @@ public okhttp3.Call identifyUserByAliasCall(String appId, String aliasLabel, Str Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); + + if (outcomeNames != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); + } + + if (outcomeNames2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names[]", outcomeNames2)); + } + + if (outcomeTimeRange != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_time_range", outcomeTimeRange)); + } + + if (outcomePlatforms != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_platforms", outcomePlatforms)); + } + + if (outcomeAttribution != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_attribution", outcomeAttribution)); + } final String[] localVarAccepts = { "application/json" @@ -4443,100 +3411,94 @@ public okhttp3.Call identifyUserByAliasCall(String appId, String aliasLabel, Str } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call identifyUserByAliasValidateBeforeCall(String appId, String aliasLabel, String aliasId, UserIdentityRequestBody userIdentityRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getOutcomesValidateBeforeCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling identifyUserByAlias(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling identifyUserByAlias(Async)"); - } - - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling identifyUserByAlias(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getOutcomes(Async)"); } - // verify the required parameter 'userIdentityRequestBody' is set - if (userIdentityRequestBody == null) { - throw new ApiException("Missing the required parameter 'userIdentityRequestBody' when calling identifyUserByAlias(Async)"); + // verify the required parameter 'outcomeNames' is set + if (outcomeNames == null) { + throw new ApiException("Missing the required parameter 'outcomeNames' when calling getOutcomes(Async)"); } - okhttp3.Call localVarCall = identifyUserByAliasCall(appId, aliasLabel, aliasId, userIdentityRequestBody, _callback); + okhttp3.Call localVarCall = getOutcomesCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); return localVarCall; } /** - * - * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param userIdentityRequestBody (required) - * @return InlineResponse200 + * View Outcomes + * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames 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 (required) + * @param outcomeNames2 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) + * @param outcomeTimeRange 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) + * @param outcomePlatforms 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) + * @param outcomeAttribution 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) + * @return OutcomesData * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public InlineResponse200 identifyUserByAlias(String appId, String aliasLabel, String aliasId, UserIdentityRequestBody userIdentityRequestBody) throws ApiException { - ApiResponse localVarResp = identifyUserByAliasWithHttpInfo(appId, aliasLabel, aliasId, userIdentityRequestBody); + public OutcomesData getOutcomes(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { + ApiResponse localVarResp = getOutcomesWithHttpInfo(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution); return localVarResp.getData(); } /** - * - * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param userIdentityRequestBody (required) - * @return ApiResponse<InlineResponse200> + * View Outcomes + * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames 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 (required) + * @param outcomeNames2 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) + * @param outcomeTimeRange 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) + * @param outcomePlatforms 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) + * @param outcomeAttribution 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) + * @return ApiResponse<OutcomesData> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse identifyUserByAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, UserIdentityRequestBody userIdentityRequestBody) throws ApiException { - okhttp3.Call localVarCall = identifyUserByAliasValidateBeforeCall(appId, aliasLabel, aliasId, userIdentityRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getOutcomesWithHttpInfo(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { + okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param userIdentityRequestBody (required) + * View Outcomes (asynchronously) + * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames 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 (required) + * @param outcomeNames2 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) + * @param outcomeTimeRange 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) + * @param outcomePlatforms 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) + * @param outcomeAttribution 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) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -4545,35 +3507,33 @@ public ApiResponse identifyUserByAliasWithHttpInfo(String app Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call identifyUserByAliasAsync(String appId, String aliasLabel, String aliasId, UserIdentityRequestBody userIdentityRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getOutcomesAsync(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = identifyUserByAliasValidateBeforeCall(appId, aliasLabel, aliasId, userIdentityRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for identifyUserBySubscriptionId - * @param appId (required) - * @param subscriptionId (required) - * @param userIdentityRequestBody (required) + * Build call for getSegments + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + -
Status Code Description Response Headers
200 OK -
201 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call identifyUserBySubscriptionIdCall(String appId, String subscriptionId, UserIdentityRequestBody userIdentityRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4587,12 +3547,11 @@ public okhttp3.Call identifyUserBySubscriptionIdCall(String appId, String subscr basePath = null; } - Object localVarPostBody = userIdentityRequestBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/user/identity" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + String localVarPath = "/apps/{app_id}/segments" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4601,7 +3560,15 @@ public okhttp3.Call identifyUserBySubscriptionIdCall(String appId, String subscr Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } final String[] localVarAccepts = { "application/json" @@ -4612,116 +3579,103 @@ public okhttp3.Call identifyUserBySubscriptionIdCall(String appId, String subscr } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call identifyUserBySubscriptionIdValidateBeforeCall(String appId, String subscriptionId, UserIdentityRequestBody userIdentityRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getSegmentsValidateBeforeCall(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling identifyUserBySubscriptionId(Async)"); - } - - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling identifyUserBySubscriptionId(Async)"); - } - - // verify the required parameter 'userIdentityRequestBody' is set - if (userIdentityRequestBody == null) { - throw new ApiException("Missing the required parameter 'userIdentityRequestBody' when calling identifyUserBySubscriptionId(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getSegments(Async)"); } - okhttp3.Call localVarCall = identifyUserBySubscriptionIdCall(appId, subscriptionId, userIdentityRequestBody, _callback); + okhttp3.Call localVarCall = getSegmentsCall(appId, offset, limit, _callback); return localVarCall; } /** - * - * Upserts one or more Aliases for the User identified by :subscription_id. - * @param appId (required) - * @param subscriptionId (required) - * @param userIdentityRequestBody (required) - * @return UserIdentityResponse + * Get Segments + * Returns an array of segments from an app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (optional) + * @return GetSegmentsSuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + -
Status Code Description Response Headers
200 OK -
201 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public UserIdentityResponse identifyUserBySubscriptionId(String appId, String subscriptionId, UserIdentityRequestBody userIdentityRequestBody) throws ApiException { - ApiResponse localVarResp = identifyUserBySubscriptionIdWithHttpInfo(appId, subscriptionId, userIdentityRequestBody); + public GetSegmentsSuccessResponse getSegments(String appId, Integer offset, Integer limit) throws ApiException { + ApiResponse localVarResp = getSegmentsWithHttpInfo(appId, offset, limit); return localVarResp.getData(); } /** - * - * Upserts one or more Aliases for the User identified by :subscription_id. - * @param appId (required) - * @param subscriptionId (required) - * @param userIdentityRequestBody (required) - * @return ApiResponse<UserIdentityResponse> + * Get Segments + * Returns an array of segments from an app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (optional) + * @return ApiResponse<GetSegmentsSuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + -
Status Code Description Response Headers
200 OK -
201 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse identifyUserBySubscriptionIdWithHttpInfo(String appId, String subscriptionId, UserIdentityRequestBody userIdentityRequestBody) throws ApiException { - okhttp3.Call localVarCall = identifyUserBySubscriptionIdValidateBeforeCall(appId, subscriptionId, userIdentityRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getSegmentsWithHttpInfo(String appId, Integer offset, Integer limit) throws ApiException { + okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(appId, offset, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Upserts one or more Aliases for the User identified by :subscription_id. - * @param appId (required) - * @param subscriptionId (required) - * @param userIdentityRequestBody (required) + * Get Segments (asynchronously) + * Returns an array of segments from an app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - + -
Status Code Description Response Headers
200 OK -
201 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call identifyUserBySubscriptionIdAsync(String appId, String subscriptionId, UserIdentityRequestBody userIdentityRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSegmentsAsync(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = identifyUserBySubscriptionIdValidateBeforeCall(appId, subscriptionId, userIdentityRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(appId, offset, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for transferSubscription + * Build call for getUser * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) + * @param aliasLabel (required) + * @param aliasId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4730,11 +3684,11 @@ public okhttp3.Call identifyUserBySubscriptionIdAsync(String appId, String subsc Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4748,12 +3702,13 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId basePath = null; } - Object localVarPostBody = transferSubscriptionRequestBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/owner" + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4762,7 +3717,7 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -4773,92 +3728,92 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call transferSubscriptionValidateBeforeCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling transferSubscription(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getUser(Async)"); } - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling transferSubscription(Async)"); + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling getUser(Async)"); } - // verify the required parameter 'transferSubscriptionRequestBody' is set - if (transferSubscriptionRequestBody == null) { - throw new ApiException("Missing the required parameter 'transferSubscriptionRequestBody' when calling transferSubscription(Async)"); + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling getUser(Async)"); } - okhttp3.Call localVarCall = transferSubscriptionCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); + okhttp3.Call localVarCall = getUserCall(appId, aliasLabel, aliasId, _callback); return localVarCall; } /** * - * Transfers this Subscription to the User identified by the identity in the payload. + * Returns the User’s properties, Aliases, and Subscriptions. * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) - * @return UserIdentityResponse + * @param aliasLabel (required) + * @param aliasId (required) + * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public UserIdentityResponse transferSubscription(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { - ApiResponse localVarResp = transferSubscriptionWithHttpInfo(appId, subscriptionId, transferSubscriptionRequestBody); + public User getUser(String appId, String aliasLabel, String aliasId) throws ApiException { + ApiResponse localVarResp = getUserWithHttpInfo(appId, aliasLabel, aliasId); return localVarResp.getData(); } /** * - * Transfers this Subscription to the User identified by the identity in the payload. + * Returns the User’s properties, Aliases, and Subscriptions. * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) - * @return ApiResponse<UserIdentityResponse> + * @param aliasLabel (required) + * @param aliasId (required) + * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
404 Not Found -
429 Rate Limit Exceeded -
*/ - public ApiResponse transferSubscriptionWithHttpInfo(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { - okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getUserWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { + okhttp3.Call localVarCall = getUserValidateBeforeCall(appId, aliasLabel, aliasId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Transfers this Subscription to the User identified by the identity in the payload. + * Returns the User’s properties, Aliases, and Subscriptions. * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) + * @param aliasLabel (required) + * @param aliasId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -4867,21 +3822,22 @@ public ApiResponse transferSubscriptionWithHttpInfo(String Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call transferSubscriptionAsync(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getUserValidateBeforeCall(appId, aliasLabel, aliasId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateApp - * @param appId An app id (required) - * @param app (required) + * Build call for transferSubscription + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4890,10 +3846,12 @@ public okhttp3.Call transferSubscriptionAsync(String appId, String subscriptionI Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4907,11 +3865,12 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call basePath = null; } - Object localVarPostBody = app; + Object localVarPostBody = transferSubscriptionRequestBody; // create path and map variables - String localVarPath = "/apps/{app_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/owner" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4920,7 +3879,7 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -4938,75 +3897,87 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "user_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAppValidateBeforeCall(String appId, App app, final ApiCallback _callback) throws ApiException { + private okhttp3.Call transferSubscriptionValidateBeforeCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateApp(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling transferSubscription(Async)"); } - // verify the required parameter 'app' is set - if (app == null) { - throw new ApiException("Missing the required parameter 'app' when calling updateApp(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling transferSubscription(Async)"); + } + + // verify the required parameter 'transferSubscriptionRequestBody' is set + if (transferSubscriptionRequestBody == null) { + throw new ApiException("Missing the required parameter 'transferSubscriptionRequestBody' when calling transferSubscription(Async)"); } - okhttp3.Call localVarCall = updateAppCall(appId, app, _callback); + okhttp3.Call localVarCall = transferSubscriptionCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); return localVarCall; } /** - * Update an app - * Updates the name or configuration settings of an existing OneSignal app - * @param appId An app id (required) - * @param app (required) - * @return App + * + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (required) + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public App updateApp(String appId, App app) throws ApiException { - ApiResponse localVarResp = updateAppWithHttpInfo(appId, app); + public UserIdentityBody transferSubscription(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { + ApiResponse localVarResp = transferSubscriptionWithHttpInfo(appId, subscriptionId, transferSubscriptionRequestBody); return localVarResp.getData(); } /** - * Update an app - * Updates the name or configuration settings of an existing OneSignal app - * @param appId An app id (required) - * @param app (required) - * @return ApiResponse<App> + * + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (required) + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updateAppWithHttpInfo(String appId, App app) throws ApiException { - okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse transferSubscriptionWithHttpInfo(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { + okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update an app (asynchronously) - * Updates the name or configuration settings of an existing OneSignal app - * @param appId An app id (required) - * @param app (required) + * (asynchronously) + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -5015,33 +3986,35 @@ public ApiResponse updateAppWithHttpInfo(String appId, App app) throws ApiE Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call transferSubscriptionAsync(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateLiveActivity + * Build call for unsubscribeEmailWithToken * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 OK -
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateLiveActivityCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5055,12 +4028,12 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda basePath = null; } - Object localVarPostBody = updateLiveActivityRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/notifications" + String localVarPath = "/apps/{app_id}/notifications/{notification_id}/unsubscribe" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5069,7 +4042,11 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); + + if (token != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); + } final String[] localVarAccepts = { "application/json" @@ -5080,112 +4057,112 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateLiveActivityValidateBeforeCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call unsubscribeEmailWithTokenValidateBeforeCall(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updateLiveActivity(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling unsubscribeEmailWithToken(Async)"); } - // verify the required parameter 'activityId' is set - if (activityId == null) { - throw new ApiException("Missing the required parameter 'activityId' when calling updateLiveActivity(Async)"); + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling unsubscribeEmailWithToken(Async)"); } - // verify the required parameter 'updateLiveActivityRequest' is set - if (updateLiveActivityRequest == null) { - throw new ApiException("Missing the required parameter 'updateLiveActivityRequest' when calling updateLiveActivity(Async)"); + // verify the required parameter 'token' is set + if (token == null) { + throw new ApiException("Missing the required parameter 'token' when calling unsubscribeEmailWithToken(Async)"); } - okhttp3.Call localVarCall = updateLiveActivityCall(appId, activityId, updateLiveActivityRequest, _callback); + okhttp3.Call localVarCall = unsubscribeEmailWithTokenCall(appId, notificationId, token, _callback); return localVarCall; } /** - * Update a Live Activity via Push - * Updates a specified live activity. + * Unsubscribe with token + * Unsubscribe an email with a token when using your own custom email unsubscribe landing page * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) - * @return UpdateLiveActivitySuccessResponse + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @return GenericSuccessBoolResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK -
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public UpdateLiveActivitySuccessResponse updateLiveActivity(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { - ApiResponse localVarResp = updateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); + public GenericSuccessBoolResponse unsubscribeEmailWithToken(String appId, String notificationId, String token) throws ApiException { + ApiResponse localVarResp = unsubscribeEmailWithTokenWithHttpInfo(appId, notificationId, token); return localVarResp.getData(); } /** - * Update a Live Activity via Push - * Updates a specified live activity. + * Unsubscribe with token + * Unsubscribe an email with a token when using your own custom email unsubscribe landing page * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) - * @return ApiResponse<UpdateLiveActivitySuccessResponse> + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @return ApiResponse<GenericSuccessBoolResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK -
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public ApiResponse updateLiveActivityWithHttpInfo(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { - okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse unsubscribeEmailWithTokenWithHttpInfo(String appId, String notificationId, String token) throws ApiException { + okhttp3.Call localVarCall = unsubscribeEmailWithTokenValidateBeforeCall(appId, notificationId, token, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update a Live Activity via Push (asynchronously) - * Updates a specified live activity. + * Unsubscribe with token (asynchronously) + * Unsubscribe an email with a token when using your own custom email unsubscribe landing page * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
Status Code Description Response Headers
200 OK -
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call unsubscribeEmailWithTokenAsync(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = unsubscribeEmailWithTokenValidateBeforeCall(appId, notificationId, token, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updatePlayer - * @param playerId Player's OneSignal ID (required) - * @param player (required) + * Build call for updateApp + * @param appId An app id (required) + * @param app (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5194,11 +4171,10 @@ public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, Upd Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call updatePlayerCall(String playerId, Player player, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5212,11 +4188,11 @@ public okhttp3.Call updatePlayerCall(String playerId, Player player, final ApiCa basePath = null; } - Object localVarPostBody = player; + Object localVarPostBody = app; // create path and map variables - String localVarPath = "/players/{player_id}" - .replaceAll("\\{" + "player_id" + "\\}", localVarApiClient.escapeString(playerId.toString())); + String localVarPath = "/apps/{app_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5225,7 +4201,7 @@ public okhttp3.Call updatePlayerCall(String playerId, Player player, final ApiCa Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -5243,77 +4219,75 @@ public okhttp3.Call updatePlayerCall(String playerId, Player player, final ApiCa localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "user_auth_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePlayerValidateBeforeCall(String playerId, Player player, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateAppValidateBeforeCall(String appId, App app, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'playerId' is set - if (playerId == null) { - throw new ApiException("Missing the required parameter 'playerId' when calling updatePlayer(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateApp(Async)"); } - // verify the required parameter 'player' is set - if (player == null) { - throw new ApiException("Missing the required parameter 'player' when calling updatePlayer(Async)"); + // verify the required parameter 'app' is set + if (app == null) { + throw new ApiException("Missing the required parameter 'app' when calling updateApp(Async)"); } - okhttp3.Call localVarCall = updatePlayerCall(playerId, player, _callback); + okhttp3.Call localVarCall = updateAppCall(appId, app, _callback); return localVarCall; } /** - * Edit device - * Update an existing device in one of your OneSignal apps - * @param playerId Player's OneSignal ID (required) - * @param player (required) - * @return UpdatePlayerSuccessResponse + * Update an app + * Updates the name or configuration settings of an existing OneSignal app + * @param appId An app id (required) + * @param app (required) + * @return App * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public UpdatePlayerSuccessResponse updatePlayer(String playerId, Player player) throws ApiException { - ApiResponse localVarResp = updatePlayerWithHttpInfo(playerId, player); + public App updateApp(String appId, App app) throws ApiException { + ApiResponse localVarResp = updateAppWithHttpInfo(appId, app); return localVarResp.getData(); } /** - * Edit device - * Update an existing device in one of your OneSignal apps - * @param playerId Player's OneSignal ID (required) - * @param player (required) - * @return ApiResponse<UpdatePlayerSuccessResponse> + * Update an app + * Updates the name or configuration settings of an existing OneSignal app + * @param appId An app id (required) + * @param app (required) + * @return ApiResponse<App> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updatePlayerWithHttpInfo(String playerId, Player player) throws ApiException { - okhttp3.Call localVarCall = updatePlayerValidateBeforeCall(playerId, player, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateAppWithHttpInfo(String appId, App app) throws ApiException { + okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Edit device (asynchronously) - * Update an existing device in one of your OneSignal apps - * @param playerId Player's OneSignal ID (required) - * @param player (required) + * Update an app (asynchronously) + * Updates the name or configuration settings of an existing OneSignal app + * @param appId An app id (required) + * @param app (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -5322,22 +4296,21 @@ public ApiResponse updatePlayerWithHttpInfo(String Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call updatePlayerAsync(String playerId, Player player, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updatePlayerValidateBeforeCall(playerId, player, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updatePlayerTags - * @param appId The OneSignal App ID the user record is found under. (required) - * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param updatePlayerTagsRequestBody (optional) + * Build call for updateLiveActivity + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5346,11 +4319,10 @@ public okhttp3.Call updatePlayerAsync(String playerId, Player player, final ApiC Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call updatePlayerTagsCall(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateLiveActivityCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5364,12 +4336,12 @@ public okhttp3.Call updatePlayerTagsCall(String appId, String externalUserId, Up basePath = null; } - Object localVarPostBody = updatePlayerTagsRequestBody; + Object localVarPostBody = updateLiveActivityRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/users/{external_user_id}" + String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/notifications" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "external_user_id" + "\\}", localVarApiClient.escapeString(externalUserId.toString())); + .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5378,7 +4350,7 @@ public okhttp3.Call updatePlayerTagsCall(String appId, String externalUserId, Up Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -5396,80 +4368,83 @@ public okhttp3.Call updatePlayerTagsCall(String appId, String externalUserId, Up localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePlayerTagsValidateBeforeCall(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateLiveActivityValidateBeforeCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling updatePlayerTags(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateLiveActivity(Async)"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) { + throw new ApiException("Missing the required parameter 'activityId' when calling updateLiveActivity(Async)"); } - // verify the required parameter 'externalUserId' is set - if (externalUserId == null) { - throw new ApiException("Missing the required parameter 'externalUserId' when calling updatePlayerTags(Async)"); + // verify the required parameter 'updateLiveActivityRequest' is set + if (updateLiveActivityRequest == null) { + throw new ApiException("Missing the required parameter 'updateLiveActivityRequest' when calling updateLiveActivity(Async)"); } - okhttp3.Call localVarCall = updatePlayerTagsCall(appId, externalUserId, updatePlayerTagsRequestBody, _callback); + okhttp3.Call localVarCall = updateLiveActivityCall(appId, activityId, updateLiveActivityRequest, _callback); return localVarCall; } /** - * Edit tags with external user id - * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - * @param appId The OneSignal App ID the user record is found under. (required) - * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param updatePlayerTagsRequestBody (optional) - * @return UpdatePlayerTagsSuccessResponse + * Update a Live Activity via Push + * Updates a specified live activity. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) + * @return UpdateLiveActivitySuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public UpdatePlayerTagsSuccessResponse updatePlayerTags(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody) throws ApiException { - ApiResponse localVarResp = updatePlayerTagsWithHttpInfo(appId, externalUserId, updatePlayerTagsRequestBody); + public UpdateLiveActivitySuccessResponse updateLiveActivity(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { + ApiResponse localVarResp = updateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); return localVarResp.getData(); } /** - * Edit tags with external user id - * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - * @param appId The OneSignal App ID the user record is found under. (required) - * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param updatePlayerTagsRequestBody (optional) - * @return ApiResponse<UpdatePlayerTagsSuccessResponse> + * Update a Live Activity via Push + * Updates a specified live activity. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) + * @return ApiResponse<UpdateLiveActivitySuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updatePlayerTagsWithHttpInfo(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody) throws ApiException { - okhttp3.Call localVarCall = updatePlayerTagsValidateBeforeCall(appId, externalUserId, updatePlayerTagsRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateLiveActivityWithHttpInfo(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { + okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Edit tags with external user id (asynchronously) - * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - * @param appId The OneSignal App ID the user record is found under. (required) - * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param updatePlayerTagsRequestBody (optional) + * Update a Live Activity via Push (asynchronously) + * Updates a specified live activity. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -5478,14 +4453,13 @@ public ApiResponse updatePlayerTagsWithHttpInfo Status Code Description Response Headers 200 OK - 400 Bad Request - - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call updatePlayerTagsAsync(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updatePlayerTagsValidateBeforeCall(appId, externalUserId, updatePlayerTagsRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -5493,20 +4467,21 @@ public okhttp3.Call updatePlayerTagsAsync(String appId, String externalUserId, U * Build call for updateSubscription * @param appId (required) * @param subscriptionId (required) - * @param updateSubscriptionRequestBody (required) + * @param subscriptionBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - + +
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, UpdateSubscriptionRequestBody updateSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -5520,7 +4495,7 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, basePath = null; } - Object localVarPostBody = updateSubscriptionRequestBody; + Object localVarPostBody = subscriptionBody; // create path and map variables String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" @@ -5534,7 +4509,7 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -5552,12 +4527,12 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String subscriptionId, UpdateSubscriptionRequestBody updateSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { @@ -5569,13 +4544,13 @@ private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String s throw new ApiException("Missing the required parameter 'subscriptionId' when calling updateSubscription(Async)"); } - // verify the required parameter 'updateSubscriptionRequestBody' is set - if (updateSubscriptionRequestBody == null) { - throw new ApiException("Missing the required parameter 'updateSubscriptionRequestBody' when calling updateSubscription(Async)"); + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscription(Async)"); } - okhttp3.Call localVarCall = updateSubscriptionCall(appId, subscriptionId, updateSubscriptionRequestBody, _callback); + okhttp3.Call localVarCall = updateSubscriptionCall(appId, subscriptionId, subscriptionBody, _callback); return localVarCall; } @@ -5585,19 +4560,20 @@ private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String s * Updates an existing Subscription’s properties. * @param appId (required) * @param subscriptionId (required) - * @param updateSubscriptionRequestBody (required) + * @param subscriptionBody (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public void updateSubscription(String appId, String subscriptionId, UpdateSubscriptionRequestBody updateSubscriptionRequestBody) throws ApiException { - updateSubscriptionWithHttpInfo(appId, subscriptionId, updateSubscriptionRequestBody); + public void updateSubscription(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { + updateSubscriptionWithHttpInfo(appId, subscriptionId, subscriptionBody); } /** @@ -5605,20 +4581,21 @@ public void updateSubscription(String appId, String subscriptionId, UpdateSubscr * Updates an existing Subscription’s properties. * @param appId (required) * @param subscriptionId (required) - * @param updateSubscriptionRequestBody (required) + * @param subscriptionBody (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updateSubscriptionWithHttpInfo(String appId, String subscriptionId, UpdateSubscriptionRequestBody updateSubscriptionRequestBody) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, updateSubscriptionRequestBody, null); + public ApiResponse updateSubscriptionWithHttpInfo(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, null); return localVarApiClient.execute(localVarCall); } @@ -5627,22 +4604,23 @@ public ApiResponse updateSubscriptionWithHttpInfo(String appId, String sub * Updates an existing Subscription’s properties. * @param appId (required) * @param subscriptionId (required) - * @param updateSubscriptionRequestBody (required) + * @param subscriptionBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - + +
Status Code Description Response Headers
202 ACCEPTED -
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateSubscriptionAsync(String appId, String subscriptionId, UpdateSubscriptionRequestBody updateSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionAsync(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, updateSubscriptionRequestBody, _callback); + okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -5693,7 +4671,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=2.2.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.0.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -5711,7 +4689,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "app_key" }; + String[] localVarAuthNames = new String[] { "rest_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -5751,7 +4729,7 @@ private okhttp3.Call updateUserValidateBeforeCall(String appId, String aliasLabe * @param aliasLabel (required) * @param aliasId (required) * @param updateUserRequest (required) - * @return InlineResponse202 + * @return PropertiesBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -5762,8 +4740,8 @@ private okhttp3.Call updateUserValidateBeforeCall(String appId, String aliasLabe
429 Rate Limit Exceeded -
*/ - public InlineResponse202 updateUser(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { - ApiResponse localVarResp = updateUserWithHttpInfo(appId, aliasLabel, aliasId, updateUserRequest); + public PropertiesBody updateUser(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { + ApiResponse localVarResp = updateUserWithHttpInfo(appId, aliasLabel, aliasId, updateUserRequest); return localVarResp.getData(); } @@ -5774,7 +4752,7 @@ public InlineResponse202 updateUser(String appId, String aliasLabel, String alia * @param aliasLabel (required) * @param aliasId (required) * @param updateUserRequest (required) - * @return ApiResponse<InlineResponse202> + * @return ApiResponse<PropertiesBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -5785,9 +4763,9 @@ public InlineResponse202 updateUser(String appId, String aliasLabel, String alia
429 Rate Limit Exceeded -
*/ - public ApiResponse updateUserWithHttpInfo(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { + public ApiResponse updateUserWithHttpInfo(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -5810,10 +4788,10 @@ public ApiResponse updateUserWithHttpInfo(String appId, Strin 429 Rate Limit Exceeded - */ - public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java index d2b589bc..d384817f 100644 --- a/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java +++ b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/onesignal/client/auth/Authentication.java b/src/main/java/com/onesignal/client/auth/Authentication.java index 47a29107..9c1c650b 100644 --- a/src/main/java/com/onesignal/client/auth/Authentication.java +++ b/src/main/java/com/onesignal/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java index da657541..717ebcc3 100644 --- a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java +++ b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java index 99aaa6c4..990fd049 100644 --- a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java +++ b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java index 83b866a4..33f67523 100644 --- a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/onesignal/client/model/App.java b/src/main/java/com/onesignal/client/model/App.java index 4c96a259..4cd06895 100644 --- a/src/main/java/com/onesignal/client/model/App.java +++ b/src/main/java/com/onesignal/client/model/App.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * App */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class App { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/onesignal/client/model/BasicNotification.java b/src/main/java/com/onesignal/client/model/BasicNotification.java index b98c2ac6..c7a7510b 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotification.java +++ b/src/main/java/com/onesignal/client/model/BasicNotification.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 1.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,15 +23,18 @@ import com.onesignal.client.model.BasicNotificationAllOf; import com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout; import com.onesignal.client.model.Button; -import com.onesignal.client.model.Filter; +import com.onesignal.client.model.FilterExpression; +import com.onesignal.client.model.LanguageStringMap; import com.onesignal.client.model.NotificationTarget; -import com.onesignal.client.model.PlayerNotificationTargetIncludeAliases; -import com.onesignal.client.model.StringMap; +import com.onesignal.client.model.WebButton; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; import java.io.Serializable; @@ -58,7 +61,7 @@ /** * BasicNotification */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-25T19:31:57.613Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-30T16:05:16.972Z[Etc/UTC]") public class BasicNotification { private static final long serialVersionUID = 1L; @@ -70,13 +73,9 @@ public class BasicNotification { @SerializedName(SERIALIZED_NAME_EXCLUDED_SEGMENTS) private List excludedSegments = null; - public static final String SERIALIZED_NAME_INCLUDE_PLAYER_IDS = "include_player_ids"; - @SerializedName(SERIALIZED_NAME_INCLUDE_PLAYER_IDS) - private List includePlayerIds = null; - - public static final String SERIALIZED_NAME_INCLUDE_EXTERNAL_USER_IDS = "include_external_user_ids"; - @SerializedName(SERIALIZED_NAME_INCLUDE_EXTERNAL_USER_IDS) - private List includeExternalUserIds = null; + public static final String SERIALIZED_NAME_INCLUDE_SUBSCRIPTION_IDS = "include_subscription_ids"; + @SerializedName(SERIALIZED_NAME_INCLUDE_SUBSCRIPTION_IDS) + private List includeSubscriptionIds = null; public static final String SERIALIZED_NAME_INCLUDE_EMAIL_TOKENS = "include_email_tokens"; @SerializedName(SERIALIZED_NAME_INCLUDE_EMAIL_TOKENS) @@ -112,7 +111,7 @@ public class BasicNotification { public static final String SERIALIZED_NAME_INCLUDE_ALIASES = "include_aliases"; @SerializedName(SERIALIZED_NAME_INCLUDE_ALIASES) - private PlayerNotificationTargetIncludeAliases includeAliases; + private Map> includeAliases = null; /** * Gets or Sets targetChannel @@ -270,10 +269,6 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_IS_CHROME) private Boolean isChrome; - public static final String SERIALIZED_NAME_CHANNEL_FOR_EXTERNAL_USER_IDS = "channel_for_external_user_ids"; - @SerializedName(SERIALIZED_NAME_CHANNEL_FOR_EXTERNAL_USER_IDS) - private String channelForExternalUserIds; - public static final String SERIALIZED_NAME_APP_ID = "app_id"; @SerializedName(SERIALIZED_NAME_APP_ID) private String appId; @@ -288,15 +283,15 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_CONTENTS = "contents"; @SerializedName(SERIALIZED_NAME_CONTENTS) - private StringMap contents; + private LanguageStringMap contents; public static final String SERIALIZED_NAME_HEADINGS = "headings"; @SerializedName(SERIALIZED_NAME_HEADINGS) - private StringMap headings; + private LanguageStringMap headings; public static final String SERIALIZED_NAME_SUBTITLE = "subtitle"; @SerializedName(SERIALIZED_NAME_SUBTITLE) - private StringMap subtitle; + private LanguageStringMap subtitle; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -364,7 +359,7 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_WEB_BUTTONS = "web_buttons"; @SerializedName(SERIALIZED_NAME_WEB_BUTTONS) - private List