Does the include parameter allow multiple values?

Jump to solution
ek
Community Member

Using WordPress and built-in wp_remote_get function:

     $get_webinars = wp_remote_get('https://myurl.instructure.com/api/v1/accounts/6/courses?per_page=100&include[]=syllabus_body', array(
         'headers' => array(
             'Authorization' => 'Bearer ' . $token
         )
     ));‍‍‍‍‍

The above code returns the syllabus_body as an optional include. When I try to add public_description as well:

     $get_webinars = wp_remote_get('https://myurl.instructure.com/api/v1/accounts/6/courses?per_page=100&include[]=syllabus_body,public_description', array(
         'headers' => array(
             'Authorization' => 'Bearer ' . $token
         )
     ));‍‍‍‍‍‍‍‍‍‍

I don't get the syllabus_body or public_description.

Doesn't the include[] parameter mean it can support an array of values?

Labels (1)
1 Solution
pklove
Community Champion

You probably need to repeat the include[]:

     &include[]=syllabus_body&include[]=public_description

View solution in original post