Henrik Kühnemann is Head of Production at GLOBALscandinavia group. He joined us at the XTRF Summit #online 2020 to share his experience of using the Home Portal API to connect with a client’s PIM. He discussed the lessons he learned along the way and demonstrated an API in action. This article is based on his presentation.
Why we needed an API
Four years ago, a client of ours announced they were getting a Product Information Management (PIM) system. We decided to go along for the ride, integrating our own system with theirs. After a round of tenders, we had chosen an IT partner to support us with creating the integration, and the project began.
We soon realized that simply having read the documentation wasn’t enough. And, not having a technical background, meaning I didn’t really understand what I’d read. The IT partner’s development team started soon asking questions about how we wanted the XTRF side of the connector to work, and we realized we hadn’t thought about this in detail. We thought it was a simple matter of connecting two systems to one another. It was our first integration project, and we hadn’t really specified the work to be completed. But all this proved to be a very interesting and informative learning experience.
We took a different approach. We reverse-engineered the whole process. We started by thinking about what we wanted to achieve, what we wanted to happen on our side, in XTRF, and how we would get there if we were just using the regular user interface, rather than an API. Understanding our desired outcome helped us to look at the documentation from a different perspective.
Here are three key lessons we learned along the way:
- Being guided by purpose really helps with reading API docs
- Knowing your way around APIs will make you a better buyer of programming services
- Gaining experience with one API empowers you to use other APIs
What you need to start exploring APIs
- Basic understanding of HTTP
- The general notion of JSON
- Tool for helping you process HTTP and JSON
Having an idea of what you want your API to achieve is also helpful.
When it comes to tools for API exploration, there are a few to choose from. They help you understand what you get back from the system and allow you to test and tinker with the requests. Here are some good options:
- The Swagger API docs
Give it a go!
In the talk, I provided a demo of a basic Classic Project API, and:
- Created a Classic Project
- Uploaded a file
- Added it to the Task
Here’s what this looked like:
The code might look overwhelming and complex. But the tools are there to take this complexity away. My advice is to think of the code as a way of bundling all the clicks and inputs you would normally perform when using the system’s user interface.
Have a go at replicating what I did and play around with the API yourself. Here’s how:
- Get the notebooks here: github.com/kuhnemann/XTRF_summit_HP
- Get JupyterLab here: jupyter.org
- Get and use Postman here: postman.com
Head of Production