How to properly handle subscriptions and their attached serialnumbers
-
Originally I just added devices throught the dashboard, which were then automatically added to a subscription (what I was not even aware of). Later, after ading a second endpoint, I found out that this second endpoint would only receive data after manually adding a subscription, which I did by using he Postman script:
{{base_url}}/m2m/subscriptions?type=resources
First I did this for a few single IMEI numbers, and then I also used it to register several numbers at once.
Later I noticed that everytime I do this, a new subscription, with it’s own ID gets created. So now when I ‘GET’ all subscriptions I get a long list with a all different subscription ID’s, and even some duplicate IMEI numbers with different ID’s.
Now I just found in the documentation that I can also add IMEI numbers to existing subscriptions, so that is probably a better thing to do for the next set of IMEI numbers.
But how do I even know which subscription belongs to what ? There obiously is one subscription that is used for the dashboard, but how do I know which one this is ? And how is it possible that all other subscriptions automatically go to the second endpoint ?What is the easiest way to handle all this? The documentation just gives the CURL examples, and the existing Postman scripts make it a little easier, but I don’t think this very scalable once you have hundreds of devices.
-
Hi Cees,
The portal uses a different user to manage the subscriptions for all the devices in the project; so you will not see those subscriptions when using the API.
How you manage the subscriptions for your user is completely up to you, you can choose to add a new subscription for each device or you can reuse a subscription and add devices to it.Multi endpoint capabilities are on the backlog/wishlist for the portal but we currently don’t have a date/sprint for it. If your use case requires this, please contact the iotcreators team to discuss this with them.
-
@Ederuiter But if I GET all Subscriptions, I do always get at least one subscriptionId section, with a list of IMEI numbers that match the numbers on the dashboard. And when I add something through the dashboard, it will also show up in this list. So what am I seeing then ?
-
Hi @Cees-Meijer ,
Yes you are right, I was thinking of the mysubscriptions endpoint:
{{base_url}}/m2m/mysubscriptions
This endpoint should only list the subscriptions associated with your user.
-
@Ederuiter Thanks. I did not know about ‘mysubscriptions’. But it seems indeed the easiest way to list only those.