iotcreators.com web
    • Login
    • Search
    • forum.iotcreators.com
    • docs.iotcreators.com
    • Tags
    • Popular
    • Recent
    • Register

    Samples of how to work with existing subscriptions via API

    iotcreators.com portal & API
    api subcription
    1
    1
    64
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Roland Baldin
      Roland Baldin iotcreators.com team last edited by Roland Baldin

      Hi,

      instead of creating and deleting complete subscriptions after you added or deleted devices you can add or remove the device to or from from the existing subscription.

      In the following the Nokia IMPACT API samples

      • to get the devices of an existing subscription,
      • list itemto add a devices to an existing subscription,
      • list itemto delete a devices from an existing subscription (important: if the last device of a subscription is delete the subscription it-self is deleted as well).

      Get devices of an existing subscription

      GET https://iot.netwerk.t-mobile.nl:443/m2m/subscriptions/f37b094d-307f-4d43-82c5-73f81104e22f/serialNumbers
      HEADERS: {
       "Content-Type": "application/json", 
       "Accept": "application/json", 
       "Authorization": "Basic QVBJX0NPTsl8wMDssAswMDAbxNcTU4XzNlZmEzOkpySS9YOC45Y19CrrRmI0OEY="
      } 
      BODY: {
       "serialNumbers": [
       "IMEI:452749630137052", 
       "IMEI:351938100191440"
       ]
      }
      
      RETURN STATUS CODE: 200
      RETURN BODY: {
        "serialNumbers": [
          "IMEI:454596441983713",
          "IMEI:351938100191440",
          "IMEI:866425033313638",
          "IMEI:452749630137052",
          "IMEI:352656100979544"
        ]
      }
      

      Add devices to an existing subscription

      POST https://iot.netwerk.t-mobile.nl:443/m2m/subscriptions/f37b094d-307f-4d43-82c5-73f81104e22f/serialNumbers
      HEADERS: {
        "Content-Type": "application/json", 
        "Accept": "application/json", 
        "Authorization": "Basic QVBJsX0NPTl8wMDsssswMDAbxNcTU4XzNlZmEzOkpySS9YOfgC45Y19CRmI0OEY="
      }
      BODY: {
        "serialNumbers": [
          "IMEI:452749630137052", 
          "IMEI:351938100191440"
        ]
      }
      
      RETURN STATUS CODE: 200
      RETURN BODY: {
        "subscriptionId": "f37b094d-307f-4d43-82c5-73f81104e22f",
        "msg": "Success",
        "code": 1000
      }
      

      Delete devices from an existing subscription

      DELETE https://iot.netwerk.t-mobile.nl:443/m2m/subscriptions/f37b094d-307f-4d43-82c5-73f81104e22f/serialNumbers
      HEADERS: {
       "Content-Type": "application/json", 
       "Accept": "application/json", 
       "Authorization": "Basic QVBJsX0NPTl8wcMDssAwMDAbxNabcTU4XzNlZmEzOkpySS9YOC45Y19CRmI0OEY="
      } 
      BODY: {
       "serialNumbers": [
       "IMEI:452749630137052", 
       "IMEI:351938100191440"
       ]
      }
      
      RETURN STATUS CODE: 200
      RETURN BODY: {
        "subscriptionId": "f37b094d-307f-4d43-82c5-73f81104e22f",
        "msg": "Success",
        "code": 1000
      }
      
      1 Reply Last reply Reply Quote 1
      • 1 / 1
      • First post
        Last post