How To Use the OneSignal API to Add Push Notifications to your App

We’re back with 12 Days of APIs! Today, we’re profiling One Signal’s push notification API with some help from co-founder and CEO George Deglin. Read on for more info or jump straight to the package page to start making calls!

What does the OneSignal API do?

The OneSignal API is all about push notifications. For the uninitiated, push notifications are short messages that pop up on a mobile device or desktop, even if the user is not logged into the app in question. For example, here’s what a push notification looks like on an iPhone.

Push notifications are pretty darn universal in this day and age. One Signal cites one study that reports that the average person receives 63.5 push notifications on mobile per day (and that was in 2014!).

If you’re building a web or mobile app, you’ll probably want push notification functionality. With the OneSignal API, you can add custom push notifications to the following devices:

Why we ❤️ the OneSignal API

Our favorite thing about the OneSignal API is that it’s 100% free.

There aren’t any limits on calls, notifications, devices or integrations. They also give you full access to push notification analytics so you can A/B test them.

So, how do they make money, you ask? Good question. They make money by offering custom solutions to enterprise customers and from aggregating and selling data.

Use cases for the OneSignal API

Add push notifications to your app

George explained to us that the most common use cases for the API are adding customizable push notifications to your website, app or service. The API gives developers control over notification scheduling, personalization and design. You can A/B test design or different scheduled times so your notifications are optimized for best performance.

While OneSignal has some big name companies that use their API (like a little car rental company called Uber), George highlighted OneSignal’s integration with ProductHunt.

ProductHunt uses OneSignal’s API to send marketing notifications. For example, when a product receives comments, people in that thread are notified through the OneSignal API.

Link OneSignal to other services

Not all OneSignal’s use cases are user-facing, however. George also gave an example of developers using the OneSignal API to optimize their workflow. For example, the OneSignal API can be used to notify you when a blog post is published or if someone creates a pull request on your repo. Basically, if there’s anything you wish had a push notification, you can make one with OneSignal.

How to call the OneSignal API

Ok, we’ve talked a lot about the OneSignal API. Here’s how you actually call it.

  1. First, you’ll need to head over to OneSignal and register for an account.
  2. After you create an account, go to RapidAPI’s OneSignal package page to make an API call from your browser.
  3. Fill in the userKey, appKey and appId from the OneSignal website. We made some GIFs below so that you could see where (note: we did not display the actual API keys for security purposes).

You’ll find the userKey and appKey above your profile picture in the “Accounts & API keys” tab.

You can find the appId from the “Keys & IDs” tab on the App Settings page of your app.

4. On the RapidAPI package page, pick your endpoint and fill in the parameters to make a call.

Once you’ve made a call successfully, you can export the code used to call the API into your script. Just pick your language of choice and copy the code directly into your app. If you’re calling multiple APIs, you can call them from a single RapidAPI endpoint. Go ahead and try it yourself here!

OneSignal Pricing

How much does it cost to use the OneSignal API? It’s 100% Free!

Behind the scenes of the OneSignal API

We couldn’t leave our interview with George without getting more insight into the OneSignal API–it’s got some pretty impressive stats. According to George, the OneSignal API…

  • Handles 400K+ API requests per minute (and at peak times, handles 10K requests per second)
  • Sends notifications to over 1B devices
  • Is in use by over 100K developers

That’s one heavy duty API. Our reaction was something like this…

George said that the API was written in Ruby and they focused on building scalability into the design. They’re full stack includes Ruby, Rails, Rspec, Coffeescript, PostgreSQL, and Redis.

See more: OneSignal Documentation

Need more side project ideas? There’s still more API profiles!

We’ve still got a few more days of our #12DaysOfAPIs profiles! Follow along on our blog, Facebook or Twitter (@Rapid_API) to make sure you don’t miss a single one. In the meantime, you can read our profiles on…

Whew! Let us know if you build anything cool in the comments below.

4.8/5 - (161 votes)
Share
Published by

Recent Posts

Power Up Your Enterprise Hub: New March Release Boosts Admin Capabilities and Streamlines Integrations

We're thrilled to announce the latest update to the Rapid Enterprise API Hub (version 2024.3)!…

3 weeks ago

Unveiling User Intent: How Search Term Insights Can Empower Your Enterprise API Hub

Are you curious about what your API consumers are searching for? Is your Hub effectively…

3 weeks ago

Rapid Enterprise API Hub Levels Up Custom Branding, Monetization, and Management in February Release

The RapidAPI team is excited to announce the February 2024 update (version 2024.2) for the…

1 month ago

Supercharge Your Enterprise Hub with January’s Release: Search Insights, Login Flexibility, and More!

This January's release brings exciting features and improvements designed to empower you and your developers.…

3 months ago

Enhanced Functionality and Improved User Experience with the Rapid API Enterprise Hub November 2023 Release

Rapid API is committed to providing its users with the best possible experience, and the…

5 months ago

The Power of Supporting Multiple API Gateways in an API Marketplace Platform

In today's fast-paced digital world, APIs (Application Programming Interfaces) have become the backbone of modern…

6 months ago