Public Lab Research note

GSoC Proposal: v2 API development and third party app integrations

by sukhbir |

Read more:

About me

Name: Sukhbir Singh

Github Profile:

Affiliation: 4th year, Dual Degree CSE, National Institute of Technology Hamirpur

Location: Hamirpur, Himachal Pradesh, India


Portfolio link:

LinkedIn Profile:

Time Zone: UTC+05:30

IRC/Gitter nick: sukhbir

Project(s) you're working on or want to: plots2

Project description

Abstract/summary (<20 words):

To continue the development of RESTful API v2 for PublicLab website, writing tests and documentation for complete API.


What problem(s) does your project solve?

Plots2 is one of the core project of Public Labs. It has seen rapid development in past few years, most of the development work was directed towards front end and its integration with backend. Alongside, the development of RESTful API is also progressed in past several years and now includes Grape/Swagger interface. There is a need to develop new API endpoints for using statistical data for analytical purposes, for consuming API by 3rd party applications etc.

In this project I would like to work on to solve these API related issues and will develop these API endpoints along with proper documentation using swagger specification and to write tests.

Why Restful API development is important?

  • API development will help in building a modular architecture of entire plots project and its separation from view layer.
  • RESTful API development will help in keeping backend consistent among several iterations or upgradations of front ends and between various ruby versions.
  • RESTful API development will help in expanding capabilities of backend system for PublicLabs website. By providing support to 3rd party app integrations, new innovative apps can find its way around. Some endpoints can even be useful for bots to improve its services.

The whole project is divided into 2 parts:-

Part 1: Developing new API Endpoints with documentation using swagger system

This part of project includes following tasks:-

1. Migrate legacy API endpoints into the new standard Swagger system.

2. Developing token based write API and new endpoints which will help in 3rd party app integrations.

3. To complete documentation for existing API and new endpoints using the swagger system.

Part 2: Developing API Endpoints for providing support to stats data

1. Stats data displayed at ​​ helps to visualise the collective open source work by the community.

2. Statistical data is needed for analytical purposes and developing endpoints for providing stats data between input date ranges and custom ranges will help in analysis.


Part 1 (Restful API Development)

List of legacy APIs which needs to be migrated to new swagger system:-

1. Notes by tag in JSON

Current URL: ​

New URL: ​

2. Wikis by tag in XML

Current URL: ​*.xml

New URL: ​

3. Questions by tag in JSON

Current URL: ​

New URL: ​

4. Maps by tag in XML

Current URL: ​ ​

New URL: ​​?format=xml

List of new endpoints which will be implemented in this project in order to support 3rd party integrations:-

1. Route to get list of recent community activities

2. Route to get list of user's subscriptions

3. Route to update profile information

4. Route to follow/subscribe or unfollow/unsubscribe a tag

5. Route to star/like a question

6. Route to get list of recent questions

More details about these end points with sample response, request type and request parameters can be found at following link.

Part 2 (Stats Data Support)

Statistical data at public labs plays an important role for analytical purposes. In this project, I am planning to develop following endpoints for stats data.

1. ​ Route to get complete stats data

GET- /stats/all

Optional Parameters: "include_details":true or false (boolean)

Sample response can be found on this link.

2. ​ Route to get range stats data from specified range to current time

GET- /stats/range

Any one of the parameters can be passed: past_years:1 (integer) , past_months:13 (integer) ,

past_weeks:5 (integer)

Optional Parameters: "include_details":true or false (boolean)

Similar to previous response but values array will contain only numbers corresponding to each week and other values are calculated on basis of range passed as parameters.

3. ​ Route to get range stats between two dates

GET- /stats/date_range

Required Parameter: "from_date": "10-5-2016", "to_date": "12-31-2016"

Optional Parameters: "include_details":true or false (boolean)

Similar to previous response but values array will contain only numbers corresponding to each week and other values are calculated on basis of range passed as parameters. The above shown json response can be easily integrated/exported as a csv file for analysis purposes. And further authentication can be set up with these endpoints by transferring access_tokens with each request.


