# Pushwoosh

> Send and cancel Pushwoosh push notifications, manage applications, tags, segments and campaigns, export segments, read message and application statistics, and follow new and sent messages.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/pushwoosh

## Actions

### Cancel message

Stop a scheduled message from sending. It stays in Message History as canceled.

**Inputs**

- Message code (`message`, text, required): The message code, which Send push notification returns.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "status_code": 1,
    "status_message": "example"
  }
}
```

### Create application

Create an application (project). Its platforms are set up in Pushwoosh afterwards.

**Inputs**

- Title (`title`, text, required): The application's name.
- Open to all API tokens (`authorize_all_tokens`, true/false): Let every API token on the account use it.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "application": "example"
  }
}
```

### Create campaign

Create a campaign to group messages for statistics.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Name (`name`, text, required): The campaign's name.
- Description (`description`, text): A description.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "campaign": "example"
  }
}
```

### Create segment

Create a segment from a Segmentation Language expression, such as T("City", eq, "Madrid").

**Inputs**

- Name (`name`, text, required): The segment's name.
- Conditions (`filter_expression`, text, required): The conditions, in Pushwoosh's Segmentation Language.
- Expires on (`expiration_date`, date): Delete the segment automatically on this day.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "name": "example"
  }
}
```

### Create tag

Create a tag, a piece of user data such as a plan or a city.

**Inputs**

- Name (`name`, text, required): The tag's name.
- Type (`type`, text, required): The kind of value it holds. One of: `1` (Integer), `2` (String), `3` (List), `4` (Date), `5` (Boolean), `6` (Decimal), `7` (Version).
- One value per user (`user_specific`, true/false): Keep one value per user, shared by all their devices, rather than one per device.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "name": "example",
    "result": true
  }
}
```

### Delete application

Delete an application and its subscribers.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {}
}
```

### Delete campaign

Delete a campaign.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Campaign (`campaign`, text, required): The campaign.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "status_code": 1,
    "status_message": "example"
  }
}
```

### Delete message

Delete a scheduled or sent message, and remove a scheduled one from Message History.

**Inputs**

- Message code (`message`, text, required): The message code, which Send push notification returns.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "status_code": 1,
    "status_message": "example"
  }
}
```

### Delete segment

Delete a segment by name.

**Inputs**

- Segment name (`name`, text, required): The segment's name.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {}
}
```

### Delete tag

Delete a tag and every value it holds.

**Inputs**

- Tag (`name`, text, required): The tag.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "result": true
  }
}
```

### Export segment

Start exporting the subscribers in a segment to a file. Get segment export returns its link.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Segment (`filter_code`, text): The segment to export.
- Conditions (`filter_expression`, text): Or conditions in Pushwoosh's Segmentation Language, such as A("XXXXX-XXXXX") for every subscriber.
- Export (`export_data`, list): What to export for each subscriber. Leave empty for the default columns. One or more of: `hwids` (Device IDs (HWIDs)), `push_tokens` (Push tokens), `users` (User IDs), `tags`, `location`, `ad_identifiers` (Ad identifiers).
- Tags (`tags`, list): Only these tags' values.
- Format (`format`, text): The file's format. Leave empty for CSV. One of: `csv`, `json_each_line` (JSON, one device per line).
- Include users without tokens (`include_without_tokens`, true/false): Include users without a push token.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "task_id": "example"
  }
}
```

### Get application

Get an application's title, the platforms it sends to and its subscribers' languages.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "icon_url": "example",
    "languages": {},
    "providers": {
      "android": true,
      "chrome": true,
      "email": true,
      "firefox": true,
      "ios": true,
      "safari": true,
      "sms": true
    },
    "title": "example"
  }
}
```

### Get message

Get a message's status, content and send time. A message sent now to fewer than 10 users isn't kept.

**Inputs**

- Message code (`message`, text, required): The message code or message ID.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "message": {
      "code": "example",
      "content": {},
      "created": "example",
      "data": {},
      "id": 1,
      "ignore_user_timezone": "example",
      "platforms": "example",
      "send_date": "example",
      "status": "example"
    }
  }
}
```

### Get segment export

Get a segment export's status, device count and file link once ready.

**Inputs**

- Task ID (`task_id`, text, required): The task ID Export segment returns.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "devicesCount": "example",
    "filename": "example",
    "status": "example"
  }
}
```

### Get statistics results

Get the results of a statistics request, once Pushwoosh has counted them.

**Inputs**

- Request ID (`request_id`, text, required): The request ID a statistics request returns.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "conversion": {},
    "formatter": "example",
    "rows": [
      {
        "action": "example",
        "count": 1,
        "datetime": "example"
      }
    ]
  }
}
```

### Get subscriber counts

Count an application's subscribers on each platform.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "AMAZON": 1,
    "ANDROID": 1,
    "FIREFOX": 1,
    "IOS": 1,
    "OSX": 1,
    "SAFARI": 1,
    "WINDOWS": 1
  }
}
```

### List applications

List the account's applications (projects) by code and title, 100 a page.

**Inputs**

