DESCRIPTION
This error you must be getting while making query developer console OR query using api. It’s because of fact that you don’t have permission to access org using API.
SOLUTION
If Issue is taking place in developer console
Quick way to fix it to give permission “Use any API client” using profile or permission set.

NOTE: If you do not find “Use any API client” then try to enable the permission “API Enabled”.
If you are using connected App
This is happening because of connected app is not configured correctly.
On ‘API (Enable OAuth Settings)‘ panel, move ‘Access and manage your data (api)‘ option from left to right of Selected OAuth Scopes field and then save the setting.

TIP: Wait for few minute and then try. It should work.

You’re so awesome! I do not suppose I have read
through anything like this before. So nice to find somebody with a few genuine thoughts on this issue.
Seriously.. thanks for starting this up. This web site is one thing that is needed on the web, someone
with a little originality!
Hello there I am so excited I found your blog page, I really found
you by accident, while I was searching on Aol for something else, Anyhow I am here now
and would just like to say many thanks for a incredible post and a all round
interesting blog (I also love the theme/design), I don’t have time to go through it all
at the minute but I have saved it and also added in your RSS feeds, so when I have
time I will be back to read more, Please do keep up the excellent
jo.
Highly energetic blog, I enjoyed that bit. Will there be a part 2?
If some one wishes to be updated with hottest technologies after that
he must be go to see this website and be up to date every day.
Hello, i feel that i saw you visited my weblog thus i came to return the
favor?.I’m trying to find issues to enhance my website!I guess its ok
to use a few of your concepts!!
Hell to every one, sincce I am genuinely keen oof reading this website’s post to be updated regularly.
It carries nice data.
Hello there! Would you mind if I share your blog with my twitter group?
There’s a lot of people that I think would really appreciate your content.Please let me know.
Thanks!
Very good info. Lucky me I discovered your blog by accident.
I have book-marked it for later!
This text is priceless. When can I find out more?
Thiis is the perfect blog ffor anybody who hopes to find out about
this topic. You definitely put a brand new spin on a topic
which has been discussed forr decades.Wonderful stuff, just excellent!
Great delivery. Great arguments. Keep up thee amazing spirit.
Very good post! We wil be linhking to this great content oon our website.Keep up the great
writing!
Hi there too every body, it’s my first pay a quick visit of this website;
this blog contains awesome and genuinely excellent data for visitors.
Hello, this weekend is fastidious in support of me, because this point in time i am reading this fantastic educational
article here at my home.
Hello everybody, here every person is sharing these
experience, so it’s fastidious to read this web site,
and I used to visit this weblog daily.
Woah! I’m really loving the template/theme of
this blog. It’s simple, yet effective. A lot of times it’s challenging
to get that “perfect balance” between superb usability and visual appearance.
I must say that you’ve done a very good job with this. Additionally,
the blog loads super fast for me on Internet explorer.
Exceptional Blog!
Hi, Neat post. There is an issue with your site in internet explorer,
may test this? IE nonetheless is the market leader and a large section of people will
leave out your magnificent writing due to this problem.
With thanks for sharing your superb website!
This post is actually a fastidious one it helps new net users, who
are wishing in favor of blogging.
Hey there! I could have sworn I’ve been to this site before
but after browsing through some of the post I realized it’s
new to me. Nonetheless, I’m definitely delighted I found it and I’ll be bookmarking and checking back frequently!