Developer Documentation (API)
- Authentication
- PHP Package
- V2 Endpoints
- Pass Templates
- Get a list of templates
- Describe the structure of a pass template
- Create a new template
- Update a template
- Patch a template
- Publish changes of a template
- Get information about fields of a pass-template only
- Schedule a Push Notification
- List scheduled notifications of a template
- Delete a scheduled Push Notification
- Copy a Pass Template
- Delete a Pass Template
- Create an iFrame Integration for a Template
- Create an URL Integration for a Template
- Passes
- REST Hooks
- Validating passes
- Deprecated endpoints
Update a template
POST Request
Endpoint URL https://veski.leikbreytir.is/api/v2/pass-template/{identifier}
Purpose
Update an existing template
Required input parameters
- HTTP Authorization Header that contains your API key
- The input JSON must conform to this JSON Schema.
Some things to note compared to the create schema:
- All properties are optional. E.g. it’s perfectly fine to only include the name property if you only want to update the name of a template.
- The sub-arrays of fields (e.g. headerFields) must contain all mandatory properties. If you want to update an existing field, include the index-property and use an existing index.
If you want to update a specific field without including the whole structure of fields, have a look at the patch-endpoint. - You can omit the index-properties which will then completely replace the existing fields.
- If you want to keep existing fields without making any update to them, do not include the keys. E.g. if headerFields should not be updated, do not include the headerFields array. An empty array will remove all fields of this type.
- You may add more fields than your pass type supports. The system will simply not display them on passes.
Returned values
Example output:
{
"name": "My template",
"description": "An example template",
"organizationName": "Gift to Wallet ",
"type": "storeCard",
"transitType": "PKTransitTypeAir",
"googlePayActive": false,
"huaweiWalletActive": false,
"passTypeId": "https://veski.leikbreytir.is/",
"passTypeIdExpiration": "2021-09-17 14:02",
"expiration": {
"expirationDate": "2021-04-08 14:54",
"expirationDateDifferentForEachPass": true,
"limitExpirationDateOfPassWithTemplate": false,
"fallbackToTemplateExpirationDateIfEmpty": true,
"validityInDays": null
},
"relevantDate": "2021-04-08 14:54",
"relevantDateDifferentForEachPass": false,
"logoText": "",
"fields": {
"headerFields": [],
"primaryFields": [],
"secondaryFields": [
{
"type": "text",
"label": "Level",
"value": "I bims",
"changeMessage": "Level updated: %@",
"useAutoId": false,
"ignoresTimezone": false,
"isRelative": false,
"dateStyle": "PKDateStyleShort",
"timeStyle": "PKDateStyleShort",
"numberStyle": "PKNumberStyleDecimal",
"currencyCode": "EUR",
"alignment": "PKTextAlignmentNatural",
"voidedLabel": "",
"voidedValue": ""
}
],
"auxiliaryFields": [],
"backFields": [
{
"type": "text",
"label": "",
"value": "gifttowallet@gifttowallet.com",
"changeMessage": "Changed to %@",
"useAutoId": false,
"ignoresTimezone": false,
"isRelative": false,
"dateStyle": "",
"timeStyle": "",
"numberStyle": "",
"currencyCode": "",
"alignment": "",
"voidedLabel": "",
"voidedValue": ""
}
]
},
"nfcEnabled": false,
"barcode": {
"format": "PKBarcodeFormatQR",
"value": "123456789",
"valueDifferentForEachPass": false,
"useAutoIdForValue": false,
"prefix": "",
"alternativeText": "",
"alternativeTextDifferentForEachPass": false,
"useAutoIdForAlternativeText": false
},
"links": [
{
"label": "Contact",
"value": "tel:004989123456789"
},
{
"label": "Website",
"value": "https://veski.leikbreytir.is/"
}
],
"images": {
"logo": "https://veski.leikbreytir.is/image/logo.png",
"logoDifferentForEachPass": false,
"logoHidden": false,
"background": "https://veski.leikbreytir.is/image/background.png",
"backgroundHidden": false,
"backgroundDifferentForEachPass": true,
"thumbnail": null,
"thumbnailHidden": true,
"thumbnailDifferentForEachPass": false,
"icon": "https://veski.leikbreytir.is/image/icon.png",
"googlePayLogo": "https://veski.leikbreytir.is/image/gpay.png"
},
"colors": {
"labelColor": "#FFFFFF",
"labelColorDifferentForEachPass": false,
"foregroundColor": "#FFFFFF",
"foregroundColorDifferentForEachPass": false,
"backgroundColor": "#CE4400",
"backgroundColorDifferentForEachPass": false,
"voidedBackgroundColor": "#FFFFFF"
},
"additionalProperties": [
{
"id": "5cb1a40ac68f80.15012600",
"name": "Email",
"placeholder": "{Email}",
"type": "email",
"required": false,
"hidden": true,
"options": []
},
{
"id": "5e2721b93da442.17595709",
"name": "Phone number",
"placeholder": "{Phone number}",
"type": "text",
"required": false,
"hidden": false,
"options": []
},
{
"id": "5e552028e62805.33020425",
"name": "INTERNALMARKER",
"placeholder": "{INTERNALMARKER}",
"type": "text",
"required": true,
"hidden": false,
"options": []
},
{
"id": "5e5e0adfc1b6e4.84503451",
"name": "Name",
"placeholder": "{Name}",
"type": "text",
"required": false,
"hidden": false,
"options": []
},
{
"id": "5f7216b0297200.36897838",
"name": "label",
"placeholder": "{label}",
"type": "text",
"required": false,
"hidden": false,
"options": []
},
{
"id": "5f7216b02972e2.34068785",
"name": "salutation",
"placeholder": "{salutation}",
"type": "select",
"required": false,
"hidden": false,
"options": [
"Mrs",
"Mr"
]
}
],
"maximumNumberOfPasses": 0,
"linkedApps": {
"iOS": {
"associatedStoreIdentifiers": "123456",
"appLaunchUrl": "myapp://myparameter"
},
"android": {
"associatedStoreIdentifier": "de.my.app.identifier",
"name": "My app"
}
},
"customDataOverview": "",
"hidePrintVersion": false,
"hideSendEmailButton": false,
"limitToOneActivePerPass": false,
"sharingProhibited": false,
"includeSocialOnDownloadPage": false,
"redirectToPassOnAndroid": false,
"excludeFromDataRetention": false,
"genericProperties": [],
"locationsDisabled": false,
"locations": [
{
"latitude": "53.2729641",
"longitude": "9.181269799999999",
"relevantText": "My store"
},
{
"latitude": "53.2391921",
"longitude": "10.4605743",
"relevantText": "Burger Store"
}
],
"beaconsDisabled": false,
"beacons": [
{
"name": "Test",
"proximityUUID": "868D3225-5F1A-4CAC-8CCA-372D41B9C8C5",
"relevantText": "Test message from beacon",
"major": "789",
"minor": "123"
}
]
}
Response:
{
"success": true,
"description": "Template was updated successfully!",
"errors": [],
"data": [],
"statusCode": 200
}