The answer for me was setting the X-WP-Nonce with the wpApiSettings.nonce in the headers.
Related Posts:
- Nonce retrieved from the REST API is invalid and different from nonce generated in wp_localize_script
- REST API: Backbone and custom endpoint
- Gutenberg custom block plugin with custom image sizes
- Get loading state of wp data selector
- WP REST – video and audio players
- Headless WordPress: How to authenticate front end requests?
- Post to WordPress using REST API from external site
- How to handle malformed response from WP REST API?
- Rest API authentication issue when called from fetch request in bundle.js
- Get HTTP response code on non-2xx apiFetch request
- Rest API invalid nonce with Backbone Client
- WP REST API Post Status Using JavaScript
- How to transform a legacy widget into a block
- Authentication with the Rest API when using an External Application
- Get Block Attributes in JSON REST API
- Setting/unsetting terms using the Backbone JavaScript client
- Checks when fetching data from multiple REST API endpoints in Gutenberg
- Search for a keyword across post types in a Gutenberg component
- Using apiFetch for retrieving post data in Gutenberg
- Get terms of a taxonomy using useSelect
- Return ‘X-WP-Total’ from headers in response
- How to render WP Rest-API Endpoints in a React.js Theme with Woocommerce
- Retrieving data about comments and likes
- how to use nimble-API and Display data?
- Check if user can in javascript
- wp-api Backbone JS Client fetch options
- Why does my array sort order changes when I pass it to JS using WP_REST_Response?
- Rest API and how to deal with it in server side
- Access checks with custom REST endpoints and backbone
- [Vue warn]: Error in render: “TypeError: Cannot read property ‘wp:featuredmedia’ of undefined – REST API
- Update block once an API request returns with a value
- Get user in rest API endpoint
- How to improve WP-Rest atrocious response time?
- I would like to retrive JSON value and display it in wordpress page or widget
- Connecting a wordpress site to an AngularJS APP
- WP REST API – “rest_user_cannot_view” ONLY on specific users
- Get Comment Text via REST API
- How to change CSS using jQuery?
- How to properly use jsPDF library
- Start script missing error when running npm start
- Loop through an array in JavaScript
- What does this symbol () => mean in Javascript? [duplicate]
- What is Virtual DOM?
- How to you store data for each discord user in the discord server?
- jQuery Get Selected Option From Dropdown
- How to create multidimensional array
- Open a URL in a new tab (and not a new window)
- Unexpected token u in JSON at position 0 (but only sometimes)
- Get the last item in an array
- (change) vs (ngModelChange) in angular
- You should not use Route or withRouter() outside a Router when using react-router 4 and styled-component in react
- React-Router only one child
- What is the most efficient way to deep clone an object in JavaScript?
- ReactJS: setTimeout() not working?
- Mouseover & Mouseout w/ Javascript
- Most efficient way to convert an HTMLCollection to an Array
- React Uncaught Error: Target container is not a DOM element [duplicate]
- What is the difference between node.js and io.js?
- module.exports vs exports in Node.js
- What does ‘:’ (colon) do in JavaScript?
- JavaScript getElementByID() not working
- How to send an email from JavaScript
- How can I check if an element exists in the visible DOM?
- XMLHttpRequest status 0 (responseText is empty)
- How to define Global Arrays?
- JavaScript post request like a form submit
- SyntaxError: Unexpected token C in JSON at position 0 – Ionic 2 Http GET request
- Is there a simple way to make a random selection from an array in JavaScript or any other programming language?
- jsPDF fromHTML() does not show HTML
- Uncaught Invariant Violation: Rendered more hooks than during the previous render
- Get cookie by name
- jQuery equivalent of querySelector
- document.getElementById().value doesn’t set the value
- How to remove part of a string?
- How to run a function when the page is loaded?
- Convert normal date to unix timestamp
- anchor jumping by using javascript
- jQuery scrollTop() method not working
- FormData append not working
- How to convert binary string to decimal?
- Set CSS property in JavaScript?
- how to write javascript code inside php
- JSLint is suddenly reporting: Use the function form of “use strict”
- How do I install Angular 2 using NPM?
- Detecting a mobile browser
- jQuery .animate() not working
- Extend core block in Gutenberg
- Is it possible to enqueue the Youtube API script or does it have to be inline?
- Correctly handling WordPress core data retrieval in Gutenberg
- Javascript not included
- Gutenberg RichText
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- Accessing customizer values in javascript
- How do display simple page for printing product info? [closed]
- Unwanted line break before
- What is the “proper” way to generate a javascript variable depending on a custom field value?
- WordPress Media Library: Custom tab content displayed in “Media Library” tab
- Manually mark imported photo as selected in media library
- How to retrieve data from database, then pass it to Javascript?
- Weird links found in wordpress footer