# Unable to get current node-red flows using Admin API GET Method

**URL:** <https://discourse.nodered.org/t/unable-to-get-current-node-red-flows-using-admin-api-get-method/56038>\
**Category:** General\
**Created:** [3 January 2022 13:54 UTC](https://discourse.nodered.org/t/unable-to-get-current-node-red-flows-using-admin-api-get-method/56038 "2022-01-03T13:54:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhilash-ingale](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/abhilash-ingale/32/41401_2.png) [@abhilash-ingale](https://discourse.nodered.org/u/abhilash-ingale)\
**Post date:** [3 January 2022 13:54 UTC](https://discourse.nodered.org/t/unable-to-get-current-node-red-flows-using-admin-api-get-method/56038/1 "2022-01-03T13:54:50Z")

</div>

Hi all,

I am running Node-Red `2.0.6` on a Raspberry Pi 4 and want to get all the currently deployed flows as a JSON object using the HTTP Admin API GET Method.

For this, I used an `http request` node and selected `GET` method. In the URL section, I put `http://localhost/flows` and specified the login credentials by clicking on the checkbox for authentication.

After deploying a simple flow (shown in the image), I am getting an output `msg` object which says -

![GET](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0c9a133532136e7670480f86aa07500c1e1dbb5.png)

Debug node log :

```auto
1/3/2022, 2:42:21 PMnode: a41e36319a7a5959msg : string[16]
"JSON parse error"

```

```auto
payload: string

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /flows</pre>
</body>
</html>

topic: ""
statusCode: 404
headers: object
x-powered-by: "Express"
content-security-policy: "default-src 'none'"
x-content-type-options: "nosniff"
content-type: "text/html; charset=utf-8"
content-length: "144"
vary: "Accept-Encoding"
date: "Mon, 03 Jan 2022 13:42:21 GMT"
connection: "close"
x-node-red-request-node: "5726158e"
responseUrl: "http://rds-00.pc.cognex.com/flows"
redirectList: array[0]
retry: 0

```

It is clear to me as per the [documentation](https://nodered.org/docs/api/admin/errors) that `statusCode:404` means that the resource was not found but I am confused about the reason.

I might probably be making a rookie mistake in terms of using the GET method but so far, I have not found anything to support this argument.

Any help/suggestions are welcome.

[Json for flow]

```auto
[{"id":"05569bcb5a515175","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a41e36319a7a5959","type":"http request","z":"05569bcb5a515175","name":"","method":"GET","ret":"obj","paytoqs":"body","url":"http://localhost/flows","tls":"","persist":false,"proxy":"","authType":"basic","x":550,"y":420,"wires":[["2b13c2a959d26922"]]},{"id":"50675d657a6f5987","type":"http request","z":"05569bcb5a515175","d":true,"name":"","method":"POST","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1030,"y":60,"wires":[[]]},{"id":"1b5f02b2dd797071","type":"inject","z":"05569bcb5a515175","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":340,"y":420,"wires":[["a41e36319a7a5959"]]},{"id":"2b13c2a959d26922","type":"debug","z":"05569bcb5a515175","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":420,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [3 January 2022 14:09 UTC](https://discourse.nodered.org/t/unable-to-get-current-node-red-flows-using-admin-api-get-method/56038/2 "2022-01-03T14:09:48Z")

</div>

> [@abhilash-ingale](#):
>
> [http://localhost/flows](http://localhost/flows)

By default, Node-RED listens on port 1880, so the expected URL would be `http://localhost:1880/flows`

---

<div class="post-metadata">

**Author:** ![abhilash-ingale](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/abhilash-ingale/32/41401_2.png) [@abhilash-ingale](https://discourse.nodered.org/u/abhilash-ingale)\
**Post date:** [3 January 2022 14:12 UTC](https://discourse.nodered.org/t/unable-to-get-current-node-red-flows-using-admin-api-get-method/56038/3 "2022-01-03T14:12:23Z")

</div>

Thanks for the comment @knolleary . However, I have chosen to run node-red on `Port:80` and specifying it in the URL is still not helping.

---

<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:** [4 March 2022 14:13 UTC](https://discourse.nodered.org/t/unable-to-get-current-node-red-flows-using-admin-api-get-method/56038/4 "2022-03-04T14:13:07Z")

</div>

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