0

I want to use rest Api with my website i have WP REST API plugin installed but i don't want to get just posts my website is a listing website all my listings are done with this plugin Listing Builder Plugin. Is there a way i can GET and POST listings

0

First of all you should re-submit permalink to enable rest api in your wordpress. your rest api url is: http://your-site.com/wp-json/

And you can register new endpoind with bellow code:

add_action( 'rest_api_init', function () {
    register_rest_route( 'myplugin/v1', '/author/(?P<id>\d+)', array(
        'methods' => 'GET',
        'callback' => 'my_awesome_func',
    ) );
} );
| improve this answer | |
  • This example only shows a GET endpoint without the handler. – jgraup Nov 13 '16 at 15:23
0

You can find all this information in the docs at http://v2.wp-api.org. If you're going to POST new data then you need to be authenticated. http://v2.wp-api.org/guide/authentication/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.