Title: [Plugin: JSON API] Help with (4.6. Attachment response object)
Last modified: August 20, 2016

---

# [Plugin: JSON API] Help with (4.6. Attachment response object)

 *  [generalChaos](https://wordpress.org/support/users/generalchaos/)
 * (@generalchaos)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-json-api-help-with-46-attachment-response-object/)
 * I am a big fan of the JSON API plugin, great job and thanks so much. I am learning
   how to work with json and jquery and am trying to limit the information I get
   back from a request. I have been able to use the include and custom field options
   successfully but amd falling a little short understanding 4.6. Attachment response
   object. Is there a way to limit the result to only provide thumb images? If so,
   can anyone provide an example of the syntax. I am not sure how to address these
   objects in the query string. Any help would be awesome. Let me know if I need
   to clarify anything.
 * Regards,
    Fellow JSON API fan
 * [http://wordpress.org/extend/plugins/json-api/](http://wordpress.org/extend/plugins/json-api/)

Viewing 1 replies (of 1 total)

 *  [cmunns](https://wordpress.org/support/users/cmunns/)
 * (@cmunns)
 * [14 years ago](https://wordpress.org/support/topic/plugin-json-api-help-with-46-attachment-response-object/#post-2199748)
 * You can use the filter they provide to unset whatever sizes you don’t need
 *     ```
       add_filter('json_api_encode', 'my_encode_attachments');
   
       function my_encode_attachments($response) {
         if (isset($response['posts'])) {
           foreach ($response['posts'] as $post) {
       		foreach ($post->attachments as $attachment){
       			unset($attachment->images['full']);
       			unset($attachment->images['thumbnail']);
       		}
           }
         }
         return $response;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: JSON API] Help with (4.6. Attachment response object)’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-api.svg)
 * [JSON API](https://wordpress.org/plugins/json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [cmunns](https://wordpress.org/support/users/cmunns/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/plugin-json-api-help-with-46-attachment-response-object/#post-2199748)
 * Status: not resolved