OneSignal provides a RESTful API based on the REST architecture.
OneSignal uses a REST API.
Yes, the official OneSignal API does have webhooks. Here are the key points about OneSignal's webhook capabilities:
OneSignal offers Event Webhooks that allow you to stream data out of OneSignal to your chosen destination in real-time. This feature enables you to:
You can subscribe to various types of events through OneSignal's webhooks. While the search results don't provide an exhaustive list, they mention that you can select multiple events to trigger a webhook. These events can be related to different channels (e.g., push notifications, email, SMS) and can be sent through the same webhook or configured separately for more granular control.
To set up a webhook in OneSignal:
OneSignal allows you to personalize all fields in your webhook using information about the user and the message that triggered it. This provides flexibility for various use cases.
OneSignal has a retry mechanism for failed webhook requests and will disable webhooks if there's a high failure rate (300 failures in 5 minutes).
For more advanced use cases, OneSignal offers Journey Webhooks (available for annual plans) that allow you to add custom webhook steps to your customer journeys. These webhooks offer more configuration options and can be personalized based on user information.
In summary, OneSignal's webhook support provides a powerful way to integrate your messaging workflows with other systems and automate actions based on various events in your customer engagement process.
Here are the key points about the API Rate Limits for the OneSignal API:
Create notification endpoint:
Updating Users/Subscriptions and Delete Users endpoints:
View notifications, templates, users, and individual notifications:
Notification History:
It's important to note that these rate limits are designed as safety measures and should not affect normal usage of the OneSignal platform.
Based on the search results provided, here are the key points regarding the most recent version of the OneSignal API:
The search results do not provide a specific version number for the OneSignal API itself. Instead, they focus on the SDK versions for different platforms.
The most recent updates appear to be for the Android and iOS SDKs, with Android at 5.1.6 and iOS at 5.1.3.
These recent updates include bug fixes, performance improvements, and new features across various platforms.
Some of the recent changes include:
There have been some API changes, such as the Push Subscription observer now passing nullable properties.
It is recommended to update to the latest SDK versions listed or higher if available.
When implementing the OneSignal SDK, be sure to check the specific documentation for your platform, as there may be platform-specific changes or features.
Keep an eye on deprecated methods and update your code accordingly to use the new recommended methods.
When using the Push Subscription API, account for the possibility of null values for token and ID properties.
To get a developer account for OneSignal and create an API integration, follow these steps:
Visit the OneSignal website (https://onesignal.com) and sign up for an account using your email address.
After signing up, you'll be able to create a OneSignal App. This App will house relevant messaging data for your mobile and web applications, such as user data, message data, and custom application configurations.
Once you've created an App, you'll need to generate API keys to use for authentication when making API requests. Here's how to do it:
You'll find two important keys here:
Depending on your preferred programming language, you may want to use one of OneSignal's client SDKs. They offer SDKs for various languages including Go, Java, .NET, Node, PHP, Python, Ruby, and Rust.
With your API keys and development environment set up, you can now start making API requests. Here's a basic example using Node.js:
const https = require('https'); const options = { hostname: 'onesignal.com', path: '/api/v1/notifications', method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Basic YOUR_REST_API_KEY' } }; const data = JSON.stringify({ app_id: 'YOUR_APP_ID', contents: {'en': 'Your notification message'}, included_segments: ['All'] }); const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.write(data); req.end();
Remember to replace 'YOUR_REST_API_KEY' and 'YOUR_APP_ID' with your actual REST API Key and App ID.
Based on the search results provided, here is a list of data models that can be interacted with using the OneSignal API, along with what is possible for each:
This list covers the main data models that can be interacted with using the OneSignal API. Each model offers various possibilities for creating, updating, retrieving, and managing data related to user engagement and messaging across multiple channels.