Account PassBook Message

Account

Login: GET /user.Auth
URL Parameters:
  • login - E-mail user
  • password - Password

  • Response: {
       "result" : true,
       "token" : "d5206c1e2217f84fc62878c580546184"
    }
    Logout: GET /user.Logout
    Response: {
       "result" : true,
       "msg" : "Logout"
    }


    PassBook

    Retrieve all Passbook templates: GET /pbook.templateList
    URL Parameters:
  • token - Token for access

  • Response: {
       "result" : true,
       "list" : [
          {
             "id" : "278",
             "id_type" : "4",
             "name_type" : "Coupon",
             "name" : "test",
             "name_screen" : "1965807bbada8d855445f5b3a72e6be44911_book.png",
             "sharing" : "0",
             "image" : 1,
             "date_create" : "2012-11-16 23:02:42"
          },
          {
             "id" : "279",
             "id_type" : "2",
             "name_type" : "Event Ticket",
             "name" : "ertet",
             "sharing" : "0",
             "image" : 1,
             "date_create" : "2012-11-17 03:51:12"
          }
       ]
    }
    Retrieve all Passbook: GET /pbook.bookList
    URL Parameters:
  • token - Token for access

  • Response: {
       "result" : true,
       "list" : [
          {
             "id" : "288",
             "id_type" : "4",
             "id_template" : "278",
             "name_type" : "Coupon",
             "name" : "test",
             "name_template" : "test",
             "name_screen" : "65807bbada8d855445f5b3a72e6be77911_tmp.png",
             "date_create" : "2012-11-19 23:35:17",
             "image" : 1
          },
          {
             "id" : "289",
             "id_type" : "4",
             "id_template" : "278",
             "name_type" : "Coupon",
             "name" : "test2",
             "name_template" : "test",
             "date_create" : "2012-11-19 23:33:30",
             "image" : 1
          }
       ]
    }
    Email a PassBook to someone: GET /pbook.send
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook
  • id_email_tmp - Optional. ID E-mail template. Default value: Use default ID template
  • email - E-mail address of the recipient. To pass multiple addresses, use the separator ", or ;"

  • Response: {
       "result" : true
    }
    Send SMS with PassBook URL: GET /pbook.sendSms
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook
  • to - Recipient's phone number. Format: +1********** or 1**********
  • msg - Message before the URL

  • Response: {
       "result" : true
    }
    Retrieve the Key/Values/Label for a specific PassBook template: GET /pbook.getTemplateKeyValue
    URL Parameters:
  • token - Token for access
  • idTemplate - ID Template

  • Response: {
       "result" : true,
       "value" : {
          "fields" : {
             "primaryFields" : [
                {
                   "key" : "primaryFields0",
                   "label" : "all sandals",
                   "value" : "$10 off"
                }
             ],
             "auxiliaryFields" : [
                {
                   "key" : "auxiliaryFields0",
                   "label" : "Expires",
                   "value" : "7\/4\/2012"
                },
                {
                   "key" : "auxiliaryFields1",
                   "label" : "Offer valid on",
                   "value" : "one item"
                }
             ],
             "backFields" : [
                {
                   "key" : "backFields0",
                   "label" : "Passport",
                   "value" : "USA"
                },
                {
                   "key" : "backFields1",
                   "label" : "Country",
                   "value" : "United States"
                }
             ]
          },
          "barcode" : {
             "message" : "{'test':11, 'test2':22}",
             "altText" : "{'test':11, 'test2':22}"
          }
       }
    }
    Retrieve the Key/Values/Label for a specific PassBook: GET /pbook.getBookKeyValue
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook

  • Response: {
       "result" : true,
       "value" : [
          {
             "key" : "primaryFields_primaryFields0",
             "data" : {
                "label" : "all sandals",
                "value" : 777
             }
          },
          {
             "key" : "auxiliaryFields_auxiliaryFields0",
             "data" : {
                "label" : "Expires",
                "value" : "7\/4\/2012"
             }
          },
          {
             "key" : "auxiliaryFields_auxiliaryFields1",
             "data" : {
                "label" : "Offer valid on",
                "value" : "one item"
             }
          },
          {
             "key" : "backFields_backFields0",
             "data" : {
                "label" : "Passport",
                "value" : "USA"
             }
          },
          {
             "key" : "backFields_backFields1",
             "data" : {
                "label" : "Country",
                "value" : "United States"
             }
          },
          {
             "key" : "barcode_message",
             "data" : "Text"
          },
          {
             "key" : "barcode_altText",
             "data" : "Text"
          }
       ]
    }

    To edit the PassBook, use the key: "key" : "backFields_backFields1" For example edit value and label:
    backFields_backFields1_value = "new value"
    backFields_backFields1_label = "new label"
    Edit barcode:
    barcode_message = "new message"
    barcode_altText = "new alt text"
    Create PassBook: GET /pbook.createBook
    URL Parameters:
  • token - Token for access
  • idTemplate - ID Template
  • name - Name PassBook
  • [KEY] - Optional. Key fields with new data
  • relevantDate - Optional. Date and time when the pass becomes relevant.
  • expirationDate - Optional. Date and time when the pass expires. 7⃣
  • voided - Optional. Void Pass. Value true or false. 7⃣
  • appLaunchURL - Optional. A URL to be passed to the associated app when launching it. 7⃣
  • associatedStoreIdentifiers - Optional. A list of iTunes Store item identifiers (also known as Adam IDs) for the associated apps. 7⃣
  • userInfo - Optional. Custom information for companion apps. This data is not displayed to the user. 7⃣

  • Response: {
       "result" : true,
       "id" : 318,
       "url" : "c3qot3fIFH8PRX9616FlredzEUsaDxMuHZ1nPMG5oNWwoCTZQj"
    }

    For example request: GET /pbook.createBook
    ?token=d5206c1e2217f84fc62878c580546184
    &idTemplate=278
    &name=New PassBook API
    &primaryFields_primaryFields0_value=156
    &primaryFields_primaryFields0_label=Price
    Update a specific key/value/label pair for a specific PassBook: GET /pbook.editBook
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook
  • [KEY] - Key fields with new data
  • relevantDate - Optional. Date and time when the pass becomes relevant.
  • expirationDate - Optional. Date and time when the pass expires. 7⃣
  • voided - Optional. Void Pass. Value true or false. 7⃣
  • appLaunchURL - Optional. A URL to be passed to the associated app when launching it. 7⃣
  • associatedStoreIdentifiers - Optional. A list of iTunes Store item identifiers (also known as Adam IDs) for the associated apps. 7⃣
  • userInfo - Optional. Custom information for companion apps. This data is not displayed to the user. 7⃣

  • Response: {
       "result" : true
    }

    For example request: GET /pbook.editBook
    ?token=d5206c1e2217f84fc62878c580546184
    &idBook=278
    &primaryFields_primaryFields0_value=156
    &primaryFields_primaryFields0_label=Price
    Upload image for a PassBook template: POST /pbook.uploadImage
    URL Parameters:
  • token - Token for access
  • idTemplate - ID Template
  • icon - Optional. Icon image. Type: PNG
  • logo - Optional. Logo image. Type: PNG
  • strip - Optional. Strip image. Type: PNG
  • thumbnail - Optional. Thumbnail image. Type: PNG
  • background - Optional. Background image. Type: PNG

  • Response: {
       "result" : true
    }

    For example form: <form action="http://pass.passhound.com/api/pbook.uploadImage" method="POST" enctype="multipart/form-data">
                <input type="text" name="idTemplate" value="1" />
                <input type="text" name="token" value="d5206c1e2217f84fc62878c580546184" />
                <input type="file" name="thumbnail" value="" />
                <input type="submit" value="Send" />
    </form>
    Upload image for a PassBook: POST /pbook.uploadImagePassBook
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook
  • strip - Optional. Strip image. Type: PNG
  • thumbnail - Optional. Thumbnail image. Type: PNG

  • Response: {
       "result" : true
    }

    For example form: <form action="http://pass.passhound.com/api/pbook.uploadImagePassBook" method="POST" enctype="multipart/form-data">
                <input type="text" name="token" value="d5206c1e2217f84fc62878c580546184" />
                <input type="text" name="idBook" value="309" />
                <input type="file" name="thumbnail" value="" />
                <input type="submit" value="Send" />
    </form>
    Get ID PassBook by barcode message: GET /pbook.getPassByBarcode
    URL Parameters:
  • token - Token for access
  • message - Barcode message

  • Response: {
       "result" : true,
       "data" : [
          {
             "id" : "289",
             "id_template" : "278",
             "name" : "PassBook Name"
          }
       ]
    }
    Get ID Template PassBook by iBeacon data: 7⃣ GET /pbook.getTemplateByBeacon
    URL Parameters:
  • token - Token for access
  • uuid - Unique identifier of a Bluetooth Low Energy location beacon.
  • major - Optional. Major identifier of a Bluetooth Low Energy location beacon.
  • minor - Optional. Minor identifier of a Bluetooth Low Energy location beacon.

  • Response: {
       "result" : true,
       "id" : 289,
       "name" : "Template Name"
    }
    Download a specific PassBook: GET /pbook.download
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook

  • Response: File: pass.pkpass
    Delete PassBook template: GET /pbook.deleteTemplate
    URL Parameters:
  • token - Token for access
  • idTemplate - ID Template

  • Response: {
       "result" : true
    }
    Delete PassBook: GET /pbook.deleteBook
    URL Parameters:
  • token - Token for access
  • idBook - ID PassBook

  • Response: {
       "result" : true
    }

    Message

    Upload attachment for Message: POST /pbook.uploadReceiptAttachment
    URL Parameters:
  • token - Token for access
  • attachment - Only PDF file. Max size 10mb

  • Response: {
       "result" : true,
       "file_name":"c8WbmYLu7mNVs2vwCeXmvnv7z5HJ.pdf",
       "type":"attachment"
    }

    OR

    {
       "result" : false,
       "msg": "error message"
    }

    For example form: <form action="http://pass.passhound.com/api/pbook.uploadReceiptAttachment" method="POST" enctype="multipart/form-data">
               <input type="text" name="token" value="es9gtfiga5a69nibk7eg7mf7voolact7" />
               <input type="file" name="attachment" value="" />
               <input type="submit" value="SEND" />
    </form>
    Email Message a PassBook to someone: POST /pbook.sendReceipt
    URL Parameters:
  • token - Token for access
  • idBook - Optional. ID PassBook
  • id_email_tmp - ID Message E-mail template.
  • email - E-mail address of the recipient. To pass multiple addresses, use the separator ", or ;"
  • message - Optional. Body of the mail
  • attachment - Optional. Uploaded file attachment name Default value: Use attachment from template

  • Response: {
       "result" : true
    }

    OR

    {
       "result" : false,
       "msg": "error message"
    }

    For example request: POST /pbook.sendReceipt
    ?token=d5206c1e2217f84fc62878c580546184
    idBook=10908
    id_email_tmp=2
    email=exmplate@example.com
    attachment=c8WbmYLu7mNVs2vwCNtdO284Mf8vXoISavFWcYteXmvnv7z5HJ.pdf
    message=PassBook link: {url}