Create post with access_token
-
Hi, i get “access token” (wp_oauth plugin). How create post with REST API?
url is “localhost:8080/blog/wp-json/wp/v2/posts”?
how to make?$curl = curl_init( 'localhost:8080/blog/oauth/token' ); curl_setopt( $curl, CURLOPT_POST, true ); curl_setopt( $curl, CURLOPT_POSTFIELDS, array( 'client_id' => 'GT9DiTPY6WNjGOp7aGvm6hsvCQ4xi4', 'client_secret' => 'HTebdz1TV1KrGd0xQDUofe1JeusMEm', 'grant_type' => 'password', 'username' => 'rogerio_pavan', 'password' => '270184', ) ); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1); $auth = curl_exec( $curl ); print_r ($auth); $auth = json_decode($auth); $access_key = $auth->access_token;
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Create post with access_token’ is closed to new replies.