Reddit OAuth2 API Connection

Hey everyone! Hopeing someone might be able to help with Reddit OAuth2 API using API Connector.

I’ve read through the documentation, set up the app with Reddit, and should be good to go on their side.

When I initialize I get that what’s being returned isn’t JSON. When I switch the data type to XML, I get back a ton of fields, but it looks like Reddit is returning an HTML message , which I assume is an error of some type. When I try to look at the raw data, my browser freezes…it’s a lot of data. I’m assuming it doesn’t make a difference anyway, because it’s supposed to be returning JSON, but not. I put a screen shot of the first portion of the returned values, but pretty sure it’s an error.

I have a simple use case. I’d like to do a dynamic search (q) and return the top relevant posts, then save the title, post date, and url to my database. So, no user posting or logins required.

Reddit OAuth2 Documentation: OAuth2 · reddit-archive/reddit Wiki · GitHub
Reddit API Specifications: api documentation

Here’s what I’ve got so far

What I get when I switch to XML as data source

Thanks for the help!

On the first screnshot, you didn’t seem to have intialized the authentication part. For that you first need to add a page with action login to social network. You will not be able to initialize any call before that.
What you get in your second page is probably an error page message. Keep JSON as type but initialize it after you have completed the authentication step. (Read the warning in the auth section)
Also, be sure that the me endpoint will return the email and id with the key you have set

@Jici , thanks for the reply and initial help. I ended up finding a solution, and post it here for those who may have a similar requirement.

The API connector wasn’t able to handle this connection so I followed this tutorial by Jacob Gershkovich. It’s really helpful.

In short, I handled the OAuth manually, then used the GET request through he connector to accomplish what I was looking for.

Here’s my set up, but your workflow for your use case may be different.

Like @Jici said , I added a login button, and handled the URL/Parameters through the navigating to external website workflow.

Follow documentation at: OAuth2 · reddit-archive/reddit Wiki · GitHub

Reddit API Manual 3

Workflow to save the code received from Reddit. Take note of the condition if the parameter “code” is not empty. I’ll also take that code and use the api action to exchange the code for the token, then save it. My workflow is a bit clumsy and will more than likely update it later, but for now, it works.

NOTE: this is not published in any Reddit documentation. The code that you receive back from Reddit adds “#_” and you’ll have to remove this portion. I used “find and replace.” I had so many failures until I found this in a buried reddit comment.

In the API Connector, I then set up the POST Action to send code for the token, as well as the GET Search action, which was my ultimate goal. There are some dynamic values in my set up, but I didn’t do that until I initialized and tested the actions. Just follow the video and you’ll be good to go on this. I also had the “version-test” in the URI initially, but deleted that portion of in all of the locations (Reddit app, Initial login action, and the exchange code for token api.

Here’s my workflow to perform the dynamic search. In my use case, I wanted to click on the text and search reddit for that text, then display the list in a repeating group.

Take note of the “Bearer” infront of the

Hope that help someone in the future.