Making the first API call

In this video, I'll show you how to get set up with the eSIM Access API in less than two minutes.
first api call

In this video, I’ll show you how to get set up with the eSIM Access API in less than two minutes. We’ll start by heading over to our eSIM Access account and copying our access code and security key. Then, we’ll go to the docs and run the API in Postman. I’ll guide you through setting up your public environment and authenticating your requests. Finally, we’ll make our first API request to check our balance and list available data packages. I’ll also show you how to purchase your first e-SIM. Stay tuned for my follow-up video with more functions!

What you need to start

To get started you will need a reseller account at eSIM Access and an account with Postman. Both are free to set up.

Follow these steps to make your first api call

  1. Visit docs.esimaccess.com and click Run In Postman
  2. Choose either the run in web or run in application option
  3. After your fork of the API requests are loaded, find the Create New Environment + symbol
  4. Edit the Pub Env settings.
  5. Go to the developer page in your eSIM Access console.
  6. Copy your secretKey
  7. Enter your secretKey as both Initial value and current value in Postman
  8. Repeat for the AccessCode
  9. Save your postman Pub Env settings. Note you can set the secretKey Type to “secret”
  10. Visit Post Get Merchant Balance
  11. You should see the host URL when you over over the {{host}} variable
  12. Click Send
  13. Verify you get a “success”: true response.

Setup steps in more detail

To make your first API call, you need to start by having a clear understanding of the API you’re about to interact with. An API (Application Programming Interface) acts as a bridge that lets software applications communicate with each other. Making an API call involves sending a request to the API and receiving a response in return. Before you can send a request, you need to understand what specific request to send and how to structure that request. It might involve sending data, specifying a particular format for the response, or even using specific HTTP methods like GET or POST.

Start your journey by visiting the website docs.esimaccess.com. Look for the button that says ‘Run In Postman’ and click on it. Postman is a popular API testing tool used by developers to send requests to an API and receive responses. This makes it easier to work with APIs as it allows developers to test requests without having to write any code.

Once you click the ‘Run in Postman’ button, you’ll be presented with two options: ‘Run in web’ or ‘Run in application’. If you choose ‘Run in web’, you will be able to interact with the API directly in your browser. Alternatively, if you select ‘Run in application’, it will open up the Postman application installed on your computer, allowing you to interact with the API there.

After your fork of the API requests has been loaded in Postman, look for the ‘Environment Quick Look’ button. This can typically be found in the top right corner of the Postman application. Clicking this button will allow you to view and edit the environment variables related to your API call.

In the ‘Environment Quick Look’, edit the ‘Pub Env‘ settings. These settings hold values such as host, base path, and authorization details that are used to construct the HTTP requests. Properly configuring these settings is crucial to ensure that your API calls target the right server and include the correct data.

To further set up your API call, go to the developer page in your eSIM Access console. This page contains specific details about your account that are required for making API calls.

On the developer page, find and copy your secretKey. The secretKey is a type of API key used to authenticate your API requests. It is essentially a password that allows you to access certain functionalities of the API.

With your secretKey copied, go back to Postman and enter your secretKey in both the ‘Initial value’ and ‘Current value’ fields. This ensures that the secretKey is available whenever you are making an API call, whether it’s for testing purposes (initial value) or actual execution (current value).

Repeat the previous step for the AccessCode. The AccessCode is another component of API authorization, acting as an additional layer of security.

After inputting your secretKey and AccessCode, save your Postman ‘Pub Env‘ settings. As an extra precaution, you can set the ‘Type‘ for secretKey to ‘secret‘ to hide its value in the Postman UI, further enhancing the security of your information.

Now that your environment settings are configured, it’s time to make an API call. Navigate to Get Merchant Balance. This is a specific API endpoint that retrieves the balance of a merchant account.

Hover over the {{host}} variable and you should see the host URL. The host URL is the base URL of the API you’re interacting with. All API endpoints will be appended to this base URL to construct the full URL for the API call.

Now, you’re ready to send your API call. Click the ‘Send’ button to execute the request. Postman will send the request. You should see a success:true response if your connection has worked.

“success”:true – Connection made!

With the eSIM Access API set up in Postman, you can not make API calls for viewing plans and prices, ordering eSIMs, and making top ups.

More Resources:

Discover more from eSIM Access

Subscribe now to keep reading and get access to the full archive.

Continue reading