# Custom REST SmartApp Endpoint

**URL:** <https://community.smartthings.com/t/custom-rest-smartapp-endpoint/957>\
**Category:** General Discussion\
**Tags:** archive\_developers\
**Created:** [December 8, 2013, 10:49pm UTC](https://community.smartthings.com/t/custom-rest-smartapp-endpoint/957 "2013-12-08T22:49:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![afewremarks](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@afewremarks](https://community.smartthings.com/u/afewremarks)\
**Post date:** [December 8, 2013, 10:49pm UTC](https://community.smartthings.com/t/custom-rest-smartapp-endpoint/957/1 "2013-12-08T22:49:24Z")

</div>

So you will have to excuse me as I am still pretty new at all this but I am struggling to be able to pull the temperature from a temperature sensor via REST SmartApp Endpoint. I followed @megapixel great tutorial here:

I can get my temperature sensors names, ids…all top level info, to show up but I can’t get the temperature. I think it has something to do with this code in the in the Endpoint App itself :

```auto
private show(devices, type) {
	def device = devices.find { it.id == params.id }
	if (!device) {
		httpError(404, "Device not found")
	}
	else {
		def attributeName = type == "motionSensor" ? "motion" : type
		def s = device.currentState(attributeName)
		[id: device.id, label: device.displayName, value: s?.value, unitTime: s?.date?.time, type: type]
	}
}

```

Any help would be great.

---

<div class="post-metadata">

**Author:** ![afewremarks](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@afewremarks](https://community.smartthings.com/u/afewremarks)\
**Post date:** [December 9, 2013, 9:59pm UTC](https://community.smartthings.com/t/custom-rest-smartapp-endpoint/957/2 "2013-12-09T21:59:20Z")

</div>

For anyone else trying to get this figured out…It is pretty simple(doh!), just had to change the last line to:

`[id: device.id, label: device.displayName, value: s?.value, unitTime: s?.date?.time, device.currentValue('temperature'), type: type]`
