CMNTY API: Redesigned, Rewritten, Reimagined

If you are a software developer then this post probably doesn’t need an introduction. However, if you are not that tech savvy, but are interested in connecting your community platform with other systems, then you’ll be happy to know that CMNTY Platform is now capable of that. There are so many other great SaaS tools out there that open up an entire world of possibilities when connected to a community of customers, employees or partners. The release of our new API marks the starting point of a new era. 

API?

An Application Programming Interface (API) is a bridge that allows 2 systems to interact with each other and exchange data. Our platform featured a private API for custom projects before, but because we wanted to offer a public API we decided that the old implementation wasn’t suited for that. That’s why over the past months we started rewriting our API from scratch to accomodate for our own and our customer’s wishes. The result? An implementation that is ready for the future!

Exchanging Data

Using the API you can now connect or integrate your community platform with other systems. The API works by sending data to it over HTTPS. If you don’t know how to do this, it’s best you consult your IT team.

You start by authenticating yourself and once that is successful you can start sending and retrieving data through the API. Please be advised that the current implementation is part of our Premium plan.

How to Configure and Get Started

The API requires (almost) zero configuration of your Platform. However, you have to make sure that you set some defaults in the request. Here are the most important ones:

Basic Auth
First of all you need to be authenticated. It is not possible to connect to the API without proper authentication. For authentication the platform uses Basic Auth. You can create a new application under Configure -> API. Once you have done that you will receive a token from the Platform, which you can use to authenticate yourself.

API Version
We also highly recommend you set the version of the API for any request you do. We will perform regular updates to the API and to avoid that your application stops working we will “version” the API.

Content-type
Lastly it’s important to set the content type. For now platform only returns the JSON format. Your request headers will look like this:


Accept: application/vnd.cmnty.v1+json
Content-type: application/json
Authorization: Basic aHR0cHdhdGNoOmY=

Be sure to also have a look at our support article on how to setup the API.

“User” and “Invite” End-points

For now our API supports two “End-points” or methods. An end-point gives you access to a certain type of platform data or can trigger certain actions.

Users

Currently you can perform the following actions: Get Users, Get User (single), Delete a User and Get User groups. For example, you can get the first user of the platform by calling:


GET https://bagelsandfriends.cmnty.com/api/user/users/1

and your output will look similar to this:


{
"id": 123,
"username": "jack",
"email_address": "hello@example.org",
"language": "en",
"role": {
"id": 123,
"name": "Community Manager",
"key": "community-manager"
},
"status": "active",
"profile_url": "https://../user/profile/{id}/{username}",
"avatar_url": "https://../avatar.png",
"self": "https://../api/user/users/{id}",
"created_at": "2017-02-28T09:39:33+00:00",
"updated_at": "2017-02-28T09:39:33+00:00",
"logged_in_at": "2017-02-28T09:39:33+00:00",
"last_activity_at": "2017-02-28T09:39:33+00:00"
}

Invites

You will also have control over the invite system of the platform. The following end-points are available: Get Invites, Create New Invite, Get Invite (Single), Update an Invite, Delete an Invite, Send an Invite, Get Invite Groups.

Roadmap

The above describes our first release of our new API. In the following quarters we will be further expanding the capabilities of this API based on customer feedback and our internal roadmap.