I need to call learndash API from the wordpress for example like this:
wp_remote_request ('https://mywpsite/wp-json/ldlms/v1/groups', $arg);
LearnDash API is protected, so I'm getting 401 response:
{"code":"rest_forbidden","message":"Tut mir leid, aber Sie haben keine Berechtigung das zu tun.","data":{"status":401}}
In the LearnDash API docs, there is no information how one can authenticate call (Which auth header use, what kind of authentication, etc).
How can I authenticate the call to LearnDash ?
I'm not Wordpress expert, but may be there is a standard way to make such authenticated call to plugins' API?
P.S.: LearnDash is installed in same Wordpress installation I need to make a call from, I can't call functions directly, at least I didn't find required functions in LearnDash docs.