How do I check my inbox messages with the Reddit API?
I Had tried with the documented api and the code is like:
$url = 'https://www.reddit.com/message/inbox.json';
$fields = array (
'after' => null;
'before' => null;
'limit' => 10,
'show' => 'all'
);
$header = array("Authorization:$this->accesstokentype $this->accesstoken");
$credentials = $this->clientid.':'.$this->clientsecret;
$useragent = ' by /u/' . $this->username;
$response = $this->request($url, $fields, 'GET',$header,$credentials,$useragent);
print_r($response);
What am I missing here?
Thany you....
Posted Apr 1, 2019, 10:02 AM UTC
52
The request should be sent to oauth.reddit.com instead of www.reddit.com. Although I don't know PHP, I think the code should be (assuming your access token
$this->accesstokenis valid)Thank you.
But it's working fine with oauth.reddit.com , It was the problem with accesstoken.