23 April - 14 May (Community Bonding Period)

  • Read the documentation of Swagger API framework.
  • Plan the workflow and discuss with mentors

14 May - 20 May

  • Start by creating routes for new endpoints to migrate legacy APIs and write openApi file
  • Write methods for migrating legacy code to new endpoint routes

21 May - 27 May

  • Create modules like public, user etc. and write classes for developing restful APIs for new endpoints
  • Implement classes and methods for new endpoints corresponding to first three routes as specified in implementation section

28 May - 4 June

  • Implement classes and methods for remaining endpoints routes as specified in implementation section

5 June - 11 June

  • Buffer period ( Testing, debugging and documentation )

11 June - 15 June (Mid Term Evaluation)

16 June - 22 June

  • Plan and implement methods for getting complete stats data
  • Implement range specific API endpoints for stats data

23 June - 29 June

  • Testing, debugging and documentation

30 June - 12 July

  • Buffer Period
  • Read more about GraphCommons platform and its documentation

13 July - 19 July

  • Discuss the structure of nodes and edges required for graphcommons csv structure with mentors
  • Create a new class and implement common methods for generating csv as output

20 July - 31 July

  • Implement graph specific methods to output desired csv file
  • Testing and debugging

1 August - 6 August

  • Bug fixings and clean up code.

6 August - 14 August (Final Term Evaluation)


What resources will you need: people, documentation, literature, sample data, hardware if applicable

Guidance from mentors will be needed. Other informations and references required by the project are available online.

First-time contribution

Have you looked over our welcome page and are you familiar with how to make your first contribution? Have you already made it? We're eager to see that you've had a good experience making a small initial contribution to our site. Please check out our welcoming page:

And paste in links to your initial contributions here so we can see!

Yes, I have already forked the existing repo of plots and successfully run it on my local machine. I have made several contributions to plots repo, some of them are already merged and others are in review.

