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