Title: Array format missing in API REST API documentation
Last modified: August 22, 2016

---

# Array format missing in API REST API documentation

 *  Resolved [dleeward](https://wordpress.org/support/users/dleeward/)
 * (@dleeward)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-format-missing-in-api-rest-api-documentation/)
 * I’ve been unable to find the format that I need to use to include an array in
   a parameter using the REST API with HTTP.
 * Specifically, the categories and tags request parameters described at [https://developer.wordpress.com/docs/api/1/post/sites/%24site/posts/new/](https://developer.wordpress.com/docs/api/1/post/sites/%24site/posts/new/)
 * [https://wordpress.org/plugins/jetpack/](https://wordpress.org/plugins/jetpack/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-format-missing-in-api-rest-api-documentation/#post-5466023)
 * You should be able to use an array or a string to define tags or categories to
   use in a request.
 * If that doesn’t help, could you send us an email with the code you used, so we
   can take a closer look?
    [http://developer.wordpress.com/contact](http://developer.wordpress.com/contact)
 * Thanks!
 *  Thread Starter [dleeward](https://wordpress.org/support/users/dleeward/)
 * (@dleeward)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-format-missing-in-api-rest-api-documentation/#post-5466026)
 * I understand that, but I’m not a developer and don’t know the format the array
   needs to be in. Can you give me an example?
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-format-missing-in-api-rest-api-documentation/#post-5466041)
 * You can check the examples at the bottom of the documentation:
    [https://developer.wordpress.com/docs/api/1/post/sites/%24site/posts/new/](https://developer.wordpress.com/docs/api/1/post/sites/%24site/posts/new/)
 * As you can see, it includes a part where you define the request parameters. The
   example uses strings:
 *     ```
       array (
           'title' => 'Hello World',
           'content' => 'Hello. I am a test post. I was created by the API',
           'tags' => 'tests',
           'categories' => 'API',
       )
       ```
   
 * You can use arrays instead, like so:
 *     ```
       array (
           'title' => 'Hello World',
           'content' => 'Hello. I am a test post. I was created by the API',
           'tags' => array( 'tests', 'other', 'tag2', 'tag1' ),
           'categories' => array( 'API', 'category2' )
       )
       ```
   
 *  Thread Starter [dleeward](https://wordpress.org/support/users/dleeward/)
 * (@dleeward)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-format-missing-in-api-rest-api-documentation/#post-5466056)
 * I received this answer to my question from Andrew at WordPress.com support:
 * An example using HTTP array:
 * `title=Test&tags[]=onetag&tags[]=twotag`
 * … a new post will be created with two tags: “onetag” and “twotag”. Note that 
   this is supported for the post creation endpoint as a convenience, and other 
   endpoints may only accept the array syntax. Be sure to refer to the documentation
   for the specific endpoint to be sure.
 * Hope it helps someone else as well.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Array format missing in API REST API documentation’ is closed to new 
replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [dleeward](https://wordpress.org/support/users/dleeward/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/array-format-missing-in-api-rest-api-documentation/#post-5466056)
 * Status: resolved