Bugs/Issues reported (

Pull Requests (


Tell us how you've learned about writing software; what languages you've been learning, if you've worked on other projects, links to GitHub or other code repositories or samples.

Albert Einstein once said,

"Information is not knowledge. The only source of knowledge is experience."

I have expertise in developing web applications using Ruby on Rails, React.js, Java, and Javascript. I have started learning Ruby on Rails and Java from the second year of my college. During college, I have also developed several mobile applications.

Last summer I have worked as a Software Developer Intern at one of the fast-growing startups in Mumbai - Cogoport, where I have worked as a full stack developer. During internship, my work mainly focuses on developing RESTful API endpoints in Ruby on Rails and developing front-end components in React.js, integrating them with the backend, fixing bugs in existing website and performance improvements. I have worked under professional developers who had experience of over 10 years in software industry.

Here is the link to my experience letter:

I have also completed a freelancer project on Fiverr on developing scalable RESTful API for a website within 10 days for a client for which I received 5/5 rating.

Link to this fiverr gag:

Also, I am convenor/head of android application development society of my college - AppTeam NITH. Most of the projects of AppTeam are open source on Github. Link:

## Links to some other projects I have worked on:-

> PseudoFlipkart (2016) []

  • Implemented an online shopping website. Features include user's session management, shopping cart for storing

items temporary, category wise items catalog.

> Hackathon-Foodie (2017) []

  • Foodie is a centralized food ordering app for restaurants near NIT Hamirpur. Implemented search feature, items cart, and integration with backend APIs.


Describe teams you've worked with before, whether open or closed source, and in what capacity you participated. Cite examples of how you were self-motivated and self-sufficient.

Presently I am a part of AppTeam NITH, CSEC, and GLUG-NITH clubs/societies of my college. AppTeam NITH is the android society of my college. I am the lead android developer, convernor of the club. CSEC is Computer science and engineering society of my college, where our aim is to expand competitive programming culture in college. GLUG is the club that aims to promote open source development and linux usage between student developers.

In May 2017, I have mentored the winner team at "Hackathon 2.0" by AppTeam NITH which had developed a hardware hack for easing the process of hostel passout systems.

During 2 month summer Internship at Cogoport, I have worked with a team of backend and front-end experts, product managers, and software engineers. This is the place which gets me really excited about startups. I have worked with full commitment and contibuted over 150 commits to their main website. During this period I mainly coded in ruby and javascript as their backend was written on ruby on rails framework and front end in React.js. The proof of my commitments can be seen on my github profile calendar section under 2017 year tab. For my dedication and good work during internship, I get appreciation from co-founders in my internship experience letter.

Currently I am the organizer of annual hackathon "Hack On Hills" organized in our college.


What about our projects, and Public Lab, interests you? What are you passionate about? Open science, environmental justice?

Learning is the life long process and this project will also help me towards becoming better version of myself as software developer. By being a part of Public Labs community, I wanted to give my contributions towards a greater cause to better environment. I have watched the talk by Jeff and I think PublicLabs is becoming a great platform for knowlege sharing related to environmental issues and other related concerns. I wanted to use my skills to help in development of such community.


Whom do you want your work to help? We especially appreciate proposals which make technologies and techniques more welcoming and friendly to those who've often been excluded.

My work on RESTful APIs will help the developers of 3rd party apps of PublicLabs (like bot development) in easy integrations with APIs and also provide a platform to serve for future developers and contributors as the reference for all API endpoint available for usage. Developing better 3rd party apps will lead to more people/audience engaging towards the cause. Hence, this project will ultimately help in making PublicLabs website and data more accessible, adaptive and versatile.


Do you understand this is a serious commitment, equivalent to a full-time summer job? Tell us how you'll structure your schedule from day to day!

Yes, I completely understand that Gsoc is serious commitment and I am assuring you that I will give me 100% during this duration and will even contribute to PublicLabs after Gsoc. I have summer vacation holidays starting from 15 May 2018 to July end, so I can work 7-10 hours per day in summers. After July, I can give 6-8 hours per day and more hours on weekends.

I will update my progress weekly in the form of blog posts. And for the tasks related to same categories, I will create a checklist and use it for tracking progress on these category of tasks.

software gsoc soc gsoc-2018 soc-2018 rgsoc-2018 soc-2018-proposals soc-2018-api 2440



Hi @warren @liz, please provide your valuable feedbacks on this proposal. Thank you.

Hi @sukhbir, great to see this proposal!!! It may take us until Friday this week to review it, apologies for slowness on our side as @warren is working on site with a community dealing with an environmental problem.

No problem @liz. Happy to work with you people being mentors.

Hi @warren can you please tell @sukhbir about on what features he has to give more attention in his proposal for API so that he can update his proposal because he is waiting for us for a long time. Thanks

Hi, this is fantastic, thank you! In your list of endpoints, which I really appreciate, which are existing legacy functions which would be updated, and which are new? Could you indicate the current URL for legacy ones (sourcing from and the new URL it'd be available at?

Please also check out my comments about the statistics API and other considerations in this comment --

Thanks a lot! Don't forget to take a look at related proposals by @milaaraujo, @stefannibrasil, @Raounak, and @rishabh07 -- and reach out to talk with them about their proposals too! #soc-2018-api

Thanks for all your great work in contributing already! Very much appreciated. :-)

Is this a question? Click here to post it to the Questions page.

Hi @warren, @liz, @mkashyap354 I have updated my proposal. Please review!!

@sukhbir, nice proposal. I will like to suggest you to open some first timer issues. So, that you can know how we are doing the outreach plan to increase number of contributors at public labs. Also please add the outreach plan as suggested by @warren Thanks

Thanks a lot @bansal_sidharth2996 for the reply :) I will add outreach plan in my proposal and will open some first timer issues on github.

You must be logged in to comment.