Forums
Forums / Plugin: WordPress REST API (Version 2) / Get navigation menu as post type
(@markor91)
10 years, 5 months ago
I’m trying to get the navigation menu as JSON data.
From WordPress codex: navigation menu is treated as a post type.
From Rest API Doc, this is how we get posts of a type:
GET http://demo.wp-api.org/wp-json/wp/v2/types/<type>
I tried to get it like so:
URL : http://localhost/wptest/wp-json/wp/v2/types/nav_menu_item
I received 403 error.
{"code":"rest_cannot_read_type","message":"Cannot view type.","data":{"status":403}}
the server understood my request but it refused to give the data.
Q: How can I fix this?
https://wordpress.org/plugins/rest-api/
(@danielbachhuber)
Nav menus aren’t yet supported in the REST API
The topic ‘Get navigation menu as post type’ is closed to new replies.