Returns a JSON of the Passes for a given Template.
[ { "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "2012-11-12T10:12:20-08:00" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "United States of America." } ], "bar": { "format": "PKBarcodeFormatQR", "message": "1350551026", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:03:47Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "family_id": 106, "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "56" } ], "id": 199, "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "NYC" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "SFO" } ], "relevance": { "locations": [ ] }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "James Smith" } ], "serial_number": "serial-1350551026", "updated_at": "2012-10-18T09:15:31Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" }, "web_token": "cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9" } ]OR 200 Good Request in compact mode
[ { "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "family_id": 106, "id": 199, "redeemed_at": null, "web_token": "cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9" }, { "download": "https://api.passdock.com/passes/200/793a4b7f81e9a7ee27746f3104d97fe0638d05c3.pkpass", "family_id": 106, "id": 200, "redeemed_at": null, "web_token": "793a4b7f81e9a7ee27746f3104d97fe0638d05c3" }, { "download": "https://api.passdock.com/passes/201/b48c646805c50fdf04a6ffa5d187687e4f578522.pkpass", "family_id": 106, "id": 201, "redeemed_at": null, "web_token": "b48c646805c50fdf04a6ffa5d187687e4f578522" } ]
curl -i https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780&compact=true
curl -i https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780&compact=true&page=1
Param name | Description |
---|---|
template_id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
compact optional |
Choose to get the Pass list and not the full Pass json file Value: Must be one of: true, false. |
page optional |
Page of results, currently the param is optional, but will be required soon. Each page contains 50 Passes ordered date (more recents first) Value: Must be Fixnum |
Returns a JSON of the Pass for a given Template
{ "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "2012-11-12T10:12:20-08:00" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "United States of America." } ], "bar": { "format": "PKBarcodeFormatQR", "message": "1350551026", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:03:47Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "family_id": 106, "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "56" } ], "id": 199, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "NYC" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "SFO" } ], "relevance": { "locations": [ ] }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "James Smith" } ], "serial_number": "serial-1350551026", "updated_at": "2012-10-18T09:15:31Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" }, "web_token": "cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9", "render_html_url": "http://api.passdock.com/p/ID/TOKEN" }
curl -i https://api.passdock.com/api/v1/templates/106/passes/199?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
template_id required |
Template ID Value: Must be Fixnum |
id required |
Pass ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
Create a new Pass from a pre-defined Template with the given keys/values pairs. In the Pass' json you can use these shortcuts:
key
just pass "gate":"53"
key
pass "gate":{"value":"53","label":"GATE"}
{ "family_id": 217, "id": 314, "web_token": "5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875", "download": "https://api.passdock.com/passes/217/5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875.pkpass" }OR 200 Good Request with Debug Enabled
{ "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "2012-12-18T14:34:10-02:00" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "" } ], "bar": { "format": "PKBarcodeFormatQR", "message": "", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:40:27Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "family_id": 106, "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "53" } ], "id": 202, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "" } ], "relevance": { }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "" } ], "serial_number": "1234567", "updated_at": "2012-10-18T09:40:27Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" }, "web_token": "36eb5647504035593388c01189089c0512561268" }
curl -i -d 'pass={"serial_number":"1234567", "gate":"53", "departure":"2012-12-18T14:34:10-02:00"}' https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -H "Content-Type: application/json" -d '{"pass":{"serial_number":"1234567", "gate":"53", "departure":"2012-12-18T14:34:10-02:00"}}' https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -d 'pass={"redeemed":false,"serial_number":"1234567", "gate":"53", "departure":"2012-12-18T14:34:10-02:00"}' https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -d 'debug=true&pass={"serial_number":"4567891", "bar":{"message":"QRRSNDKAIUDS923", "altText":"QRRSNDKAIUDS923"}, "gate":{"value":"53"},"departure":"2012-11-14T08:12:19-08:00"}' https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -d 'debug=true&pass={"serial_number":"7891234", "relevance":{"locations":[{"latitude":12.122342, "longitude":64.123353}]}, "gate":{"value":"98"},"departure":"2012-11-14T08:12:19-08:00"}' https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -d 'pass={"serial_number":"1234567", "gate":"53", "departure":"2012-12-18T14:34:10-02:00"}&thumbnail={"filename":"test.png","data":"THE_BASE_64_ENCODED_IMAGE"}' https://api.passdock.com/api/v1/templates/106/passes?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
template_id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
pass required |
A JSON dictionary containing the pass keys and values Value: Must be a Hash |
pass[serial_number] required |
The serial number for the Pass, must be unique and cannot be changed Value: Must be String |
pass[redeemed] optional |
If the Pass has been redeemed or not. Value: Must be one of: true, false. |
pass[KEY] optional |
The desired keys that are present in the template and left empty. Value: Must be a Hash |
pass[KEY][label] optional |
The label for the field, usually placed above the value. Value: Must be String |
pass[KEY][value] optional |
The value of the field, usually placed below the label. Value: Must be String |
pass[KEY][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 |
pass[bar] optional |
An hash containing the Bar Section informations Value: Must be a Hash |
pass[bar][message] optional |
The message to be put in the 2D code Value: Must be String |
pass[bar][altText] optional |
The alternative text that will be put below the bar code. Value: Must be String |
pass[relevance] optional |
An hash containing the relevance informations like date, time and positions. Value: Must be a Hash |
pass[relevance][locations] optional |
Array of locations where the pass will appear on the lockscreen Value: Must be a Hash |
pass[relevance][locations][latitude] required |
Latitude Value: Must be String |
pass[relevance][locations][longitude] required |
Longitude Value: Must be String |
pass[relevance][locations][altitude] optional |
Altitude Value: Must be String |
pass[relevance][locations][relevantText] optional |
Text that will appear on the lockscreen when the place is reached. Value: Must be String |
pass[relevance][relevantDate] optional |
Date and Time when the pass will appear on the lockscreen. Use ISO8601 format. Value: Must be String |
thumbnail optional |
Thumbnail image for the Pass, 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 |
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 an existing Pass with the given Template and, changing the keys contained in the pass
JSON dictionary.
In the Pass' json you can use these shortcuts:
key
just pass "gate":"53"
key
pass "gate":{"value":"53","label":"GATE"}
{ "family_id": 217, "id": 324, "web_token": "5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875", "download": "https://api.passdock.com/passes/217/5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875.pkpass" }OR 200 Good Request with Debug Enabled
{ "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "2012-12-18T14:34:10-02:00" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "" } ], "bar": { "format": "PKBarcodeFormatQR", "message": "", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:40:27Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "family_id": 106, "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "53" } ], "id": 202, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "" } ], "relevance": { }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "" } ], "serial_number": "1234567", "updated_at": "2012-10-18T09:40:27Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" }, "web_token": "36eb5647504035593388c01189089c0512561268" }
curl -i -X PUT -d 'pass={"gate":"53", "departure":"2012-12-18T14:34:10-02:00"}' https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -X PUT -H "Content-Type: application/json" -d '{"pass":{"gate":"53", "departure":"2012-12-18T14:34:10-02:00"}}' https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -X PUT -d 'pass={"redeemed":true}' https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -X PUT -d 'debug=true&pass={"bar":{"message":"QRRSNDKAIUDS923", "altText":"QRRSNDKAIUDS923"}, "gate":{"value":"53"},"departure":"2012-11-14T08:12:19-08:00"}' https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -X PUT -d 'debug=true&pass={"relevance":{"locations":[{"latitude":12.122342, "longitude":64.123353}]}, "gate":{"value":"98"},"departure":"2012-11-14T08:12:19-08:00"}' https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -X PUT -d 'pass={"gate":"53", "departure":"2012-12-18T14:34:10-02:00"}&thumbnail={"filename":"test.png","data":"THE_BASE_64_ENCODED_IMAGE"}' https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
id required |
Pass ID Value: Must be Fixnum |
template_id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
pass required |
A JSON dictionary containing the pass keys and values Value: Must be a Hash |
pass[redeemed] optional |
If the Pass has been redeemed or not. Value: Must be one of: true, false. |
pass[KEY] optional |
The desired keys that are present in the template and left empty. Value: Must be a Hash |
pass[KEY][label] optional |
The label for the field, usually placed above the value. Value: Must be String |
pass[KEY][value] optional |
The value of the field, usually placed below the label. Value: Must be String |
pass[KEY][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 |
pass[bar] optional |
An hash containing the Bar Section informations Value: Must be a Hash |
pass[bar][message] optional |
The message to be put in the 2D code Value: Must be String |
pass[bar][altText] optional |
The alternative text that will be put below the bar code. Value: Must be String |
pass[relevance] optional |
An hash containing the relevance informations like date, time and positions. Value: Must be a Hash |
pass[relevance][locations] optional |
Array of locations where the pass will appear on the lockscreen Value: Must be a Hash |
pass[relevance][locations][latitude] required |
Latitude Value: Must be String |
pass[relevance][locations][longitude] required |
Longitude Value: Must be String |
pass[relevance][locations][altitude] optional |
Altitude Value: Must be String |
pass[relevance][locations][relevantText] optional |
Text that will appear on the lockscreen when the place is reached. Value: Must be String |
pass[relevance][relevantDate] optional |
Date and Time when the pass will appear on the lockscreen. Use ISO8601 format. Value: Must be String |
thumbnail optional |
Thumbnail image for the Pass, 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 |
debug optional |
You get in response a JSON with the updated 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. |
Redeem an existing Pass with the given Template.
{ "family_id": 217, "id": 324, "web_token": "5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875", "download": "https://api.passdock.com/passes/217/5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875.pkpass" }
curl -i -X PUT https://api.passdock.com/api/v1/templates/106/passes/203/redeem?redeemed=true&api_token=75778a65dfdae310a107d2ef0bbd3780
curl -i -X PUT https://api.passdock.com/api/v1/templates/106/passes/203/redeem?redeemed=false&api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
id required |
Pass ID Value: Must be Fixnum |
template_id required |
Template ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
redeemed required |
If the Pass should be reedeemed or unredeemed Value: Must be one of: true, false. |
debug optional |
You get in response a JSON with the updated 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 Pass with the given Template.
curl -i -X DELETE https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780
Param name | Description |
---|---|
template_id required |
Template ID Value: Must be Fixnum |
id required |
Pass ID Value: Must be Fixnum |
api_token required |
Your Passdock API key Value: Must be String |
Search a Pass with a serial number
{ "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "2012-11-12T10:12:20-08:00" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "United States of America." } ], "bar": { "format": "PKBarcodeFormatQR", "message": "1350551026", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:03:47Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "family_id": 106, "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "56" } ], "id": 199, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "NYC" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "SFO" } ], "relevance": { "locations": [ ] }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "James Smith" } ], "serial_number": "serial-1350551026", "updated_at": "2012-10-18T09:15:31Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" }, "web_token": "cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9" }OR 200 Good Request with Many paramenter.
[ { "code": "This is the message inside the QR Code.", "download": "https://api.passdock.com/passes/34/0e21273510a9bc18fc05572842f461970583e3de.pkpass", "family_id": 25, "id": 34, "redeemed_at": null, "serial_number": "ObjC-API-65", "type": 1, "web_token": "0e21273510a9bc18fc05572842f461970583e3de" }, { "code": "This is the message inside the QR Code.", "download": "https://api.passdock.com/passes/35/89b8cd9af2a98cc9bf21dd6050acc56fe43426f6.pkpass", "family_id": 25, "id": 35, "redeemed_at": null, "serial_number": "ObjC-API-78", "type": 1, "web_token": "89b8cd9af2a98cc9bf21dd6050acc56fe43426f6" }, { "code": "This is the message inside the QR Code.", "download": "https://api.passdock.com/passes/36/9fb8daf956a1de6095e9a4f3cd0c97526701834c.pkpass", "family_id": 25, "id": 36, "redeemed_at": null, "serial_number": "ObjC-API-78", "type": 1, "web_token": "9fb8daf956a1de6095e9a4f3cd0c97526701834c" } ]
curl -i "https://api.passdock.com/api/v1/templates/106/passes/search?api_token=75778a65dfdae310a107d2ef0bbd3780&serial_number=serial-1351766860&many=true"
Param name | Description |
---|---|
template_id required |
Template ID Value: Must be Fixnum |
many optional |
Get an array of Passes instead of the just one, but in compact mode Value: Must be one of: true, false. |
serial_number required |
Serial Number Value: Must be String |
api_token required |
Your Passdock API key Value: Must be String |
Search a Pass with the bar code for the current user. Replace spaces on the code with %20.
{ "auxiliary": [ { "changeMessage": "Departure time changed to %@", "dateStyle": "PKDateStyleMedium", "key": "departure", "label": "DEPARTURE", "timeStyle": "PKDateStyleMedium", "value": "2012-11-12T10:12:20-08:00" } ], "back": [ { "changeMessage": "", "key": "passport", "label": "PASSPORT", "value": "United States of America." } ], "bar": { "format": "PKBarcodeFormatQR", "message": "1350551026", "messageEncoding": "iso-8859-1" }, "created_at": "2012-10-18T09:03:47Z", "custom": [ { "transitType": "PKTransitTypeAir" } ], "download": "https://api.passdock.com/passes/199/cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9.pkpass", "family_id": 106, "header": [ { "changeMessage": "Gate changed to %@", "key": "gate", "label": "GATE", "value": "56" } ], "id": 199, "primary": [ { "changeMessage": "Departure changed in %@", "key": "from", "label": "FROM", "value": "NYC" }, { "changeMessage": "Destination changed to %@", "key": "to", "label": "TO", "value": "SFO" } ], "relevance": { "locations": [ ] }, "secondary": [ { "changeMessage": "Passenger name changed to %@", "key": "name", "label": "NAME", "value": "James Smith" } ], "serial_number": "serial-1350551026", "updated_at": "2012-10-18T09:15:31Z", "visual": { "backgroundColor": "rgb(237,184,61)", "foregroundColor": "rgb(255,255,255)", "labelColor": "", "logoText": "Passdock Airways" }, "web_token": "cd4bf0e77e1c619ed55d78f5f2ead787b7c689f9" }
curl -i "https://api.passdock.com/api/v1/passes/search?code=XADESA%20FKKA-CAD&api_token=75778a65dfdae310a107d2ef0bbd3780"
Param name | Description |
---|---|
code required |
2D code message Value: Must be String |
api_token required |
Your Passdock API key Value: Must be String |