Title: Using json api on a multisite
Last modified: January 24, 2017

---

# Using json api on a multisite

 *  Resolved [mskogly](https://wordpress.org/support/users/mskogly/)
 * (@mskogly)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-json-api-on-a-multisite/)
 * I seem to have hit a snag when trying to access the json of a network subsite
   on the url p3.no/musikk/, as wp reads the last part of the url as a part of the
   REST-path.
 * How does one solve this?

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

 *  Thread Starter [mskogly](https://wordpress.org/support/users/mskogly/)
 * (@mskogly)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-json-api-on-a-multisite/#post-8691615)
 * Answer to my own question: Using urlencode
 * Via
    [http://wordpress.stackexchange.com/questions/96069/jetpack-api-for-wordpress-network](http://wordpress.stackexchange.com/questions/96069/jetpack-api-for-wordpress-network)
   [http://meyerweb.com/eric/tools/dencoder/](http://meyerweb.com/eric/tools/dencoder/)
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-json-api-on-a-multisite/#post-8694204)
 * Another alternative would be to run your queries using the Jetpack Site ID instead
   of a URL. In your example, the site ID is `45065944`. That ID is returned in 
   most queries in the `site_ID` field.
 * I hope this helps.
 *  Thread Starter [mskogly](https://wordpress.org/support/users/mskogly/)
 * (@mskogly)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-json-api-on-a-multisite/#post-8695590)
 * Thanks Jeremy. Is there a way to find that id without first doing the urlencode
   trick to get the json containing the site_ID?
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-json-api-on-a-multisite/#post-8697346)
 * If you’re on the site, you can use `Jetpack_Options::get_option( 'id' )` to get
   the site ID.
 * Another option would be to query the `/me/sites` endpoint to get a list of all
   the sites you’re connected to. Each site in the array of responses will include
   an `ID` field.

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

The topic ‘Using json api on a multisite’ 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/)

## Tags

 * [json](https://wordpress.org/support/topic-tag/json/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/using-json-api-on-a-multisite/#post-8697346)
 * Status: resolved