API Documentation

API-Documentation-Header-Banner1
Account

PassBook

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”,
“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”,
“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_tmpOptional. 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
}

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

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

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
  • iconOptional. Icon image. Type: PNG
  • logoOptional. Logo image. Type: PNG
  • stripOptional. Strip image. Type: PNG
  • thumbnailOptional. Thumbnail image. Type: PNG
  • backgroundOptional. Background image. Type: PNG

Response:

{
“result” : true
}

For example form:

<form action=”http://pass.ivend.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
  • stripOptional. Strip image. Type: PNG
  • thumbnailOptional. Thumbnail image. Type: PNG

Response:

{
“result” : true
}

For example form:

<form action=”http://pass.ivend.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”
}
]
}

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
}