Title: Using JSON-API with custom post type
Last modified: August 30, 2016

---

# Using JSON-API with custom post type

 *  [vthierry](https://wordpress.org/support/users/vthierry/)
 * (@vthierry)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/using-json-api-with-custom-post-type/)
 * json-api is a real well designed and very useful plugin and we evaluate its use
   for [https://pixees.fr](https://pixees.fr) consisdering custom types (not yet
   on line), sounds really excellent.
 * The «however» ?
 *  when applying on a custom-type we got a strange answer, e.g. [http://localhost/wordpress/?quizz=test-de-json&json=1](http://localhost/wordpress/?quizz=test-de-json&json=1)
   response is
 * > <div style=’margin: 10px;’>[HERE COMES THE WHOLE UNESCAPED POST CONTENT]</div
   > >{“status”:”ok”,”post”:{“id”:5183,”type”:”quizz”,”slug”:”test-de-json”,”url”:”
   > http:\/\/localhost\/wordpress\/?quizz=test-de-json”,”status”:”publish”,”title”:”
   > Test de question”,”title_plain”:”Test de question”,”content”:”\n”,”excerpt”:””,”
   > date”:”2015-08-15 12:19:49″,”modified”:”2015-08-26 14:07:50″,”categories”:[],”
   > tags”:[],”author”:{“id”:1,”slug”:”pixees”,”name”:”pixees”,”first_name”:””,”
   > last_name”:””,”nickname”:”pixees”,”url”:””,”description”:””},”comments”:[],”
   > attachments”:[],”comment_count”:0,”comment_status”:”closed”,”custom_fields”:{“
   > quizz_json”:[“{\r\n \”choices\”: [\r\n \”Oui\”,\r\n \”Non\”,\r\n \”Ne sait 
   > pas\”\r\n ],\r\n \”multiple\”: false,\r\n \”text\”: 40,\r\n \”regex\”: \”\/(
   > Oui|Non)\/\”\r\n}”], ../..}},”next_url”:”http:\/\/localhost\/wordpress\/?quizz
   > =quoi”}
 * In other word: it echoes the content 1st and then the (completely correct) JSON
   structure without the post content.
 * _Is this a (i) bad use on my side or a (ii) tiny bug or caveat ?_
 * I really guess it is (i) but i fail to figure out why (e.g., this may be related
   to a spurious definition of my custom type ?)
 * [https://wordpress.org/plugins/json-api/](https://wordpress.org/plugins/json-api/)

The topic ‘Using JSON-API with custom post type’ 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/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * 0 replies
 * 1 participant
 * Last reply from: [vthierry](https://wordpress.org/support/users/vthierry/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/using-json-api-with-custom-post-type/)
 * Status: not resolved