How to create multiple endpoints via API?

Our API documentations describes how to create one endpoint. By using Postman we will explain how to create x number of endpoints at once. Let's first take a look at the information we need to gather about an endpoint in order to create one (point 1). We'll then send two APIs requests to create multiple endpoints (point 2) at once and we will finally create them (point 3).

1. Necessary information to create an endpoint

According to the API documentation, the POST API used to create one endpoint on the EMnify platform, needs to have the following information:

Name of the endpoint (required);

Tags (optional) - You have the possibility to add specific information for each endpoint;

Status: activate or not (required) - is the endpoint activated or disable;

Service profile (required) - ID of the Service Profile assigned to the endpoint. To find this information, navigate to the "Service Profiles" tab in the EUI or run this API;

Tariff profile (required) - ID of the tariff Profile assigned to the endpoint. To find this information, navigate to the "Tariff Profiles" tab in the EUI or run this API;

SIM (optional) - if we want to directly assign a SIM to the created endpoint, we need to enter here the SIM ID. To find this information, navigate to the SIMs tab in the EUI;

For each endpoint we want to create, the above mentioned information need to be entered. In order to create several of them at once, we can use the "Runner" option in Postman. To do so, create a .csv file (separated with comma) and enter the information as follow:

sim_id

endpointname

tag

serviceprofile

tariffprofile

233622

JEtest1

customerA

129069

128197

333339

JEtest2

customerB

121168

1299

You should have as many lines as endpoints you wish to create.

2. Preparing the APIs to run

To run any API on our platform, you need to authenticate (point 2.1) and then run the endpoint creation API (point 2.2)

3. Running the different APIs at once

We are now ready to run the APIs multiple times and create several endpoints at once. In Postman, click on "Runner", select a collection, an environment, and your .csv file. The number of iterations should then automatically be detected. You can preview your file to be sure that everything is fine before clicking on "start run". This is how the preview should look like: