REST API – authentication does not work
-
I’d like to use the API but I can not authorize.
I use the manual from here:
https://imsas.github.io/wpdm-rest-api-docs/#authentication//No matter which of the methods I use, I always get the same error
$authorization = 'Authorization: Basic {base64("xxxx:yyyyyyy")'; //$authorization = 'Authorization: Bearer KEY_CREATED_IN_WPDM_API_PUGIN'; $url = "https://xxxxx.com/wp-json/wpdm/v1/packages/"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $authorization ); curl_setopt($curl, CURLOPT_HTTPHEADER, "Content-Type: application/json" ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $resp = curl_exec($curl); curl_close($curl); var_dump($j_result); Result = {"code":"rest_forbidden","message":"You cannot view the post resource.","data":{"status":401}}"
Does the API really work or where is my mistake?
Thank you for your help
Uli
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘REST API – authentication does not work’ is closed to new replies.