Ushahidi API Modernization

Mary Ifeoma Obiagba
Apr 4, 2023

In a previous blog post, we discussed the Ushahidi Platform and the modernization of the Platform with focus on the platform client.

As a refresher, the platform client is the name given to the part of the Ushahidi Platform (i.e. the interface) that users are able to interact with when opened up in a web browser.

In this blog post, we will continue the introduction to the Ushahidi Platform and the modernization of the Platform, but with focus on the backend API i.e. the part of the platform that works behind the scenes when you interact with the client. Let's dive right into it.

1. Overview, problems, and why modernize the Ushahidi platform's API?

Displaying content on a page of the Platform’s user interface, creating, editing, deleting, or saving content through a button usually involves silently sending a request to or receiving a response from the backend API. The problems that modernizing the Platform’s API aims to solve are not visible to users of the platform. However, there will be noticeable differences for contributors/developers.

Currently, there are 2 versions of the API in use in the Ushahidi platform - version 3 and version 5 (abbreviated as v3 and v5 respectively). The v3 has been in existence since around 2014 and was built on the lumen platform. The v5 on the other hand was created in 2020, it has only the posts, surveys, tag (category), and language API endpoints. All other API endpoints are in v3.

  • The initial reason for creating v5 was to add the translation feature to the API endpoints that rely on translation. These include posts, surveys, and category (or tag) API endpoints. The problem is that developers now have to mix the use of the 2 versions because something doesn’t exist or is not well established on only one version.
  • This is not just about the translation feature alone. Using the posts API endpoint as an example: You can get the list of posts from v3, but v5 provides you with the post details and the ability to delete posts. You can also get the list of posts from v5 too, but it doesn’t implement all search parameters.
  • In addition, the way you would access the v3 and v5 in the client is different, the thought and structure behind the 2 API versions are also different, and there are missing features in either one of them.

With time it becomes confusing to continue using both, and it is harder to maintain.

2. Modernization of the Ushahidi Platform's API

The goal is to finish the main API endpoints, and for the new Ushahidi client to start using the new API by the 2nd Quarter of 2023. In summary, the Ushahidi team is working to:

  • Rewrite the existing API endpoints in v5 and restructure the v5 API.
  • Get rid of the v3 endpoint i.e., completely move the remaining API endpoints found in v3 to v5, so that the client will be able to use the v5 only.
  • Update to the latest technology i.e., change from lumen to Laravel.

Later on, and with these in place, it should be easy to add new features without having to rewrite the entire codebase.

3. Who will benefit?

While there may be no difference for users since it has to do with what happens behind the scenes, there may be fixes to some existing API-related problems. Developers and contributors (who contribute to the code and who have to use the platform’s API) will have only one version to use. They will also have more modern, structured, understandable, and clean code to work with.

Contributors to this blog post:

  • Mohammad Al_asmi
  • Wisdom Ebong
  • David Losada
  • Obiagba Mary