The given WP Webhooks Pro API Key is not valid, please enter a valid API key and
-
I’ve installed WP Webhooks at my online server. From dashboard, I got the api key :
whpro_api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxBut when I try to post requset, I got this reply: “The given WP Webhooks Pro API Key is not valid, please enter a valid API key and”.
I’ve tried to post following data through php cURL,
'type' =>'room_init', 'token'=>'example-token-ODcdPc', 'userid'=> 'example-user-tEzhcA', 'timestamp' =>'2020-05-19T16:01:49.157Z'
When I try using localhost with another api key, the server replies that custom action si successfully fired. But in web server it shows api key isn’t valid.
My code:
<?php $url= 'https://localhost/wordpress/class/?action=custom_action&wpwhpro_action=class_link&wpwhpro_api_key=xxxxxxxxxxxxxxxxxxxxxxxx'; $url='https://pias.epizy.com/wp/?action=custom_action&wpwhpro_action=class_link&wpwhpro_api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //Initiate cURL. $ch = curl_init($url); //The JSON data. $wp_webhooks= array( 'type' =>'room_init', 'token'=>'example-token-ODcdPc', 'userid'=> 'example-user-tEzhcA', 'timestamp' =>'2020-05-19T16:01:49.157Z' ); //Encode the array into JSON. $jsonDataEncoded = json_encode($wp_webhooks); //Tell cURL that we want to send a POST request. curl_setopt($ch, CURLOPT_POST, 1); //Attach our encoded JSON string to the POST fields. curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded); //Set the content type to application/json curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //Execute the request $response = curl_exec($ch); curl_close($ch); // Check for errors if($response === FALSE){ die('Error'); } else { echo $response; } // Decode the response $responseData = json_decode($response, TRUE); print("<pre>".print_r($responseData,true)."</pre>"); ?>
- This topic was modified 4 years, 6 months ago by . Reason: typing mistake
- This topic was modified 4 years, 6 months ago by .
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘The given WP Webhooks Pro API Key is not valid, please enter a valid API key and’ is closed to new replies.