1. Home
  2. Docs
  3. Method Calls
  4. List
  5. List Coaches Parameters

List Coaches Parameters

per_page

The per_page parameter limits the items returned in a single call. This can be used to limit the number of responses, and is most useful in combination with other parameters to achieve paged calls.

https://content.sorce.io/wp-json/api/v1/coaches/?per_page=2

Returns

Returns a list of 2 coaches.

Default

100


page

The page parameter is an alias of the offset parameter and will return the second, third, etc. page of results, where the offset is the per_page value. Without an explicit per_page this argument is not very useful as the default is 100 and it is unlikely that we will ever even have a second page of coaches anytime soon.

https://content.sorce.io/wp-json/api/v1/coaches?per_page=3&page=2

Returns

Returns a list of three coaches, skipping the first three and starting on the fourth.

Default

no value


offset

The offset parameter will skip a number of records. Offset is similar to page, except that it requires an explicit numeric value instead of defaulting to the per_page default.

https://content.sorce.io/wp-json/api/v1/coaches?offset=3

Returns

Returns a list of 100 coaches, skipping the first three and starting on the fourth.

Default

no value


categories

The categories parameter can be used numerically or in human readable values. The parameter can be called with a single value or a comma separated list of values. It will retrieve a list of coaches who either have a matching category assigned. The categories will now ignore the primary_category value, but they can be combined.

While not recommended, the categories parameter can mix string and numeric

https://content.sorce.io/wp-json/api/v1/coaches/?categories=9,13,4

https://content.sorce.io/wp-json/api/v1/coaches/?categories=Mindfulness,Nutrition,Fitness

https://content.sorce.io/wp-json/api/v1/coaches/?categories=9,Nutrition,17

https://content.sorce.io/wp-json/api/v1/coaches/?categories=Nutrition&primary_category=Fitness

Returns

Returns a list of coaches filtered for the category. Multiple values return an OR list, where categories=Mindfulness,Nutrition will return items from either category with no requirement that the item have both categories at once. An unrecognized numeric or string value will filter out all results if it is the only category.

Default

No value


primary_category

The primary_category parameter can be use numerically or in human readable values. It can called with a single value or a comma separated list of values. It will retrieve a list of coaches whose primary_category value matches one of the values.

https://content.sorce.io/wp-json/api/v1/coaches/?primary_category=Fitness

Returns

Returns a list of coaches filtered for the primary_category.

Default

No value


order & orderby

The order and orderby parameters allow you to sort results. The default value for order is ASC for ascending order, lowest to highest, and default orderby parameter is ID. This sorts coach results by the lowest ID first, or newest coaches last.

  • orderby (string|array) – Sort retrieved users by parameter. Defaults to ‘ID’. It can be a string with a single field, a string containing a list of values separated by commas or spaces, or an array with fields.
    • ‘ID‘ – Order by user id.
    • ‘display_name‘ – Order by user display name.
    • ‘name‘ / ‘user_name‘ – Order by user name.
    • ‘include‘ – Order by the included list of user_ids (requires the include parameter) (since Version 4.1).
    • ‘login‘ / ‘user_login‘ – Order by user login.
    • ‘nicename‘ / ‘user_nicename‘ – Order by user nicename.
    • ‘email‘ / ‘user_email‘ – Order by user email.
    • ‘url‘ / ‘user_url‘ – Order by user url.
    • ‘registered‘ / ‘user_registered‘ – Order by user registered date.
    • ‘post_count‘ – Order by user post count.
    • ‘meta_value‘ – Note that a ‘meta_key=keyname’ must also be present in the query (available with Version 3.7).
    • ‘meta_value_num‘ – Note that a ‘meta_key=keyname’ must also be present in the query (available with Version 4.2).
  • order (string) – Designates the ascending or descending order of the ‘orderby‘ parameter. Defaults to ‘ASC’.
    • ‘ASC‘ – ascending order from lowest to highest values (1, 2, 3; a, b, c).
    • ‘DESC‘ – descending order from highest to lowest values (3, 2, 1; c, b, a).

https://content.sorce.io/wp-json/api/v1/coaches/?categories=Nutrition&order=DESC&orderby=display_name

Returns

Returns a list of coaches filtered by parameters, ordered by the various options. The example call returns all coaches in the Nutrition category ordered by Display Name in descending order.

Default

order : ASC

orderby : ID


search & searchby

The search and searchby parameters allow you to search coaches. The searchby field is an alias of the clunkily-named search_columns.

  • search (string) – Searches for possible string matches on columns. Use of the * wildcard before and/or after the string will match on columns starting with*, *ending with, or *containing* the string you enter.
  • search_columns (array) – List of database table columns to matches the search string across multiple columns.
    • ‘ID‘ – Search by user id.
    • ‘user_login‘ – Search by user login.
    • ‘user_nicename‘ – Search by user nicename.
    • ‘user_email‘ – Search by user email.
    • ‘user_url‘ – Search by user url.

https://content.sorce.io/wp-json/api/v1/coaches/?search=Cassidy

Returns

Returns a list of coaches by search term.

Default

search : wildcard search ( *searchterm* )

searchby : ‘display_name’, ‘user_email’, ‘user_nicename’, ‘user_url’

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *