To help you, we need to know what the “my_post” action looks like in your code. Somewhere in your code, there must be an add_route
with “my_post.” Can you show us what it looks like?
add_route('my_post', array(
...
));
By default, you can filter your posts in WordPress using the following route: ?rest_route=/wp/v2/posts/${POST_ID}
.
Related Posts:
- How to: Make JWT-authenticated requests to the WordPress API
- How to use _embed when using _fields?
- WordPress REST API validation
- Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)
- WordPress Rest API: How do we validate with our custom API key?
- Adding WordPress API Endpoint With Multiple Parameters
- authentication issue with rest api – rest_cannot_create
- WP REST API core major changes
- How to get all posts from parent and children categories?
- Match REST API post output from custom endpoint
- Attach featured image to custom endpoints
- WordPress: How to create custom REST API route?
- How to change user avatar using REST API?
- REST API URL parameters not working with apache server
- How to Pull ALL Posts, Categories, or Tags in WordPress REST API
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Query the REST API for a Tag by slug
- Rest API Custom Endpoint with space character
- Build on same WordPress or different install?
- Testing custom API endpoint with class dependency
- apiFetch security
- Not all featured image sizes available in Rest API
- 403 Forbidden with gutenberg
- Application Password is not enable by default?
- Cannot get ‘sanitize_callback’ to work for rest parameters
- Detect if REST API is running
- Using pre_get_posts, how to target the REST API, only?
- Save/update post_meta with Gutenberg from the panel
- How to use current_user_can() in register_rest_route()?
- Set featured image using URL with wp rest api
- How to block all REST API endpoint except which I wrote custom?
- Authentication with internal WP_REST_Request and rest_do_request()
- 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?
- Cannot DIsplay a Snackbar Notice on Button Click – Notice is undefined
- 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
- How to add a custom REST field to limit data when fetching?
- WordPress JSON data to and from database to be shown on rest point
- REST API: best place to set current user for JWT auth?
- “No Access-Control-Allow-Origin header is present” even though it is in the entry file
- REST API authentication for a plugin
- rest api request including meta_query filter
- WordPress REST API V2: how to get list of all posts?
- Getting 401 from ajax using an application password
- How to connect android app with WordPress website?
- WordPress REST API calls that depend on the WordPress User
- Sidebar endpoint using WordPress API
- How to get data from /wp-json/wp/v2/users/me
- Get custom posts in gutenberg block
- WordPress REST API parameters are not affecting a response
- Getting 401 (access denied) when trying to use the REST API
- Update meta_value in wp_postmeta using API
- WordPress plugin with CORS
- WordPress REST API not working on localhost
- REST API – Allow /users endpoint depending on a custom capability
- “Error: cURL error 60: SSL certificate problem: certificate has expired” when create product in WooCommerce via REST API
- 403 Error When Fetching Data from the Settings Rest Route for Non-Admin Users
- How to use WordPress REST api to login a user?
- Create User with Profile and Cover Images using REST API
- Wrong encoding of dynamic block properties problem when loggen in as editor
- What’s the right way to validate JSON data coming from an AJAX POST request?
- Remove unwanted fields from WP API response
- Need wp rest api for featured video post
- WordPress and React how to integrate? [closed]
- WordPress Update Role using API Cross site
- Rest API. Post content
- REST api header link href
- Error rest_post_invalid_page_number trying to call Rest API
- WordPress & React Native
- update meta data (like view counter) by rest-api
- Rest API hook ‘rest_insert_post’ not returning request object
- How Can I keep password protected posts in the json requests but not on frontend queries?
- REST API Integration without user account?
- WP_REST_Request::get_json_params() Parsing null as Zero
- WP REST API with Basic Auth at target website
- API request forbidden when requesting from same domain
- Custom WP Rest API Endpoints from JSON Schema
- Script tag in string in wordpress rest api body to create post
- Customizer Changeset, Sidebar and Rest API Custom Endpoints
- Rest API is running, but /wp-json/wp/v2/ shows only old dates
- Rest Api Error ‘ Error: {‘code’: ‘rest_no_route’, ‘message’: ‘No route was found matching the URL and request method.’, ‘data’: {‘status’: 404}}@ [closed]
- Isn’t rest_do_request() filtered by pre_get_posts() filter?
- Accessing an auth protected custom WP API enpoint from remote origin
- Delay Issue: Using Wget with JSON Endpoint – Need Help Understanding Headers
- get posts from Rest Api by meta_key/meta_value not working
- REST API not Posting Content in Draft Mode
- REST API Schema: how to allows for both empty string or email string
- Displaying posts from one web site to another using REST API
- I made a webhook using snippet plugin, but is not working
- Filtering posts by ACF filed using WP Rest API
- register_sidebar has a bool param show_in_rest what are the repercussions of enabling it?
- I’m seeing “The response is not a valid JSON response.” on a wordpress site
- Field fetched through REST API contains ASCII version of special characters
- Setting default category on post update