I am working on a private portal site for a client and am having issues with getting some data via the REST API.
When try to view the API when not logged in (https://portal.local/wp-json/wp/v2/voyage/198), I see this:
{"code":"rest_not_logged_in","message":"You are not currently logged in.","data":{"status":401}}
When I'm logged in, I can see the data, so that part is working.
It seems like it's the way I am trying to get the data. When I do a var_dump of the response, I am seeing "not logged in" error:
{"code":"rest_not_logged_in","message":"You are not currently logged in.","data":{"status":401}}
Here is my code in pastebin.com: https://pastebin.com/GdDVkzmj