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:
- 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
- WP REST API V2 – Retrieve sub page by full slug (URL/Path)
- How to use the WP REST API for new user registration (sign up form)?
- Can I authenticate with both WooCommerce consumer key and JWT?
- WP REST API: check if user is logged in
- 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?
- Rest API and Custom Fields
- WordPress REST API, Expired Nonce from Cache results in 403 forbidden
- WP Rest API: Get User by Email
- 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 hook into “register_rest_field” to modify the behavior of a custom field?
- Get all PDF files from page with WordPress API
- current_user_can(‘administrator’) returns false when I’m logged in
- How to add / embed an author into REST data from a custom post type?
- How to enable the view of revisions of post in WordPress Api for custom post type?
- Problem on creating custom endpoints for REST
- New user signup via REST API
- Ho to style post content for WordPress API?
- WP REST API can’t set post tags
- WP API post__not_in is not working
- PHP: authenticate for a REST request?
- Is it Ok to restrict Access-Control-Allow-Origin for /wp-json requests?
- Validate rest-api call on create
- Error invalid parameters with REST API
- How to get featured image in WP rest api
- Authenticate current user to REST API
- rest api endpoint – accept diacritic characters
- WordPress REST API rest_comment_invalid_author Sorry, you are not allowed to edit ‘author’ for comments
- How to delete user using rest api without reassigning
- How to send the body in wp_remote_post as “raw”?
- Accessing private posts through REST API, same code that works in remote doesn’t in local
- REST API and filtering by meta value
- Rest API: trouble receiving response through script (browser and Postman display correctly)
- Advanced Access Manager: RESTful endpoint to refresh token
- Custom Endpoints not working
- Is there a way I can fetch the WordPress Developer Code References with an API?
- `WP_REST_Controller::get_endpoint_args_for_item_schema` Does Not Set `required` Property from Schema
- Pull in ALL posts from the last two weeks using Rest API
- 403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
- Error message: Response is not a valid JSON response
- How to use query parameters, as “_fields”, to filter data inside an array in the REST API?
- WordPress server banning IP
- Cannot use WordPress Application Passwords: “code”: “rest_no_route” “status”:404 for /wp-json/wp/v2/users/me/application-passwords
- How to add Relations of a CCT from JetEngine via WordPress Rest API
- Pass multiple tags slug to rest API
- Return a WP_REST_Response from an inner function (and not from the root callback)
- register_rest_route with method POST but in wp-json/ is showing GET
- wp_nonce vs jwt
- WP REST API returns empty posts despite entries in wp_posts
- Accessing Custom REST endpoint with rest_do_request()
- How to add taxonomy to a post using WP REST API?
- The REST API encountered an error in wordpress?
- Get wordpress post with featured image, category and tag from WordPress API
- Do something when publish a post in Gutenberg with hook rest_after_insert_post
- Uploading picture via REST API
- How to modify the HTML output of Gutenberg block? (Youtube)
- Extract XML/JSON element from Zillow API response and populate into Gravity Forms field
- Can I use REST API if the site is protected with .htpasswd
- REST API and Loopback error
- Rest API: Register and Login errors aren’t specific
- How can I secure my custom rest api endpoint or add under a already existing rest group
- WordPress single page website redirect to index.html
- How to get the most recently updated orders via the REST API?
- Fetching all users that didn’t post with rest api (current version 2)
- Calling a python script from custom wordpress rest api returns null
- Autotrader API Integration
- WordPress RESTAPI – Restrict unknown
- WordPress Rest API Error 502
- Fix Characters WordPress Ionic App
- Accessing secure endpoint with X-WP-Nonce?
- Return all custom taxonomy terms for post in REST API v2? Currently limited to 10 terms
- Can we use website data which is having wp rest api plugin?
- WP Rest API V2 OR Operator in URL
- how can I add an URL parameter to a rest route using register_rest_route()?
- Is it possible to bulk update a table using WP Rest API?
- Rest api request throttling
- Securing REST API wp-json/wp/v2/users endpoint
- WordPress REST API won’t allow me to filter by author ID when called internally, works externally in Postman
- Rest API is running, but /wp-json/wp/v2/ shows only old dates
- WordPress Application Passwords not authorizing
- Hide custom posts from certain taxonomy in rest api
- Creating Application Password using REST API results in 401 regardless of JWT token
- Rest Api Error ‘ Error: {‘code’: ‘rest_no_route’, ‘message’: ‘No route was found matching the URL and request method.’, ‘data’: {‘status’: 404}}@ [closed]
- How can I get the number of items stored under a cache group
- Restrict APP REST API for users with account and capabilities
- How to call WordPress API Internally
- Application password still works even after user is disabled / expired
- Create Application Password when User Registers
- Custom REST route fetching posts by slug isn’t working
- REST API Schema: how to allows for both empty string or email string
- Using backbone, can I prevent the nonce from being set?
- Field fetched through REST API contains ASCII version of special characters