# Interact with Pocket APIs

**URL:** <https://discourse.nodered.org/t/interact-with-pocket-apis/39782>\
**Category:** General\
**Created:** [26 January 2021 14:47 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782 "2021-01-26T14:47:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vongomben](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@vongomben](https://discourse.nodered.org/u/vongomben)\
**Post date:** [26 January 2021 14:47 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782/1 "2021-01-26T14:47:42Z")

</div>

Hi Node-RED forums.

I'm an avid User of [Pocket](https://getpocket.com).  
I want to interact (and specifically, `retrieve`) the data from my pocket account.

I've created an app and received a `consumer key`.

I've been following this call and created this flow, but I'm receiving `"non-http transport requested" as an error.

Here's my flow.  
I really need to clarify myself how to use and interact with headers, specifically woth the change node, rather than the function node.

Thanks in advance for the help.

```auto
[{"id":"4ade6f69.0f7db","type":"http request","z":"967d56b4.c7f498","name":"pocket request APIs","method":"POST","ret":"obj","paytoqs":"ignore","url":" https://getpocket.com/v3/oauth/request ","tls":"","persist":false,"proxy":"","authType":"","x":560,"y":4600,"wires":[["d19b405.3e9f5c"]]},{"id":"692f12fb.ec970c","type":"change","z":"967d56b4.c7f498","name":"set payload and headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{\"Content-Type\":\"Application/json; charset=UTF8\",\"X-Accept\":\"application/x-www-form-urlencoded\"}","tot":"json"},{"t":"set","p":"headers","pt":"msg","to":"{\"consumer_key\":\"MyKey\",\"redirect_uri\":\"http://google.com\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":4640,"wires":[["4ade6f69.0f7db","f70ce42e.dfb5b8"]]},{"id":"5632bad4.b682e4","type":"inject","z":"967d56b4.c7f498","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":4620,"wires":[["fbba97fb.d0da48"]]},{"id":"f70ce42e.dfb5b8","type":"http request","z":"967d56b4.c7f498","name":"httpbin","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://httpbin.org/post","tls":"","persist":false,"proxy":"","authType":"","x":570,"y":4640,"wires":[["d19b405.3e9f5c"]]},{"id":"d19b405.3e9f5c","type":"debug","z":"967d56b4.c7f498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":4600,"wires":[]},{"id":"fbba97fb.d0da48","type":"change","z":"967d56b4.c7f498","name":"set payload and headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{\"Content-Type\":\"Application/json; charset=UTF8\",\"X-Accept\":\"application/json\"}","tot":"json"},{"t":"set","p":"headers","pt":"msg","to":"{\"consumer_key\":\"MyKey\",\"redirect_uri\":\"http://google.com\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":4600,"wires":[["4ade6f69.0f7db","f70ce42e.dfb5b8"]]}]

```

---

<div class="post-metadata">

**Author:** ![mtoko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mtoko/32/138_2.png) [@mtoko](https://discourse.nodered.org/u/mtoko)\
**Post date:** [26 January 2021 15:08 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782/2 "2021-01-26T15:08:55Z")

</div>

Have you tried the Pocket node for Node Red?

[node-red-contrib-pocket-api](https://github.com/VNXtreme/node-red-contrib-pocket-api)

---

<div class="post-metadata">

**Author:** ![vongomben](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@vongomben](https://discourse.nodered.org/u/vongomben)\
**Post date:** [26 January 2021 15:39 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782/3 "2021-01-26T15:39:54Z")

</div>

yes.  
I'ts not working to me.  
but maybe somebody was more successfull.

I'm more interested in make a flow that is doing that, because I'm really in need to understand how to interact with these custom apis.

(I will try again it anyway)

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [26 January 2021 15:49 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782/4 "2021-01-26T15:49:35Z")

</div>

In your change node why are you creating / setting two msg.headers.  
Wouldnt the second replace the first ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8bcf86106df8661f588d405ee745011dcdf661b4.png)

Try to merge the headers in one entry.

I have no idea about this Pocket API but from its [Documentation](https://getpocket.com/developer/docs/v3/retrieve) i believe its also required to supply an **access\_token**

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38381dc9a0b22e0f09c1e31ba8e7c23e7c26ff14.png)

---

<div class="post-metadata">

**Author:** ![vongomben](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@vongomben](https://discourse.nodered.org/u/vongomben)\
**Post date:** [26 January 2021 15:52 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782/5 "2021-01-26T15:52:16Z")

</div>

good point.  
I'll come back to this later.  
The access token is given and temporary, You have to request it.

> To begin the Pocket authorization process, your application must obtain a request token from our servers by making a POST request.

---

<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:** [27 March 2021 15:52 UTC](https://discourse.nodered.org/t/interact-with-pocket-apis/39782/6 "2021-03-27T15:52:56Z")

</div>

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