Jetpack API for WordPress Network

WordPress provided a lovely Json API with Jetpack.

I cannot seem to to find a way, or documentation on getting data from a multisite wordpress install?

Read More

It seems to fail on sites like www.example.com/site1. Any ideas?

Related posts

Leave a Reply

1 comment

  1. I answered my own question.

    The slash in the URL messes up the API call. However urlencoding the URL will get around it.

    IE:

    $context = stream_context_create( $options );
    $site = urlencode("subdomain.example.com/site1");
    $response = file_get_contents(
    'https://public-api.wordpress.com/rest/v1/sites/' . $site .'/',
    false,
    $context
    );