# Create Rest API Service on PI which act on PUT and GET requests

**URL:** <https://discourse.nodered.org/t/create-rest-api-service-on-pi-which-act-on-put-and-get-requests/38520>\
**Category:** General\
**Created:** [4 January 2021 15:01 UTC](https://discourse.nodered.org/t/create-rest-api-service-on-pi-which-act-on-put-and-get-requests/38520 "2021-01-04T15:01:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [4 January 2021 15:01 UTC](https://discourse.nodered.org/t/create-rest-api-service-on-pi-which-act-on-put-and-get-requests/38520/1 "2021-01-04T15:01:39Z")

</div>

Hoi

Can some one help me, I like to build some functions on my node-red implementation. to control them via an API. Very simple when sending a PUT I want to control the GPIO  
and a GET which show some results back

PUT "[https://HostRP4/ASCOMInitiative/api/v1/dome/0/closeshutter](https://HostRP4/ASCOMInitiative/api/v1/dome/0/closeshutter)"  
PUT "[https://HostRP4/ASCOMInitiative/api/v1/dome/0/openshutter](https://HostRP4/ASCOMInitiative/api/v1/dome/0/openshutter)"  
which cause a status change on the GPIO pin

GET "[https://HostRP4/ASCOMInitiative/api/v1/dome/0/shutterstatus](https://HostRP4/ASCOMInitiative/api/v1/dome/0/shutterstatus) gives the status predefined status back like open, opening, close, closing

Can some help me to get this done

This all is related to ascom-alpaca. I like to control my Roll-off Roof also via API

Thank in advanced

Chris

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 January 2021 15:25 UTC](https://discourse.nodered.org/t/create-rest-api-service-on-pi-which-act-on-put-and-get-requests/38520/2 "2021-01-04T15:25:47Z")

</div>

Start with the http examples in [the cookbook.](https://cookbook.nodered.org/#http-endpoints)

---

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [5 January 2021 11:33 UTC](https://discourse.nodered.org/t/create-rest-api-service-on-pi-which-act-on-put-and-get-requests/38520/3 "2021-01-05T11:33:01Z")

</div>

Thanks Colin i will check this first

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 March 2021 11:33 UTC](https://discourse.nodered.org/t/create-rest-api-service-on-pi-which-act-on-put-and-get-requests/38520/4 "2021-03-06T11:33:12Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
