When you create or update a post, you can pass a featured_media
argument in the POST
data containing the media file’s post ID. (It appears you need to have the media item’s post ID, not the URL, for this to work.)
Related Posts:
- Is the WordPress REST API installed and enabled in a vanilla WordPress 4.7 installation?
- check the requesting url
- WP REST API Require Password for GET Endpoint
- How to use _embed when using _fields?
- WP REST API V2 – Retrieve sub page by full slug (URL/Path)
- Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)
- WP REST API core major changes
- How to use the WP REST API for new user registration (sign up form)?
- Can I authenticate with both WooCommerce consumer key and JWT?
- Attach featured image to custom endpoints
- WP REST API: check if user is logged in
- REST API URL parameters not working with apache server
- Adding post fields in wp-json/wp/v2/search
- Unable to get the info of the user which doesn’t have created any post via REST API
- WordPress Gutenberg get page template value when post updated?
- Can’t GET draft posts via REST API from headless frontend
- How to update custom meta fields with rest api?
- Query the REST API for a Tag by slug
- Rest API Custom Endpoint with space character
- apiFetch security
- Rest API and Custom Fields
- WordPress REST API, Expired Nonce from Cache results in 403 forbidden
- WP Rest API: Get User by Email
- Application Password is not enable by default?
- Gutenberg Custom Block Getting All Posts
- Can we assume that /wp-json/ will always be /wp-json/ under any circumstances when creating custom REST routes?
- Passing a borrowed nonce through Postman fails
- How to block all REST API endpoint except which I wrote custom?
- WP REST API GET Requests require authentication
- What’s the “?P” register rest api construct, what is for and where to find official docs?
- WordPress REST API json – How to activate gzip compression?
- Custom Post Type and Custom REST API Endpoint result in Gutenberg editor not working
- rest_sanitize_value_from_schema doesn’t sanitize string
- Erratic OAuth 1.0 Signature Mismatch Errors
- WordPress custom endpoint returning blank response
- How to force JWT auth for default GET endpoints of WordPress rest api?
- WordPress Rest API custom endpoint for RSS feed
- REST API: best place to set current user for JWT auth?
- rest api request including meta_query filter
- WP_REST_Response() doesn’t seem to return the expected object
- Setting ?context=edit results in rest_forbidden_context, even for an Administrator user
- Filter DELETE REST API calls
- How to call wp plugin REST functions without curl?
- WP Rest Api- Update callback (POST request) to existing database table through the rest api
- Save default options as an array of options and display in REST API
- Disable part of endpoints wordpress api
- Get a term object using getEntityRecords
- WordPress REST Api get posts by ID
- Backbone with custom rest endpoints
- rest Api jwt authentication for get methodes
- [Zapier + WP Webhooks Pro]: Custom Fields get cut off at first comma or semicolon
- Which route in the WP REST API do I access data passed into register_setting()?
- How to use Python to create a Post in WordPress?
- Send a get request to wordpress
- How to add an endpoint to WP
- How to set up the REST API to refer to media on a CDN
- Best Authetication between REST API and Mobile App
- Replace content via rest api only?
- WP rest api endpoint protection using jwt token
- WP Rest API – Change response status code for failed validation request
- Unable to create a Rest end-point
- Log in user using WordPress REST API
- Can i fetch the list of pouplar posts of last 24 hours from WordPress API?
- IIS Authorization Rules breaks WP REST-API and results in fail in Site Health
- How to delete all instances of the image using REST API
- REST API connection on another site with post information and permalink
- Performance of WordPress Rest API vs WordPress Feeds
- trigger WordPress rest any API call
- WordPress Rest Api rest_cannot_edit
- how to create JSON array [] for REST response?
- Getting 401 unauthenticated error in WP Rest API revisions
- How to receive JSON payload from a digital device
- WordPress Custom Rest Api – How to get Image Url?
- Remote publishing using WP’s RetAPI // Issues with HTACCESS
- save_post hook error with REST API
- Connecting WordPress with an External API
- Users REST API not working?
- Using WordPress solely as a Backend – dealing with WP_SITEURL
- use WordPress Rest API to build a web application
- order by meta start_dato value (ACF)
- REST Request Post including meta/custom fields
- Display Post Featured Image along with Categories via WP Rest API
- Why wp_set_password not working within a api endpoint?
- WordPress api returns distinct data
- Redefine REST API variables
- Handling _embed for custom REST API endpoints
- Restructure Objects coming from Rest-Api
- Where is the HTML content for my post in the API
- WordPress Rest API Escapes Returned URLs Forward Slash
- Is my WordPress site handing out sensitive information/misconfigured?
- Delete row from table using custom endpoint via API
- Fetch post by author slug
- Cant POST with REST API on WordPress
- How can I set the default ‘orderby’ and ‘order’ parameters for a REST API call?
- get the current logged in user using WooCommerce API in React App [closed]
- Problem with custom WordPress Rest API search route with query parameters
- What filtering is available for backbone.js?
- How to limit what fields are returned through the WP API Backbone JS client
- Woocommerce API for calling products by Category ID
- wordpress rest api authentication failed