Blog

Project Spotlight: Building a Custom API

We like a good challenge. Recently a friend called and told me that he had a client who needed someone to set up an API (application programming interface) so that users could securely sign in to a second website without the need to create a separate account. The connection between the two websites recently stopped working. It seems the company that built it went out of business and was no longer reachable. The company took all the source code, instructions, and access to the website so we had to start from scratch. This is where the fun starts.

The Research

We tried to find the original company. The thought is that it would be quicker to take what they had and update it or at least get some insight into how things worked. We looked at the expired domain history to find the owner or any other website hosted on the same server. We found a name and phone number for the business along with another business at the same location but all we got was an answering service and no one returned our calls. Since there was no documentation, the next step was to figure out what was needed and how the client’s website passed information to the second website. We looked at the documentation for both websites and were able to quickly rebuild a script that did pretty much what was done before.

  1. User signs into client website
  2. User selects a link for a second website
  3. User is taken to the second website and automatically signed in

The Problem

The problem occurred in between steps 2 and 3. Our tests with sample data worked but we were unable to update the client’s website to use the new software we built. It was a hosted membership management website. After several days of working with tech support, they recommended we try out their new API, especially since the old one was going to be sunset in 6 months. They had no idea how the first API worked or where information was stored. My client was eager to get the connection back online so we quickly moved on to the new API.

The Solution

The second half of the code we wrote worked like a charm. We were able to successfully log in to the second website with the user information from the first website. There was no need to start from scratch again. We used the documentation for the new API, modified our script to create the appropriate token and load information, and forward this information to the second website. Just over 200 lines of code later, we were done. It works like a charm and the client was happy.

We created an Amazon AWS account for this project with an Ubuntu EC2 instance with just the basics: Nginx, PHP, and a firewall. The client has full access to the account and we’ve documented how the process works in the event something needs to change in the future.

What’s Next?

If you have a need to automate your business processes or connect disparate systems, contact us. We live for automation.

Check what we've been up to, sign up for our newsletter.

Table of Contents

>Businesses, government, and organizations rely on CrucianPoint