Badges

Gets all of the available badges.

Learn more about APIs.

Minimum Tag

{{ _api.trails.badges.template('template-key') }}

Example Tag

Include only 10 badges that a user can earn.

{{ _api.trails.badges.template('template-key').includeAdmin('no').limit(10) }}

API Tag Parameters

ParameterDescription
availability How to take the availability of the badge into consideration when getting badges. By default only badges that are available to be earned will be returned. Set it to "all" to return both available and unavailable badges. Set it to "no" to only return badges that are not available. Set it to "yes" to return only available badges.

Type: String

Accepted Values:
all, yes, no

Default Value: yes

Example:
availability('all')
includeAdmin Whether or not to include the badges that only an administrator can assign.

Type: String

Accepted Values: yes, no, true or false

Default Value: true

Example: includeAdmin('yes')
instanceKey
i
The key for the instance to get results in. If nothing is passed then the current instance will be used if this is called within the same app.

You can alternately use the short form "i" (lowercase I) instead of "instanceKey"

Type: String

Examples:
instanceKey('app-instance-key')


i('app-instance-key')
limit
l
The number of results to return. Defaults to return all matching results (no limit).

You can alternately use the short form "l" instead of "limit"

Type: Integer

Examples:
limit(5)


l(5)
template
t
Required if responseFormat is not 'data'. The template key of the template to use.

If this is not passed when it's required then nothing will be returned. In some cases, by not passing this parameter you will get just the raw data back.

You an alternately use the short form "t" instead of "template"

Type: String

Examples:
template('template-key')


t('template-key')