Conduit API – lora-devices PUT
Home › Forums › Conduit: AEP Model › Conduit API – lora-devices PUT
- This topic has 5 replies, 3 voices, and was last updated 7 years, 1 month ago by
Lawrence Griffiths.
-
AuthorPosts
-
October 22, 2018 at 6:45 am #26602
Lawrence Griffiths
ParticipantI can get a list of devices and DELETE a device. But trying to use PUT to update an existing device results in a Path error “path not found [lora/devices/a81758fffe03757f]”. I’m running v1.6.2
I’m using POST MAN http://www.getpostman.com
// PUT
HTTP Header Content-Type: application/json
UR https://192.168.1.236/api/lora/devices/a81758fffe03757f
Body {“serial_number” : “1234”}// DELETE verb works
https://192.168.1.236/api/lora/devices/a81758fffe031408-
This topic was modified 7 years, 1 month ago by
Lawrence Griffiths.
October 22, 2018 at 7:04 am #26605Jason Reiss
KeymasterLooks like the doc was wrong.
Try without the EUI in the URL.PUT /api/lora/devices ‘{“dev_eui”:”<EUI>”, “serial_number”:”1234″}’
October 22, 2018 at 8:12 am #26607Lawrence Griffiths
ParticipantJason thanks
Been trying diffident keys/deveui formats etc all of the below result in
“Invalid json device configuration, object expected”
All the JSON I’m submitting is valid{“deveui”:”a81758fffe03757f”, “serial_number” : “1234”}
{“deveui”:”a8-17-58-ff-fe-03-75-7f”, “serial_number” : “1234”}{“dev_eui”:”a81758fffe03757f”, “serial_number” : “1234”}
{“dev_eui”:”a8-17-58-ff-fe-03-75-7f”, “serial_number” : “1234”}{“a8-17-58-ff-fe-03-75-7f”: {“serial_number” : “1234”}}
{“a81758fffe03757f”: {“serial_number” : “1234”}}Not sure what to try next?
This is something I was doing to show Campbell Elder…October 22, 2018 at 8:26 am #26608Jason Reiss
KeymasterThat last quote looks different.
October 24, 2018 at 11:35 am #26629William Laing
ParticipantWe are able to do PUTs using Postman.
A couple things to consider:
+ When I copied your JSON body and tried it, your double-quote characters did not work, so I needed to retype them on my machine
+ Authorization->Type: Basic Auth
+ Authorization->Username: value typed in
+ Authorization->Password: value typed in
+ The JSON body I used was of the form:
{
“deveui” : “00-80-00-00-04-00-99-99”,
“serial_number” : “1234”
}Hope that helps.
October 25, 2018 at 1:50 pm #26640Lawrence Griffiths
ParticipantWilliam thanks my bad hadn’t checked the Post header Content-Type !!
I wanted to write to the tags field/key Failed! So deiced to test write to other fields. results belowclass STRING fail // failed to update device
firmware_version STRING pass
hardware_version INT pass
product_id STRING pass
serial_number STRING pass
tags STRING fail
name STRING failLawrence
-
This topic was modified 7 years, 1 month ago by
-
AuthorPosts
- You must be logged in to reply to this topic.