thebatclaudio / wp-rest-api-v2-menus

Adding menus endpoints on WP REST API v2
47 stars 23 forks source link

full path to wp rest api #1

Closed ghost closed 8 years ago

ghost commented 8 years ago

I can't seem to discover the menu routes. Can you provide a full path example with WP REST API?

<wpsite.com>/wp-json/wp/v2/ ???

thebatclaudio commented 8 years ago

Hi, to access to your menus you must call the following route: www.yoursite.com/wp-json/menus/v1/menus

If you want to access to a specific menu you must call the following route: www.yoursite.com/wp-json/menus/v1/menus/{slug}

ghost commented 8 years ago

I have an existing menu, so there should be data. I'm running WP 4.5.2 and WP REST API 2.0-beta13.

I get this error

{
  code: "rest_invalid_handler",
  message: "The handler for the route is invalid",
  data: {
    status: 500
  }
}
thebatclaudio commented 8 years ago

Hi, i fixed the bug yesterday. If you remove and reinstall the plugin it should work.

ghost commented 8 years ago

It works. You might want to change version number as well. Thanks.

thebatclaudio commented 8 years ago

Thank you for the issue! :)

thomashagstrom commented 4 years ago

Hi, to access to your menus you must call the following route: www.yoursite.com/wp-json/menus/v1/menus

If you want to access to a specific menu you must call the following route: www.yoursite.com/wp-json/menus/v1/menus/{slug}

Why this isn't the first thing in the readme astounds me. Wouldn't have guessed without this issue

thebatclaudio commented 4 years ago

Hi @thomashagstrom, this plugin extends the standard WP API, so I imagine that who use this plugin knows how WP API works.

In plugin's readme you can find the RELATIVE path.

For example:

Get all menus: GET /menus/v1/menus

It means that you have to add /menus/v1/menus to the standard WP API route prefix (that is http://yoursite.com/wp-json/)

I'm sorry that it wasn't clear for you, but I didn't expect that someone would use this plugin without knowing how WP API works.