GET /api/v1/templates/:template_id/passes
Get All Passes

Returns a JSON of the Passes for a given Template.

Supported Formats

json

Success Response:

200 Good Request
                  [
      {
        "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"
      }
    ]
              

Errors

400 Bad Request
401 Unauthorized

Examples

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

Params

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

GET /api/v1/templates/:template_id/passes/:id
Show Pass

Returns a JSON of the Pass for a given Template

Supported Formats

json

Success Response:

200 Good Request
                  {
      "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"
  }
              

Errors

401 Unauthorized
404 Not Found

Examples

curl -i https://api.passdock.com/api/v1/templates/106/passes/199?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

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

POST /api/v1/templates/:template_id/passes
Create Pass

Create a new Pass from a pre-defined Template with the given keys/values pairs. In the Pass' json you can use these shortcuts:

  • If you need to set the value of a key just pass "gate":"53"
  • If you need to set the value and label of a key pass "gate":{"value":"53","label":"GATE"}

Supported Formats

json

Success Response:

201 Good Request
OR 200 Good Request
                  {
        "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"
    }
              

Errors

400 Bad Request.
401 Unauthorized
420 Key Not Found In The Template
421 Missing serial number
422 Wrong Field Format

Examples

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

Params

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 (kind_id = 2 or 5).


Value: Must be a Hash
thumbnail[filename]
required

Name of the file.


Value: Must be String
thumbnail[data]
required

Content of the image in base64 format.


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.

PUT /api/v1/templates/:template_id/passes/:id
Update Pass

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:

  • If you need to set the value of a key just pass "gate":"53"
  • If you need to set the value and label of a key pass "gate":{"value":"53","label":"GATE"}

Supported Formats

json

Success Response:

200 Good Request
                  {
        "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"
    }
              

Errors

400 Bad Request
401 Unauthorized
404 Pass Not Found
420 Key Not Found In The Template
422 Wrong Field Format

Examples

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

Params

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 (kind_id = 2 or 5).


Value: Must be a Hash
thumbnail[filename]
required

Name of the file.


Value: Must be String
thumbnail[data]
required

Content of the image in base64 format.


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.

PUT /api/v1/templates/:template_id/passes/:id/redeem
Redeem a Pass

Redeem an existing Pass with the given Template.

Supported Formats

json

Success Response:

200 Good Request
                  {
        "family_id": 217,
        "id": 324,
        "web_token": "5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875",
        "download": "https://api.passdock.com/passes/217/5d16ecabb1d961a3aecd9eeaa2ddec9f45d43875.pkpass"
      }
              

Errors

400 Bad Request
401 Unauthorized
404 Pass Not Found

Examples

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

Params

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.

DELETE /api/v1/templates/:template_id/passes/:id
Delete Pass

Destroy a Pass with the given Template.

Supported Formats

json

Success Response:

200 Good Request

Errors

400 Bad Request
401 Unauthorized
404 Pass Not Found

Examples

curl -i -X DELETE https://api.passdock.com/api/v1/templates/106/passes/203?api_token=75778a65dfdae310a107d2ef0bbd3780

Params

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

GET /api/v1/templates/:template_id/passes/search
Search for a Pass


GET /api/v1/passes/search
Search for a Pass by the 2D code in every Template owned by the User

Search a Pass with the bar code for the current user. Replace spaces on the code with %20.

Supported Formats

json

Success Response:

200 Good Request
                  {
      "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"
    }
              

Errors

400 Bad Request
401 Unauthorized
404 Pass Not Found

Examples

curl -i "https://api.passdock.com/api/v1/passes/search?code=XADESA%20FKKA-CAD&api_token=75778a65dfdae310a107d2ef0bbd3780"

Params

Param name Description
code
required

2D code message


Value: Must be String
api_token
required

Your Passdock API key


Value: Must be String