cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ek
Community Participant

Does the include parameter allow multiple values?

Jump to solution

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)
Tags (2)
1 Solution

Accepted Solutions
pklove
Community Champion

You probably need to repeat the include[]:

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

View solution in original post

3 Replies
pklove
Community Champion

You probably need to repeat the include[]:

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

View solution in original post

dgrobani
Community Champion

Yep, that's what's worked for me with calls to other endpoints.

ek
Community Participant

Perfect, thanks Peter!