Launch Single Web Pushes v2

Prev Next

Insider One's Web Push API allows you to launch Single Web Push notifications from your back-end without using the InOne panel.

The Web Push API v2 differs from the Web Push API v1 in two ways: its rate limit is 6000 requests per minute, and its endpoint includes the v2 version.

Endpoint and Headers

POST https://web-push.api.useinsider.com/v2/single/campaign_id

Visit our Postman collection to test this request.

Headers

HeaderSample ValueDescription
AuthorizationBearer 1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token.
Content-Typeapplication/jsonThis header specifies the media type of the resource.

Body Parameters

Each request body requires a partner ID and a title. 

ParameterDescriptionData TypeRequired
partner_idThis is your partner identification number, which is available from Inone Settings > Account Settings.StringYes
titleEvery request creates a push notification campaign on InOne with the push type Single Push. This is the title of the push content. It cannot be more than 100 characters.StringYes
descriptionThis is the body of your push notification. It cannot be more than 255 characters. If it is a rich push that has a banner, it is limited to 30 characters.StringYes
imageThis is the push notification icon. Only HTTPS protocols are accepted. If not provided, the default icon is used instead.StringYes
bannerThis is the rich push notification image. Only HTTPS protocols are accepted.StringNo
linkThe link of the Web push message.StringYes
include_unengagedEnables you to decide whether the bulk push should target unengaged tokens. When not sent in the payload, unengaged users are automatically excluded.Boolean (true/false)No
ttlTTL stands for time to live. It is the maximum time the system will try to send a push notification to an offline or temporarily unavailable user. TTL is limited to 240 hours.StringYes
targetTargeting options for the campaign (segmenting).ObjectYes if is_all: false
     attributeThe attribute used for targeting, e.g., "d_wp_browser".StringYes, if the target is used.
     valuesAn array of values to target, e.g,. ["Edg"]ArrayYes, if the target is used.

Sample Request

  • If you want to use default attributes, you must follow the format:

d_Default_attribute_name

  • If you want to use custom attributes, you must follow the format:

c_Custom_attribute_name

You can refer to the Default Attributes documentation for a full list of available default fields.

Before sending the request, make sure to:

  • Replace the authorization value with your API key.
  • Add your partner ID in partner_id.
  • Add your campaign name to the title.
When you send a Create a Single Web Push request, you will receive a campaign_id in the response. You use this campaign_id to launch your Single Web Push campaign.

The sample below displays a request to launch a Single Web Push campaign without segments: is_all: true.

curl --location --request POST 'https://web-push.api.useinsider.com/v2/single/campaign_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1a2b3c4d5e6f' \
--data-raw '{
  "partner_id": "100000001",
  "title": "title of push",
  "description": "description of push",
  "image": "https://image.useinsider.com/mywebsite/webPushDefaultImage/JpVu9aBXgTXmcrBkiZLB1512577074.jpeg",
  "banner": "https://image.useinsider.com/mywebsite/webPushDefaultImage/JpVu9aBXgTXmcrBkiZLB1512577074.jpeg",
  "link": "https://image.useinsider.com",
  "include_unengage": true,
  "ttl": "1000"
}'

The sample below displays a request to launch a Single Web Push campaign with segments: is_all: false.

curl --location --request POST 'https://web-push.api.useinsider.com/v2/single/campaign_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1a2b3c4d5e6f' \
--data-raw '{
  "partner_id": "10000001",
  "title": "title of push",
  "description": "description of push",
  "image": "https://image.useinsider.com/mywebsite/webPushDefaultImage/JpVu9aBXgTXmcrBkiZLB1512577074.jpeg",
  "banner": "https://image.useinsider.com/mywebsite/webPushDefaultImage/JpVu9aBXgTXmcrBkiZLB1512577074.jpeg",
  "link": "https://image.useinsider.com",
  "include_unengage": true,
  "ttl": "1000",
  "language": "en_US",
  "target": {
    "attribute": "d_wp_browser",
    "values": ["Edg"]
  }
}'

Sample Responses

200 OK

You can see this kind of response when you successfully launch your campaign.

{
  "success": true,
  "campaign_id": 1697300275
}

401 Unauthorized

{
"message": "Unauthorized"
}

424 Failed Dependency

{
  "message": "SERVICE:-"
}

Error Codes

  • 400 Bad Request
  • 401 Unauthorized Request
  • 424 Failed Dependency
  • 429 Request limit exceeded

Limitations

  • All functions must be executed with an HTTPS POST request.
  • The API key should be provided as the authorization key in the request header. If the key is incorrect, the operation will not be executed, and an authorization error will return in the response.
  • The rate limit is 6000 requests per minute.

The default limit shown here is a standard baseline. If your use case requires higher capacity, feel free to reach out to the Insider One team — we can adjust it to fit your needs.