Create Single Web Pushes
- 30 Jan 2024
- 1 Minute to read
Create Single Web Pushes
- Updated on 30 Jan 2024
- 1 Minute to read
Article Summary
Share feedback
Thanks for sharing your feedback!
Overview
Insider's web push API allows you to send single web push notifications from your own back-end without using Inone (Insider's panel).
Endpoint and Headers
Headers
Header | Sample Value | Description |
---|---|---|
Authorization | Bearer 1a2b3c4d5e6f | This key is required to authorize your request. Refer to API Authentication Tokens to generate your token. |
Content-Type | application/json | This header specifies the media type of the resource. |
Body Parameters
Each request body requires a partner ID and a title.
Parameter | Description | Data Type | Required |
---|---|---|---|
partner_id | This is your partner identification number, available from InOne Settings > Account Preferences. | String | Yes |
title | Every request creates a push notification campaign on InOne with the push type Single Push. This is the title of the campaign. It cannot be more than 100 characters. | String | Yes |
language | The language of the campaign, e.g., en_US. If you want to send the push to all languages, you can write “all_ALL”. | String | Yes |
is_all | It helps you set when you want to send push notifications to all subscribers or segmented subscribers. If you type true, it will be sent only once, and you can open the campaign in the InOne Panel. If you type false, it will be sent multiple times, but you cannot open the campaign in the InOne Panel. | Boolean | No |
Sample Example
Before sending the request, make sure:
- To replace the authorization value with your own API key.
- To add your partner ID in partner_id.
- To add your campaign name in title.
Your title goes here
When you send the request, you will get your campaign_id as a response. You will use this campaign_id when launching the campaign.
Sample Request
curl --location --request POST 'https://web-push.api.useinsider.com/v1/single' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1a2b3c4d5e6f' \
--data-raw '{
"partner_id": "100XXXXX",
"title": "Title of campaign",
"language": "tr_TR",
"is_all": false
}'
Sample Responses
201 Created
You can see this kind of response when you successfully created your campaign.
{
"success": true,
"campaign_id": 25696
}
You can also see your campaign in your InOne panel on the Web Push listing page as in Draft status, indicating that the campaign has been created but not launched yet.
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 create requests must be executed with an HTTPS POST request.
- The API key should be provided as the authorization key on 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 30 requests per minute second.
Was this article helpful?