SR
Click to open github profile
Js Craftcms Api

Methods

Get an overview of all the methods of js-craftcms-api.


This API allows building urls for Craft CMS elements (addresses, assets, entries, and users) by providing a querybuilder.

Supported Element Types

Each element type has its own set of available methods. This ensures precise control and great type safty.

  • Addresses
  • Assets
  • Entries
  • Users
Note

Categories, Tags and Globals are not supported because they may be deprecated in the future.

Special Methods

These are methods available for all element types and are not native in Craft CMS.

MethodDescriptionType
fieldsSelect specific fields to retrieve.string or string[]
buildBaseUrlBuild the url for one() or all()one or all

Address Methods

MethodDescriptionType
addressLine1Filter by first line of address.string
addressLine2Filter by second line of address.string
addressLine3Filter by third line of address.string
fullNameFilter by full name.string
idFilter by unique identifier.number
limitLimit the number of results returned.number
localityFilter by city or locality.string
offsetSet an offset for pagination.number
orderByDefine sorting order.string
organizationFilter by organization name.string
statusFilter by status.string

Asset Methods

MethodDescriptionType
filenameFilter by file name.string
idFilter by unique identifier.number
kindFilter by asset type (e.g., "image").string
limitLimit the number of results returned.number
offsetSet an offset for pagination.number
orderByDefine sorting order.string
siteFilter by site handle.string
siteIdFilter by site ID.number
statusFilter by status.string
volumeFilter by asset volume.string

Entry Methods

MethodDescriptionType
idFilter by unique identifier.number
limitLimit the number of results returned.number
offsetSet an offset for pagination.number
orderByDefine sorting order.string
postDateFilter by post date.string
sectionFilter by section handle.string
siteFilter by site handle.string
siteIdFilter by site ID.number
slugFilter by entry slug.string
statusFilter by status.string
uriFilter by entry URI.string or string[]

User Methods

MethodDescriptionType
emailFilter by email address.string
fullNameFilter by full name.string
groupFilter by user group.string
groupIdFilter by user group ID.number
hasPhotoFilter users with profile photos.boolean
idFilter by unique identifier.number
limitLimit the number of results returned.number
offsetSet an offset for pagination.number
orderByDefine sorting order.string
statusFilter by status.string

Copyright © 2024 Samuel Reichör