JSON structure to register device with LNS

Home Forums Conduit: AEP Model JSON structure to register device with LNS

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31330
    Ajay Wahi
    Participant

    Hi,

    I am trying to register a device with LNS via API call and passing json string to it.

    The json structure that I am passing is:
    {“deveui”:”0004A30B00EAC118″,”device_profile_id”:0,”network_profile_id”:1,”name”:””,”serial_number”:””,”product_id”:””,”hardware_version”:””,”firmware_version”:””}

    And the HTTP url format is:
    https://aep.example.com/api/lora/devices?token=BA2DC9A581486BD849B4E8A85A689F83

    When I use the above URL and JSON structure in POSTMAN I get following error:
    “Invalid json device configuration, object expected”

    When I use JSON structure from a C# program it registers the device but sometimes it throws exception:
    Error:The remote server returned an error: (400) Bad Request.

    So I am not able to understand what is wrong with the JSON structure and why it throws exception sometimes but registers the device every time?

    I am struggling to get this working. Any help in this part is highly appreciated!

    Regards,
    Ajay

    #31331
    Jason Reiss
    Keymaster
    #31337
    Ajay Wahi
    Participant

    Thanks Jason for sharing the link.
    I figured out the issue for exception. The program was trying to register the device again when it was already registered so the api call was throwing exception even though the exception details do not tell if the device is already registered.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.