All Collections
Develop
PassKit API
Pass Templates, Locations, Beacons & Links: Filtering, Listing and Counting by API
Pass Templates, Locations, Beacons & Links: Filtering, Listing and Counting by API

Filter templates, locations, beacons and links by API

Danny Allen avatar
Written by Danny Allen
Updated over a week ago

Filter Pass Templates

You can use following fields for template filtering.

  • protocol (name of PassKit protocols) - string value e.g. MEMBERSHIP, SINGLE_USE_COUPON

  • name (name of template) - string value

  • created (created date of template) - RFC3339 or timestamp e.g. 2020-01-21T00:00:00Z, 1579564800

  • updated (last updated date of template) - RFC3339 or timestamp e.g. 2020-01-21T00:00:00Z, 1579564800

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

List templates endpoint

POST https://api.pub1.passkit.io/templates/list

Count templates endpoint

POST https://api.pub1.passkit.io/templates/count

Example POST payloads for list templates

Filter templates for Membership protocol.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "protocol",
"filterValue": "MEMBERSHIP",
"filterOperator": "eq"
}]
}]
}

Filter templates created between Jan 2020 AND Mar 2020.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "created",
"filterValue": "2020-01-01T00:00:00Z",
"filterOperator": "gt"
},{
"filterField": "created",
"filterValue": "2020-04-01T00:00:00Z",
"filterOperator": "lt"
}]
}]
}

Filter templates with name contains a keyword 'vip' OR 'VIP'.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "name",
"filterValue": "vip",
"filterOperator": "like"
},{
"filterField": "name",
"filterValue": "VIP",
"filterOperator": "like"
}]
}]
}

Filter Locations

You can use following fields to filter locations.

  • name (name of locations) - string value

  • lat (latitude of locations) - string value e.g. 30, 37.66900

  • lon (longitude of locations) - string value e.g. 157, 144.84100

  • alt (altitude of locations) - string value e.g. 3, 5

  • lockScreenMessage - string value

  • position (ordering of locations on the pass) - string value e.g. 0,1,2,3

  • created (created date of locations) - RFC3339 or timestamp e.g. 2020-01-21T00:00:00Z, 1579564800

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

List locations endpoint

POST https://api.pub1.passkit.io/locations/list

Count locations endpoint

POST https://api.pub1.passkit.io/locations/count

Example POST payloads for list locations

Filter locations which have a keyword 'limited offer' in lockScreenMessage.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "lockScreenMessage",
"filterValue": "limited offer",
"filterOperator": "like"
}]
}]
}

Filter locations for latitude between 30 AND 35.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "lat",
"filterValue": "30",
"filterOperator": "gte"
},{
"filterField": "lat",
"filterValue": "35",
"filterOperator": "lte"
}]
}]
}

Filter locations with name containing 'station' OR 'office'.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "name",
"filterValue": "station",
"filterOperator": "like"
},{
"filterField": "name",
"filterValue": "office",
"filterOperator": "like"
}]
}]
}

Filter Beacons

You can use following fields to filter beacons.

  • name (name of beacons) - string value

  • uuid (beacon uuid) - string value e.g. 39400000-8cf0-11bd-b23e-11b96e4ef00d

  • major (major indicator) - string value

  • minor (minor indicator) - string value

  • lockScreenMessage - string value

  • position (ordering of locations on the pass) - string value e.g. 0,1,2,3

  • created (created date of beacons) - RFC3339 or timestamp e.g. 2020-01-21T00:00:00Z, 1579564800

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

List beacons endpoint

POST https://api.pub1.passkit.io/beacons/list

Count beacons endpoint

POST https://api.pub1.passkit.io/beacons/count

Example POST payload for filter beacons

Filter beacons with name starting from 'a'.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "name",
"filterValue": "a",
"filterOperator": "gt"
},{
"filterField": "name",
"filterValue": "b",
"filterOperator": "lt"
}]
}]
}

Filter beacons at position <5 AND created in Feb 2020.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "position",
"filterValue": "5",
"filterOperator": "lt"
},{
"filterField": "created",
"filterValue": "2020-02-01T00:00:00Z",
"filterOperator": "gt"
},{
"filterField": "created",
"filterValue": "2020-03-01T00:00:00Z",
"filterOperator": "lt"
}]
}]
}

Filter beacons at position 1 OR 3.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "position",
"filterValue": "1",
"filterOperator": "eq"
},{
"filterField": "position",
"filterValue": "3",
"filterOperator": "eq"
}]
}]
}

Filter Links

You can filter links with following fields.

  • url (link url) - string value e.g. tel:1522228519800, https://passkit.com

  • title (url title) - string value

  • type (url type) - URI_WEB, URI_TEL, URI_EMAIL, URI_LOCATION or URI_CALENDAR

  • usage (usage type) - USAGE_APPLE_WALLET, USAGE_GOOGLE_PAY or USAGE_DATA_COLLECTION_PAGE

  • position (ordering of locations on the pass) - string value e.g. 0,1,2,3

  • created (created date of beacons) - RFC3339 or timestamp e.g. 2020-01-21T00:00:00Z, 1579564800

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

List links endpoint

POST https://api.pub1.passkit.io/links/list

Count links endpoint

POST https://api.pub1.passkit.io/links/count

Example POST payload to filter links

Filter links with url containing 'passkit.com'.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "url",
"filterValue": "passkit.com",
"filterOperator": "like"
}]
}]
}

Filter links with usage switched on for Apple Wallet AND Google Pay.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "usage",
"filterValue": "USAGE_APPLE_WALLET",
"filterOperator": "eq"
},{
"filterField": "usage",
"filterValue": "USAGE_GOOGLE_PAY",
"filterOperator": "eq"
}]
}]
}

Filter links with type tel OR email.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "type",
"filterValue": "URI_TEL",
"filterOperator": "eq"
},{
"filterField": "type",
"filterValue": "URI_EMAIL",
"filterOperator": "eq"
}]
}]
}

Note: Limit has maximum limit of 1000 for REST API call. Unlimited Limit is available for gRPC request.

Did this answer your question?