SHARE
TWEET

Untitled

a guest Apr 15th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('init','pictime');
  2. function pictime() {
  3.     if(!is_admin()) {
  4.         $secrete = 'BFE1E6675AC144BDB1351F1001A36616';
  5.        
  6.        
  7.         $client_code = 'AAAAAN0AAACHnqypQnVSy5tVZBE9AkUlpMcQBA5Y1NTL_A,,';
  8.  
  9.        
  10.         $url = 'http://testingapi.pic-time.com/apiV2/accessInfoo?redirectUrl=http://demoflothemes.staging.wpengine.com/narcisse/investment';
  11.         //$url = 'http://productionapi.pic-time.com/apiV2';
  12.  
  13.         // https://testingapi.pic-time.com/oauth?redirectUrl=http://demoflothemes.staging.wpengine.com/narcisse/investment/&responseType=clientToken&appId=AAAAAJ8AAAB4b4VCkAlxpVQhmg
  14.  
  15.         // https://testingapi.pic-time.com/oauth?redirectUrl=http://demoflothemes.staging.wpengine.com/narcisse/investment/&responseType=accessToken&appId=AAAAAJ8AAAB4b4VCkAlxpVQhmg
  16.  
  17.         $args = array(
  18.           'headers' => array(
  19.             'Authorization' => 'Bearer ' . $secrete
  20.           ),
  21.           'body' => array('body-clientCode' => $client_code, 'body-redirectUrl' => 'http://demoflothemes.staging.wpengine.com/narcisse/investment', 'body-appSecret' => 'BFE1E6675AC144BDB1351F1001A36616' )
  22.         );
  23.         $response = wp_remote_request( $url, $args );
  24.  
  25.         // Check the response code
  26.         $response_code       = wp_remote_retrieve_response_code( $response );
  27.         $response_message = wp_remote_retrieve_response_message( $response );
  28.  
  29.         var_dump($response_code);
  30.  
  31.         var_dump($response_message);
  32.  
  33.         var_dump(wp_remote_retrieve_body( $response ));
  34.  
  35.         die();
  36.     }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top