Introducing the Layer Platform API: build rich application-to-user messaging

Every app is a communications app. Whether it’s connecting two people in a marketplace, an on-demand service, a shared interest community, or a dating app, user-to-user communications is an integral layer of functionality. Layer already provides this with client-side SDKs for mobile and web (sign up for web early access).

But sometimes as a developer, you need special control over the communications within an app. There comes a time when you need to add participants to a conversation (customer support), create a conversation on behalf of two users who do not know each other (dating app), or act in an administrative function to block certain users (shared interest community). You and your application need to be in control. That’s where the Platform API comes in. It unlocks all of the functionality you would expect to enable control from your backend application, and adds support for your backend to send application-to-user messages. This opens up entirely new possibilities to broadcast updates to your users and enables service integrations, injecting content feeds, or offering rich in-line content.

Announcements: a new way to notify your users


Fig 1. Surge pricing.

Application-to-user messaging comes in two flavors. The first is akin to a targeted notification. You may want to broadcast an update about surge pricing to select users in a geographic area, let someone know that they have a new follower, or that there’s a new deal based on their shopping preferences. You could use SMS for this, but you’d need the user’s phone number, the communication appears to the user to come from an anonymous source, and lands among the noise of a user’s already-busy text message inbox. Push notifications are better, but they are best-effort delivery and you don’t get in-depth analytics on receipt or open rate. With Announcements, you can send a persistent message to users that can be optionally accompanied by a push notification. It can also be silently synchronized among the user’s devices, to power an activity feed for example.

There are major benefits to message persistence, searchability, and receipt analytics. Announcements will work even when users have disabled notifications, or if they have uninstalled the app. You can tell what the exact delivery status is (e.g. sent, delivered, read), and which people have read the message. When your users log back in, you can display a stream of updates, or let them know how many activity items they missed since their last visit.

These capabilities provide you complete control to create the exact experience you want for your users. Bring the conversation into your app and re-engage your users with Announcements in ways that SMS or plain push notifications just can’t provide.

Send system messages into conversations


Fig 2. Score update in group chat.

The second form of application-to-user messaging is a scenario many of us are familiar with: integrated services that interact right in the flow of conversation. Anyone who uses Slack or HipChat has probably set up a number of 3rd party integrations with services such as Twitter, Github, or Trello. When changes occur in these services, they broadcast updates directly into the appropriate channels in your messaging interface. With System Messages, anyone is able to build this rich functionality. Your backend application can relay 3rd party service updates, usually from a third-party Webhook, directly into the relevant conversational UI of your users.

For logistics and on-demand applications, where there are many different parties involved and frequent status updates about an order, all of the application-originated messages can be injected into a single in-app conversation across mobile devices and browsers. When the user has been matched with a shopper, or they need to change an order, or the order is out for delivery, all of this can be tracked in a single message thread. Accompany it with optional push notifications to keep everyone informed about the updates of the progress of the transaction. This means maps, order cards, chat, questions, and receipts can all be integrated together, and accompanied by notifications. All of the conversation flowing through the app also removes privacy concerns around personal identity and phone numbers. SMS quickly becomes second class to a consolidated, media-rich, in-app conversation.

This context is ultimately what makes a communications experience rich. Imagine a set of basketball fans discussing the NBA finals. One person in the chat may be watching at home with friends, another at the bar, and yet another is on the subway without access to a video stream. The three of them may already have a group chat going as their play-by-play commentary about what’s happening. However this conversation is missing one key thing: shared context. Now with System Messages, the basketball application can inject the score updates and notable events directly into the stream of conversation. For the member on the subway, she now has access to what’s going on without having to follow multiple sources of information at once; it’s all there in the conversation. The content and communications are integrated into a single place, and the experience for each person is made all the more relevant.

Create and edit conversations from your backend


Fig 3. Start a new chat between matched users.

Let’s say you’re building a dating app, and a match was just made between two of your users. These two don’t know each other, and need to be connected in a conversation so the magic can happen. Using the Platform API, your backend application can create a conversation and invite the two of them to join. This allows you to set your own metadata on the conversation, and determine when to begin the conversation (e.g. optional time delay). On top of all this, with a System Message you could include an ice breaker question or prompt into the newly created conversation to trigger immediate engagement. In the future, this will also allow you to delete the conversation (e.g. a 24 hour window of opportunity). Application-controlled conversation creation also allows you to build invite mechanisms, automatic removal of inactive users, or automatically adding new users to a conversation upon sign-up.

Your backend is in control of Layer


Fig 4. Block users based on community feedback.

The last important piece of functionality the Platform API opens up is control over your application, and eventually your Layer account, via REST. A common implementation of this might involve allowing users to flag each other as inappropriate, and when enough flags are accumulated on a user, to invoke a block policy on Layer. We’re expanding this area over the coming weeks and months to provide more granular control over your applications, and eventually over administrative function of your Layer account.

What’s next

At Layer, our aim is to provide easy-to-use, flexible, powerful APIs and SDKs for developers to build rich communications experiences. This means exposing controls where needed, and simplifying complexity where possible. We view the Platform API as a whole product, one that gives you more leverage and control over your application and the communication experiences within. We’ll be releasing administrative controls over your Layer account, enhanced control over user and notification policies, insights into all of your messaging activity, and all of the functions you are currently able to perform at a user-level.

Get started today by signing up for a free Sandbox plan, and creating a Platform API token. As always, we can’t wait to see what you build.