Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning the reddit JSON API using Apigee. How do I submit a story?

Tags:

json

api

reddit

Accordng to https://github.com/reddit/reddit/wiki/API I need to:

"Post the following to http://www.reddit.com/api/submit:

uh=f0f0f0f0&kind=link&url=yourlink.com&sr=funny
&title=omg-look-at-this&id%23newlink&r=funny&renderstyle=html

I believe uh is the modhash that that you get after loging in like this:

http://www.reddit.com/api/login/joe?user=joe&passwd=passw0rd&api_type=json

But whenever I try to make a submission, I get this:

https://apigee.com/console/apigee-console-snapshots-1317445200000_ba798aaf-165d-40c3-8aec-17673087f9ff/rendersnapshotview

Any help would be greatly appreciated.

like image 427
dot Avatar asked Nov 14 '22 16:11

dot


1 Answers

Be sure that you're sending back the reddit_session cookie they send/set with the login response when you post your submission. You need this as well as the uh/modhash.

like image 69
Phillip B Oldham Avatar answered Jan 03 '23 13:01

Phillip B Oldham