Returns a JSON of the Templates owned by the user.
[ { "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "" } ], "bar": { "altText": "", "format": "PKBarcodeFormatQR", "message": "", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:03:46Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "" } ], "id": 106, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "" } ], "relevance": { "relevantDate": "" }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "" } ], "title": "Passdock Airways", "updated_at": "2012-10-18T09:13:47Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" } } ]
curl -i https://api.passdock.com/api/v1/templates?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
api_token required |
Your Passdock API key Value: Must be String |
page optional |
Page of results, currently the param is optional, but will be required soon. Each page contains 50 Templates ordered date (more recents first) Value: Must be Fixnum |
Returns a JSON of the Template
{ "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "" } ], "bar": { "altText": "", "format": "PKBarcodeFormatQR", "message": "", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:03:46Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "" } ], "id": 106, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "" } ], "relevance": { "relevantDate": "" }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "" } ], "title": "Passdock Airways", "updated_at": "2012-10-18T09:13:47Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" } }
curl -i https://api.passdock.com/api/v1/templates/106?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
Create a new Template for a desired category.
{"id":12}OR 201 Created with Debug Enabled
{ "add_serial_to_back": true, "auxiliary": null, "back": null, "bar": { }, "custom": null, "description": null, "format_version": null, "header": [ { "changeMessage": "Gate changed", "key": "gate", "label": "GATE", "value": "" } ], "kind_id": 5, "organization_name": "Passdock Airlines", "pass_type_identifier": "pass.passdock.sample1", "primary": [ ], "relevance": { "relevantDate": "" }, "secondary": null, "team_identifier": "6J39RL8VD6", "title": "Passdock Airways", "visual": { "backgroundColor": "rgb(32,87,132)", "foregroundColor": "rgb(255,255,255)", "labelColor": " " } }
curl -i -d 'debug=true&errors=true&family={"title":"Passdock Airways","header":[{"key":"gate","label":"GATE","value":"","changeMessage":"Gate changed"}],"primary":[],"custom":null,"visual":{"backgroundColor":"rgb(32,87,132)","foregroundColor":"rgb(255,255,255)","labelColor":" "},"relevance":{"relevantDate":""},"bar":{}, "organization_name":"Passdock Airlines","kind_id":5}&certificate={"data":"THE_CERTIFICATE_ATTRIBUTE_BAG"}&icon={"filename":"test.png","data":"THE_BASE_64_ENCODED_IMAGE"}' https://api.passdock.com/api/v1/templates?api_token=11edb4f913d11cfa7ce8b61546948a3f
Param name | Description |
---|---|
api_token required |
Your Passdock API key Value: Must be String |
title required |
The title of the Template, must be unique between your templates Value: Must be String |
description required |
Brief description of the pass, used by the iOS accessibility technologies. Don't try to include all of the data on the pass in its description, just include enough detail to distinguish passes of the same type. Value: Must be String |
kind_id required |
The category of the Template: Value: Must be Integer |
certificate required |
Certificate to digitally sign each pass and send push notifications. Value: Must be a Hash |
certificate[data] required |
The certificate blob in format. Value: Must be String |
icon required |
Icon for the Template, appears when the pass is shown in the lockscreen and as mail attachment. Value: Must be a Hash |
icon[filename] required |
Name of the file. Value: Must be String |
icon[data] required |
Content of the image in Value: Must be String |
logo optional |
Logo for the Template. Value: Must be a Hash |
logo[filename] required |
Name of the file. Value: Must be String |
logo[data] required |
Content of the image in Value: Must be String |
background optional |
Background image for the Template, can be set only if the category is Event Ticket ( Value: Must be a Hash |
background[filename] required |
Name of the file. Value: Must be String |
background[data] required |
Content of the image in Value: Must be String |
thumbnail optional |
Thumbnail image for the Template, can be set only if the category is Event Ticket and Generic ( Value: Must be a Hash |
thumbnail[filename] required |
Name of the file. Value: Must be String |
thumbnail[data] required |
Content of the image in Value: Must be String |
strip optional |
Strip image for the Template, can be set only if the category is Event Ticket, Coupon and Store Card ( Value: Must be a Hash |
strip[filename] required |
Name of the file. Value: Must be String |
strip[data] required |
Content of the image in Value: Must be String |
family required |
A JSON dictionary containing the template definition Value: Must be a Hash |
family[header] optional |
An array of fields for the header section, usually of just one element Value: Must be a Hash |
family[header][field] optional |
An Hash for each field Value: Must be a Hash |
family[header][field][key] required |
The key for the field, invisible on the pass. Is used to create the passes via API as field identifier. Value: Must be String |
family[header][field][label] optional |
The label for the field, usually placed above the value. Value: Must be String |
family[header][field][value] optional |
The value of the field, usually placed below the label. Value: Must be String |
family[header][field][changeMessage] optional |
The change message that will be shown in the lock screen and as notification when the value for the field is changed remotely. Value: Must be String |
family[header][field][textAlignment] optional |
Alignment for the field's contents. Must be one of the following values: Value: Must be String |
family[header][field][dateStyle] optional |
Style of date to display. Must be one of the following values: Value: Must be String |
family[header][field][timeStyle] optional |
Style of time to display. Must be one of the following values: Value: Must be String |
family[header][field][isRelative] optional |
If Value: Must be one of: true, false. |
family[header][field][currencyCode] optional |
ISO 4217 currency code for the field's Value: Must be String |
family[header][field][numberStyle] optional |
Style of number to display. Must be one of the following values: Value: Must be String |
family[visual] required |
Parameters related to the appearance of the pass Value: Must be a Hash |
family[visual][backgroundColor] required |
Background color of the pass, specified as an CSS-style RGB triple. For example, Value: Must be String |
family[visual][foregroundColor] required |
Foreground color of the pass, specified as a CSS-style RGB triple. For example, rgb(100, 10, 110). Value: Must be String |
family[visual][labelColor] optional |
Color of the label text, specified as a CSS-style RGB triple. For example, rgb(255, 255, 255). If omitted, the label color is determined automatically. Value: Must be String |
family[visual][logoText] optional |
Text displayed next to the logo on the pass. Value: Must be String |
family[visual][suppressStripShine] optional |
If Value: Must be String |
family[primary] optional |
An array of fields for the primary section Value: Must be a Hash |
family[primary][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[secondary] optional |
An array of fields for the secondary section Value: Must be a Hash |
family[secondary][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[auxiliary] optional |
An array of fields for the auxiliary section Value: Must be a Hash |
family[auxiliary][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[back] optional |
An array of fields for the back section Value: Must be a Hash |
family[back][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[custom] required |
Value: Must be a Hash |
family[custom][transitType] required |
Required for boarding passes; otherwise not allowed. Type of transit. Must be one of the following values: Value: Must be String |
family[bar] optional |
An hash containing the Bar Section informations Value: Must be a Hash |
family[bar][message] optional |
The message to be put in the 2D code Value: Must be String |
family[bar][format] required |
Barcode format. Must be one of the following values: Value: Must be String |
family[bar][altText] optional |
The alternative text that will be put below the bar code. Value: Must be String |
family[bar][messageEncoding] required |
Text encoding that is used to convert the message from the string representation to a data representation to render the barcode. The value is typically Value: Must be String |
family[relevance] optional |
An hash containing the relevance informations like date, time and positions. Value: Must be a Hash |
family[relevance][locations] optional |
Array of locations where the pass will appear on the lockscreen Value: Must be a Hash |
family[relevance][locations][latitude] required |
Latitude Value: Must be String |
family[relevance][locations][longitude] required |
Longitude Value: Must be String |
family[relevance][locations][altitude] optional |
Altitude Value: Must be String |
family[relevance][locations][relevantText] optional |
Text that will appear on the lockscreen when the place is reached. Value: Must be String |
family[relevance][relevantDate] optional |
Date and Time when the pass will appear on the lockscreen. Use ISO8601 format. Value: Must be String |
limit_to_1_device optional |
Limit to 1 device per pass Value: Must be one of: 0, 1. |
debug optional |
You get in response a JSON with the created object. Value: Must be one of: true, false. |
errors optional |
If an error occurs you get the messages and not only the code. Value: Must be one of: true, false. |
Update a desired Template.
{"id":12}OR 200 Updated with Debug Enabled
{ "add_serial_to_back": true, "auxiliary": null, "back": null, "bar": { }, "custom": null, "description": null, "format_version": null, "header": [ { "changeMessage": "Gate changed", "key": "gate", "label": "GATE", "value": "" } ], "organization_name": "Passdock Airlines", "pass_type_identifier": "pass.passdock.sample1", "primary": [ ], "relevance": { "relevantDate": "" }, "secondary": null, "team_identifier": "6J39RL8VD6", "title": "Passdock Airways", "visual": { "backgroundColor": "rgb(32,87,132)", "foregroundColor": "rgb(255,255,255)", "labelColor": " " } }
Param name | Description |
---|---|
api_token required |
Your Passdock API key Value: Must be String |
title optional |
The title of the Template, must be unique between your templates Value: Must be String |
description optional |
Brief description of the pass, used by the iOS accessibility technologies. Don't try to include all of the data on the pass in its description, just include enough detail to distinguish passes of the same type. Value: Must be String |
certificate optional |
Certificate to digitally sign each pass and send push notifications. Value: Must be a Hash |
certificate[data] required |
The certificate blob in format. Value: Must be String |
icon optional |
Icon for the Template, appears when the pass is shown in the lockscreen and as mail attachment. Value: Must be a Hash |
icon[filename] required |
Name of the file. Value: Must be String |
icon[data] required |
Content of the image in Value: Must be String |
logo optional |
Logo for the Template. Value: Must be a Hash |
logo[filename] required |
Name of the file. Value: Must be String |
logo[data] required |
Content of the image in Value: Must be String |
background optional |
Background image for the Template, can be set only if the category is Event Ticket ( Value: Must be a Hash |
background[filename] required |
Name of the file. Value: Must be String |
background[data] required |
Content of the image in Value: Must be String |
thumbnail optional |
Thumbnail image for the Template, can be set only if the category is Event Ticket and Generic ( Value: Must be a Hash |
thumbnail[filename] required |
Name of the file. Value: Must be String |
thumbnail[data] required |
Content of the image in Value: Must be String |
strip optional |
Strip image for the Template, can be set only if the category is Event Ticket, Coupon and Store Card ( Value: Must be a Hash |
strip[filename] required |
Name of the file. Value: Must be String |
strip[data] required |
Content of the image in Value: Must be String |
family required |
A JSON dictionary containing the template definition Value: Must be a Hash |
family[header] optional |
An array of fields for the header section, usually of just one element Value: Must be a Hash |
family[header][field] optional |
An Hash for each field Value: Must be a Hash |
family[header][field][key] required |
The key for the field, invisible on the pass. Is used to create the passes via API as field identifier. Value: Must be String |
family[header][field][label] optional |
The label for the field, usually placed above the value. Value: Must be String |
family[header][field][value] optional |
The value of the field, usually placed below the label. Value: Must be String |
family[header][field][changeMessage] optional |
The change message that will be shown in the lock screen and as notification when the value for the field is changed remotely. Value: Must be String |
family[header][field][textAlignment] optional |
Alignment for the field's contents. Must be one of the following values: Value: Must be String |
family[header][field][dateStyle] optional |
Style of date to display. Must be one of the following values: Value: Must be String |
family[header][field][timeStyle] optional |
Style of time to display. Must be one of the following values: Value: Must be String |
family[header][field][isRelative] optional |
If Value: Must be one of: true, false. |
family[header][field][currencyCode] optional |
ISO 4217 currency code for the field's Value: Must be String |
family[header][field][numberStyle] optional |
Style of number to display. Must be one of the following values: Value: Must be String |
family[visual] optional |
Parameters related to the appearance of the pass Value: Must be a Hash |
family[visual][backgroundColor] required |
Background color of the pass, specified as an CSS-style RGB triple. For example, Value: Must be String |
family[visual][foregroundColor] required |
Foreground color of the pass, specified as a CSS-style RGB triple. For example, rgb(100, 10, 110). Value: Must be String |
family[visual][labelColor] optional |
Color of the label text, specified as a CSS-style RGB triple. For example, rgb(255, 255, 255). If omitted, the label color is determined automatically. Value: Must be String |
family[visual][logoText] optional |
Text displayed next to the logo on the pass. Value: Must be String |
family[visual][suppressStripShine] optional |
If Value: Must be String |
family[primary] optional |
An array of fields for the primary section Value: Must be a Hash |
family[primary][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[secondary] optional |
An array of fields for the secondary section Value: Must be a Hash |
family[secondary][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[auxiliary] optional |
An array of fields for the auxiliary section Value: Must be a Hash |
family[auxiliary][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[back] optional |
An array of fields for the back section Value: Must be a Hash |
family[back][field] optional |
Exactly like the field for the header section Value: Must be Hash |
family[custom] optional |
Value: Must be a Hash |
family[custom][transitType] required |
Required for boarding passes; otherwise not allowed. Type of transit. Must be one of the following values: Value: Must be String |
family[bar] optional |
An hash containing the Bar Section informations Value: Must be a Hash |
family[bar][message] optional |
The message to be put in the 2D code Value: Must be String |
family[bar][format] required |
Barcode format. Must be one of the following values: Value: Must be String |
family[bar][altText] optional |
The alternative text that will be put below the bar code. Value: Must be String |
family[bar][messageEncoding] required |
Text encoding that is used to convert the message from the string representation to a data representation to render the barcode. The value is typically Value: Must be String |
family[relevance] optional |
An hash containing the relevance informations like date, time and positions. Value: Must be a Hash |
family[relevance][locations] optional |
Array of locations where the pass will appear on the lockscreen Value: Must be a Hash |
family[relevance][locations][latitude] required |
Latitude Value: Must be String |
family[relevance][locations][longitude] required |
Longitude Value: Must be String |
family[relevance][locations][altitude] optional |
Altitude Value: Must be String |
family[relevance][locations][relevantText] optional |
Text that will appear on the lockscreen when the place is reached. Value: Must be String |
family[relevance][relevantDate] optional |
Date and Time when the pass will appear on the lockscreen. Use ISO8601 format. Value: Must be String |
limit_to_1_device optional |
Limit to 1 device per pass Value: Must be one of: 0, 1. |
debug optional |
You get in response a JSON with the created object. Value: Must be one of: true, false. |
errors optional |
If an error occurs you get the messages and not only the code. Value: Must be one of: true, false. |
Destroy a Template.
curl -i -X DELETE https://api.passdock.com/api/v1/templates/106?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
Get editable fields for a desired Template.
You will get an array of editable fields. Each field is named with the key
of the field. For each field you get an array of editable options:
value
means that you can set the value for each Pass;label
means that you can set the lable for each Pass;changeMessage
means that you can set a different change message for each pass.In the same array you get the field type if it isn't a String:
date
means that the field is a date and you must write the value
in the ISO8601 format;time
means that the field is a time and you must write the value
in the ISO8601 format;currency
means that the field represent money and you must write the value
in the ISO4217 format;number
means that the field is a number.Besides the array fields you can get another array with the images that can be set for each Pass:
thumbnail
means that you can upload a thumbnail for each Pass.{ "fields": [ { "year": [ "value", "date" ] }, { "name": [ "value", "label", "changeMessage" ] } ], "images": [ "thumbnail" ] }
curl -i https://api.passdock.com/api/v1/templates/fields?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |