API oauth signature not valid
-
Hi All,
I am trying to get API response from “https://test.torshtalent.com/”. To get response from this server they are recommend to use an existing OAuth(version 1.0) library to generate this signature and authorization.
in my WordPress plugin i am using “wp_remote_post()” to send oauth keys and values like below
I am generating required OAuth values by using OAuth.php(external PHP library) and passing these values to “wp_remote_post” function.
$response = wp_remote_post( $url, array( 'body' => array( 'oauth_consumer_key' => $cc_key, 'oauth_version' => '1.0', 'oauth_nonce' => $nonce, 'oauth_timestamp' => $timestamp, 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_signature' => $signature, 'oauth_token' => '*******', 'API method' => 'Get Users Groups', 'email' => '************' ) )); if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); echo "Something went wrong: $error_message"; } else { echo 'wp_remote_post Response:<pre>'; print_r( $response ); echo '</pre>'; }
wp_remote_post response in else part like below
{"error":true,"reason":"API oauth signature not valid"}
.Note: I am checking these same OAuth values in google chrome “POST MAN” tool and the tool response is “success” like below.
{"success":true,"message:":"******************"}
.Can please help me guys on this issue, Thanks in advance.
- The topic ‘API oauth signature not valid’ is closed to new replies.