POST Device attributes from POSTMAN

#1

Hi,
This is sivasankari .I am a new learner for Losant framework.please
send sample syntax of post device attributes from POSTMAN

#2

Hi @sivasankari_s,

Updating device attributes requires the use of Device Patch, while sending state for those attributes would be done with Device State. Here is a walkthrough for Device Patch:

Device Patch

I create a device called Thermostat with two attributes: temperature and humidity.

I create an application token for use in Postman.

Over on Postman, I set my request to PATCH and put in my request URL that holds my application ID and device ID. I set my authentication type to Bearer Token and paste in the token I generated in Losant.

Then I set my Headers for this request:

Then over in the body, I specify the attributes I would like this device to have:

And back on Losant, I can see that my PATCH was successful, and my previous attributes have been overwritten and celsius is my only attribute.

Let me know how else I can help!
Julia

#3

Thank you very much Julia,
I have two attributes like the followings
“attributes”: [
{
“name”: “phonename”,
“dataType”: “string”
},
{
“name”: “phonestatus”,
“dataType”: “number”
}
]

I want to pass the attributes value(Parameters) from POSTMAN.

Example:POST https://5ca5f7f18b62290008d0e84d.onlosant.com/devices/deviceid/
Here I want to POST Data of two attributes(Phonename=“Iphone7” Phonestatsus=1)
from POSTMAN.
please send me samples

Thanks
Sivasankari S