Create a new Template for a desired category.

Examples

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

Supported Formats

json

Success Response:

201 Created
              {"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": " "
      }
    }
          

Errors

400 Bad Request
401 Unauthorized

Params

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: 1 for Boarding Pass, 2 for Event Ticket with background and thumbnail, 3 for Coupon, 4 for Store Card, 5 Generic, 6 for Event Ticket with strip.


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 base64 format.


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 base64 format.


Value: Must be String
background
optional

Background image for the Template, can be set only if the category is Event Ticket (kind_id = 2).


Value: Must be a Hash
background[filename]
required

Name of the file.


Value: Must be String
background[data]
required

Content of the image in base64 format.


Value: Must be String
thumbnail
optional

Thumbnail image for the Template, 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
strip
optional

Strip image for the Template, can be set only if the category is Event Ticket, Coupon and Store Card (kind_id = 3, 4 or 6).


Value: Must be a Hash
strip[filename]
required

Name of the file.


Value: Must be String
strip[data]
required

Content of the image in base64 format.


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: PKTextAlignmentLeft, PKTextAlignmentCenter, PKTextAlignmentRight, PKTextAlignmentNatural. This key is not allowed for primary fields.


Value: Must be String
family[header][field][dateStyle]
optional

Style of date to display. Must be one of the following values: PKDateStyleNone, PKDateStyleShort, PKDateStyleMedium, PKDateStyleLong, PKDateStyleFull.


Value: Must be String
family[header][field][timeStyle]
optional

Style of time to display. Must be one of the following values: PKDateStyleNone, PKDateStyleShort, PKDateStyleMedium, PKDateStyleLong, PKDateStyleFull.


Value: Must be String
family[header][field][isRelative]
optional

If true, the label\'s value is displayed as a relative date; otherwise, it is displayed as an absolute date. The default value is false.


Value: Must be one of: true, false.
family[header][field][currencyCode]
optional

ISO 4217 currency code for the field's value.


Value: Must be String
family[header][field][numberStyle]
optional

Style of number to display. Must be one of the following values: PKNumberStyleDecimal, PKNumberStylePercent, PKNumberStyleScientific, PKNumberStyleSpellOut.


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, rgb(23, 187, 82).


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 true and a strip image is present, the strip image is displayed without a shine effect. The default value is false.


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: PKTransitTypeAir, PKTransitTypeBoat, PKTransitTypeBus, PKTransitTypeGeneric, PKTransitTypeTrain.


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: PKBarcodeFormatQR, PKBarcodeFormatPDF417, PKBarcodeFormatAztec.


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 iso-8859-1, but you may use another encoding that is supported by your barcode scanning infrastructure.


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.