Title: robtown's Replies | WordPress.org

---

# robtown

  [  ](https://wordpress.org/support/users/robtown/)

 *   [Profile](https://wordpress.org/support/users/robtown/)
 *   [Topics Started](https://wordpress.org/support/users/robtown/topics/)
 *   [Replies Created](https://wordpress.org/support/users/robtown/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/robtown/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/robtown/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/robtown/engagements/)
 *   [Favorites](https://wordpress.org/support/users/robtown/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP REST API (WP API)] Syntax for including post_meta when creating a post](https://wordpress.org/support/topic/syntax-for-including-post_meta-when-creating-a-post/)
 *  [robtown](https://wordpress.org/support/users/robtown/)
 * (@robtown)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntax-for-including-post_meta-when-creating-a-post/#post-6105420)
 * I’m not using Pods.
 * None of this worked for me.
 * I also tried setting “feature_image” to an image post id, nothing.
 * Then I inspected an object returned from /wp-json/wp/v2/posts/<id> and noticed
   a “featured_media”: “0” in the json, so I tried setting that value to an image
   post id and it worked.
    so my POST looks like this:
 *     ```
       {
                       method: "POST",
                       url: "http://<domain>/wp-json/wp/v2/posts" ,
                       headers: { 'Authorization' : 'Basic ' + $scope.au },
                       data: {
                       title: $scope.postData.title,
                       content: $scope.postData.content,
                       status: $scope.postData.status,
                       featured_media: $scope.imageid,
                       post_meta: [
                           {
                               "key": "_thumbnail_id",
                               "value":  $scope.imageid
                           }]
                    }
       ```
   
 * I’m still working on getting oAuth1.0a to work correctly, so I’m using Basic 
   Authentication for development.

Viewing 1 replies (of 1 total)