title: javascript fetching an API json rest cannot access the data
body: <p>This is driving crazy, I have a API json rest that I can access perfectly from thefirefox extension  RESTED and directly from the browser I can see the data but when I tried my code it said "code: "rest_cannot_access", message: "Only authenticated users can access the REST API.". So I don't understand why.</p>
  
  <p>It's a wordpress rest api plugin, and I tried to get the data from fetch javascript.this is the url <a href="http://laprensainsolita.com/wp-json/wp/v2/posts" rel="nofollow noreferrer">http://laprensainsolita.com/wp-json/wp/v2/posts</a></p>
  
  <p>this is my code to test.</p>
  
  <pre><code>    .then(response =&gt; {
        return response.json()
      })
      .then(data =&gt; {
        console.log(data)
      })
      .catch(err =&gt; {
        console.log(data)
      })
  </code></pre>