- Page (`page`, number): The page to read. Leave empty for the first. At least 1.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "applications": [
      {
        "code": "example",
        "title": "example"
      }
    ],
    "page": 1,
    "total": 1
  }
}
```

### List campaigns

List an application's campaigns.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Campaigns to return (`limit`, number): How many to return. At least 1.
- Next page cursor (`cursor`, text): The cursor from the last page, to read the next page.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "campaigns": [
      {
        "code": "example",
        "description": "example",
        "name": "example"
      }
    ],
    "cursor": "example",
    "limit": 1
  }
}
```

### List messages

List an application's sent messages with their sends, deliveries and opens.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- From (`date_from`, date): Only messages created on or after this day. Leave both dates empty for the last 31 days.
- To (`date_to`, date): Only messages created on or before this day, at most 30 days after From.
- Campaign (`campaign`, text): Only messages in this campaign.
- Source (`source`, text): Only messages from this source. One of: `API`, `CP` (Control Panel), `AB_TEST` (A/B test), `AUTO_PUSH` (Auto push), `CSV` (CSV upload), `CUSTOMER_JOURNEY` (Customer Journey), `EMAIL_API` (Email API), `EMAIL_CP` (Email from the Control Panel), `GEO_ZONE` (Geozone), `PUSH_ON_EVENT` (Push on event), `RSS`.
- Message type (`message_type`, text): Only broadcast or only transactional messages. One of: `ALL`, `BROADCAST`, `TRANSACTIONAL`.
- Messages per page (`per_page`, number): How many to return, up to 499. Leave empty for 500. From 1 to 499.
- Page (`page`, number): The page to read, starting at 0. At least 0.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "code": "example",
        "created_date": "example",
        "id": 1,
        "platforms": [
          "example"
        ],
        "push_info": {
          "details": {
            "content": {},
            "filter_code": "example",
            "filter_name": "example",
            "title": "example"
          },
          "metrics": [
            {
              "deliveries": 1,
              "errors": 1,
              "opens": 1,
              "platform": 1,
              "sends": 1
            }
          ]
        },
        "send_date": "example",
        "source": "example",
        "status": "example"
      }
    ],
    "total": 1
  }
}
```

### List segments

List an application's segments (filters) with their conditions.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "filters": [
      {
        "application": "example",
        "code": "example",
        "expiration_date": "example",
        "filter_expression": "example",
        "name": "example"
      }
    ]
  }
}
```

### List tags

List the account's tags with their types.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "tags": [
      {
        "isUserSpecific": true,
        "name": "example",
        "type": 1
      }
    ]
  }
}
```

### Rename application

Change an application's title.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Title (`title`, text, required): The new title.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {}
}
```

### Request application statistics

Start counting an application's opens, installs, registrations and sends for a period. Get statistics results returns them.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- From (`date_from`, date and time, required): The start of the period.
- To (`date_to`, date and time, required): The end of the period.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "request_id": "example"
  }
}
```

### Request campaign statistics

Start counting a campaign's sends and opens for a period. Get statistics results returns them.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Campaign (`campaign`, text, required): The campaign.
- From (`date_from`, date and time, required): The start of the period.
- To (`date_to`, date and time, required): The end of the period.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "request_id": "example"
  }
}
```

### Send push notification

Send a push notification to chosen users, devices or a segment, now or at a set time.

**Inputs**

- Application (`application`, text, required): The Pushwoosh project (application).
- Message (`content`, text, required): The notification's text.
- Title (`title`, text): The notification's title.
- User IDs (`users`, list): User IDs to send to, up to 1,000.
- Devices (`devices`, list): Device IDs (HWIDs) or push tokens to send to, up to 1,000.
- Segment (`filter`, text): A segment to send to.
- Send to everyone (`everyone`, true/false): Send to every subscriber of the application. Leave off to send only to the users, devices or segment chosen.
- Platforms (`platforms`, list): Only these platforms. Leave empty for all of them. One or more of: `1` (iOS), `3` (Android), `7` (macOS), `8` (Windows), `9` (Amazon), `10` (Safari), `11` (Chrome), `12` (Firefox), `17` (Huawei).
- Send at (`send_at`, date and time): When to send. Leave empty to send now.
- Same moment everywhere (`ignore_user_timezone`, true/false): Send at that moment everywhere. Turn off to send at that time in each user's time zone.
- Link (`link`, text): A web page or deep link to open when it's tapped.
- Custom data (`data`, object): Custom data for your app, by name.
- Campaign (`campaign`, text): A campaign to file the message under, for statistics.
- Preset code (`preset`, text): A push preset's code, whose settings fill in the rest.
- Message type (`message_type`, text): Transactional messages skip silent hours, frequency capping and control groups. Leave empty for marketing. One of: `marketing`, `transactional` (Transactional (skips silent hours and control groups)).
- Message name (`campaign_name`, text): A name for the message in Message History.

**Outputs**

- `data` (object): The response from Pushwoosh.

**Example output**

```json
{
  "data": {
    "message_code": "example",
    "message_codes": [
      "example"
    ]
  }
}
```
