How to Use the Soracom API
The Soracom API is a powerful tool to help you get the most out of your smart connectivity service. In this blog, we will look at how to use it, as well as what you can do with it. But first, let’s take a look at what an API even is.
What is an API?
API stands for “Application Programming Interface.” In other words, it is an interface that connects applications and services. APIs are often used behind the scenes to perform button clicks in a Graphic User Interface, such as logging in to web services or processing payments for online shopping.
Some of the advantages of API use include:
- Reusability – Developers can utilize APIs that have already been created, preventing the need to redo work that has already been done and saving costs.
- Protocol Conversion – APIs act as a translator between programming languages, allowing an application to be built in one language and then interacted with by others.
- Automation – Developers can have scripts or applications make programmatic calls to APIs to automate actions that would otherwise take manual work.
Relationship Between The Soracom API and the User Console
The Soracom User console is divided into a Graphical UserT Interface (GUI) and an API, with the GUI displaying data obtained via API calls. When the User Console screen is switched or settings are changed, the Soracom API is called to acquire or change values, and the results can be viewed from the GUI.
Soracom’s API is in HTTP REST API format, which means that it is used by software or libraries that are HTTP clients but is more commonly called from within programming languages such as Python or node.js.
So can you use the API without writing your own application? Yes! The Soracom CLI also lets you control the API from a Command Line Interface such as the Linux Bash command line. Using the Soracom CLI, you can operate the API in a question-and-answer format on the command line.
Let’s try it!
Try the Soracom CLI
If you are new to the User Console and CLI, please refer to the following documentation before proceeding:
For example, one basic command that provides an alternative to the User Console’s SIM management page is the listSims API call, which returns a list of SIMs that match specific criteria. We can use the CLI command
soracom sim list to call this API and return a JSON formatted list of our SIM detail, such as in the image below.
Finding the Right API Call
Most of the operations that can be performed on the User Console can be performed with the API and CLI. Therefore, if there is a User Console action that you would like to automate, you can do so with the API!
Soracom also provides a detailed API reference page that can be used to explore and test API calls right in your browser.
You may notice that two of the categories,
Subscriber, appear identical. The
Sim API performs many of the same activities as the
Subscriber API, though
Subscriber applies to all subscriptions on a SIM. To make it easier to visualize, the Sim API can be described as “information acquisition and operation in units of physical SIMs.” In contrast, the Subscriber API can be described as “information acquisition and operation in units of SIM plans.”
The API Sandbox
Up to this point, we have tried using the API to obtain information from a production environment. However, not all users will be able to test the Soracom API in their production environment. For these cases, we have developed the Soracom API sandbox. The Soracom API Sandbox allows you to make API calls without altering subscribers in your production environment in order to test and verify API behavior.
In conclusion, an API is an interface that connects applications and services, offering benefits such as reducing development time and costs, acting as a translator between programming languages, and automating manual work. Soracom’s API is in HTTP REST API format and can be used through the user console, CLI, or API reference page. It allows users to automate actions that would otherwise take manual work, and most of the operations that can be performed on the User Console can be performed with the API and CLI.
Additionally, Soracom offers an API Sandbox for users to test and verify API behavior without affecting subscribers in their production environment. Overall, the SORACOM API offers a convenient and efficient way for users to interact with their services and automate their workflows.
Got a question for Soracom? Whether you’re an existing customer, interested in learning more about our product and services, or want to learn about our Partner program – we’d love to hear from you!