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"}
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
{ "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" }
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. |