As per twitter policy, anyone you do not follow can send you a Direct Message if:
a. You have opted in to receive Direct Messages from anyone or;
b. You have previously sent that person a Direct Message.
I am using twitter rest API to send a twitter DM. In the error message I am getting the following response:
twitter4j.TwitterException: 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
message - You cannot send messages to users who are not following you.
code - 150
Why am I getting this error message You cannot send messages to users who are not following you as I can send a DM to someone who has previously send me a DM.
Also, I haven’t hit the daily limit of 1000 DMs in a day.