Continue to get a 401 error when attempting to connect through my Reddit API. Curl is working cleanly and pulling credentials and threads but Lindy Agent cannot navigate the login. Is Lindy designed to connect to Reddit in a specific manner? I am using:
Step 1: POST to /api/v1/access_token with client_id/secret (in Basic header) and your Reddit username/password in the body → returns { "access_token": ... }.
Step 2: Use that token with Authorization: bearer … to hit Reddit endpoints like /api/v1/me or /search.
It appears Reddit doesn't have a native OAuth API integration in Lindy, so the only option is the Reddit Scraper Lite - am I correct in this assessment?
Hi Paul J., Are you using HTTP request action? You can also try the run code action which basically supports both Python and JavaScript, and includes libraries like requests for HTTP calls. You can handle the entire Reddit OAuth flow in code. Below is an example code as a starting point: import requests import base64 # Basic auth header auth_string = f"{client_id}:{client_secret}" auth_bytes = auth_string.encode('ascii') auth_b64 = base64.b64encode(auth_bytes).decode('ascii') headers = { 'Authorization': f'Basic {auth_b64}', 'User-Agent': 'YourApp/1.0', 'Content-Type': 'application/x-www-form-urlencoded' } data = { 'grant_type': 'password', 'username': reddit_username, 'password': reddit_password } response = requests.post('https://www.reddit.com/api/v1/access_token', headers=headers, data=data) token = response.json()['access_token'] return token
Hi Sameer - Yes, using HTTP request. URL
https://www.reddit.com/api/v1/access_token
Method
POSTHeaders (Set Manually)
Authorization: Basic BASE64(CLIENT_ID:CLIENT_SECRET)
User-Agent: script:APPNAME:VERSION (by /u/REDDIT_USERNAME)
Content-Type: application/x-www-form-urlencoded
Accept: application/jsonBody (Text, one line)
grant_type=password&username=REDDIT_USERNAME&password=REDDIT_PASSWORD&scope=readVerify Reddit Identity (generic template) URL
https://oauth.reddit.com/api/v1/me
Method
GETHeaders (Set Manually)
Authorization: bearer {{ steps["Get Reddit OAuth Token"].json.access_token }}
User-Agent: script:APPNAME:VERSION (by /u/REDDIT_USERNAME)
Accept: application/jsonMaybe code action is what I need as I can run a Curl successfully but Lindy cannot authenticate
Will come back with results
Had to start from scratch. Chose to use more code blocks rather than HTTP requests. Building this agent, it is repeating the same task to fix the same error, "I see the issue - the AI State nodes (Extract Company Names and Conservative Classification) are missing their exit conditions. Let me fix those and complete your Reddit SaaS Feature Request Harvester agent." It burned through my free credits (I plan to upgrade once I can demonstrate this will work) but am afraid it will just burn through credits once I upgrade cycling through this same error. Any guidance on moving past this? Am I using the product outside its design? Should I be using fewer code blocks?
