Pass Templates
Create Pass Template
Pass Templates are created asynchronously and the response will return a 202 status code. Use the URL returned in the response to check the status of the pass template.
POST
/
api
/
v1
/
pass-templates
Create Pass Template
curl --request POST \
--url https://api.passentry.com/api/v1/pass-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"passTemplate": {
"name": "PassEntry Supermarket",
"templateType": "generic",
"defaultLanguage": "en",
"centralTitle": "PassEntry Supermarket",
"notificationHeader": "PassEntry Supermarket",
"description": "PassEntry Supermarket",
"colors": {
"background": "#dbdbdb",
"label": "#000000",
"text": "#000000"
},
"images": {
"banner": "https://example.com/images/banner.jpg",
"logo": "https://example.com/images/logo.jpg",
"icon": "https://example.com/images/icon.jpg",
"watermark": {
"color": "light",
"position": "bottomRight"
}
},
"fields": {
"header": {
"one": {
"id": "points",
"label": "Points",
"defaultValue": "0",
"localisation": {
"fr": {
"label": "Points",
"defaultValue": "0"
},
"is": {
"label": "Stig",
"defaultValue": "0"
}
}
}
},
"central": {
"one": {
"id": "name",
"label": "Central",
"defaultValue": "Sample Name",
"localisation": {
"fr": {
"label": "Central",
"defaultValue": "Exemple de Nom"
},
"is": {
"label": "Miðja",
"defaultValue": "Sýnishorn Nafn"
}
}
}
},
"details": {
"one": {
"id": "name",
"label": "Name",
"defaultValue": "Jane Doe",
"localisation": {
"fr": {
"label": "Nom",
"defaultValue": "Jeanne Dupont"
},
"is": {
"label": "Nafn",
"defaultValue": "Jóna Jónsdóttir"
}
}
},
"two": {
"id": "discount",
"label": "Discount",
"defaultValue": "15%",
"localisation": {
"fr": {
"label": "Réduction",
"defaultValue": "15%"
},
"is": {
"label": "Afsláttur",
"defaultValue": "15%"
}
}
},
"three": {
"id": "tier",
"label": "Membership Tier",
"defaultValue": "Silver",
"localisation": {
"fr": {
"label": "Niveau de fidélité",
"defaultValue": "Argent"
},
"is": {
"label": "Aðildarstig",
"defaultValue": "Silfur"
}
}
}
},
"back": {
"one": {
"id": "email",
"label": "Email",
"defaultValue": "[email protected]",
"localisation": {
"fr": {
"label": "E-mail",
"defaultValue": "[email protected]"
},
"is": {
"label": "Netfang",
"defaultValue": "[email protected]"
}
}
}
}
},
"appLinking": {
"apple": {
"appStoreUrl": [
"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997"
]
},
"google": {
"app": {
"playStoreUrl": "https://play.google.com/store/apps/details?id=com.whatsapp"
},
"displayText": {
"text": "Click here for more!"
}
}
},
"barcode": {
"enabled": true,
"type": "qr",
"source": "custom",
"value": "123abcd"
},
"locations": [
{
"name": "Venue",
"latitude": 51.54321132456805,
"longitude": -0.022901231803803924,
"radius": 100,
"message": "Welcome to the venue"
}
],
"beacons": [
{
"name": "Beacon",
"proximityUuid": "123e4567-e89b-12d3-a456-426614174000",
"major": 1,
"minor": 1,
"message": "Welcome to the venue"
}
]
}
}
'import requests
url = "https://api.passentry.com/api/v1/pass-templates"
payload = { "passTemplate": {
"name": "PassEntry Supermarket",
"templateType": "generic",
"defaultLanguage": "en",
"centralTitle": "PassEntry Supermarket",
"notificationHeader": "PassEntry Supermarket",
"description": "PassEntry Supermarket",
"colors": {
"background": "#dbdbdb",
"label": "#000000",
"text": "#000000"
},
"images": {
"banner": "https://example.com/images/banner.jpg",
"logo": "https://example.com/images/logo.jpg",
"icon": "https://example.com/images/icon.jpg",
"watermark": {
"color": "light",
"position": "bottomRight"
}
},
"fields": {
"header": { "one": {
"id": "points",
"label": "Points",
"defaultValue": "0",
"localisation": {
"fr": {
"label": "Points",
"defaultValue": "0"
},
"is": {
"label": "Stig",
"defaultValue": "0"
}
}
} },
"central": { "one": {
"id": "name",
"label": "Central",
"defaultValue": "Sample Name",
"localisation": {
"fr": {
"label": "Central",
"defaultValue": "Exemple de Nom"
},
"is": {
"label": "Miðja",
"defaultValue": "Sýnishorn Nafn"
}
}
} },
"details": {
"one": {
"id": "name",
"label": "Name",
"defaultValue": "Jane Doe",
"localisation": {
"fr": {
"label": "Nom",
"defaultValue": "Jeanne Dupont"
},
"is": {
"label": "Nafn",
"defaultValue": "Jóna Jónsdóttir"
}
}
},
"two": {
"id": "discount",
"label": "Discount",
"defaultValue": "15%",
"localisation": {
"fr": {
"label": "Réduction",
"defaultValue": "15%"
},
"is": {
"label": "Afsláttur",
"defaultValue": "15%"
}
}
},
"three": {
"id": "tier",
"label": "Membership Tier",
"defaultValue": "Silver",
"localisation": {
"fr": {
"label": "Niveau de fidélité",
"defaultValue": "Argent"
},
"is": {
"label": "Aðildarstig",
"defaultValue": "Silfur"
}
}
}
},
"back": { "one": {
"id": "email",
"label": "Email",
"defaultValue": "[email protected]",
"localisation": {
"fr": {
"label": "E-mail",
"defaultValue": "[email protected]"
},
"is": {
"label": "Netfang",
"defaultValue": "[email protected]"
}
}
} }
},
"appLinking": {
"apple": { "appStoreUrl": ["https://apps.apple.com/gb/app/whatsapp-messenger/id310633997"] },
"google": {
"app": { "playStoreUrl": "https://play.google.com/store/apps/details?id=com.whatsapp" },
"displayText": { "text": "Click here for more!" }
}
},
"barcode": {
"enabled": True,
"type": "qr",
"source": "custom",
"value": "123abcd"
},
"locations": [
{
"name": "Venue",
"latitude": 51.54321132456805,
"longitude": -0.022901231803803924,
"radius": 100,
"message": "Welcome to the venue"
}
],
"beacons": [
{
"name": "Beacon",
"proximityUuid": "123e4567-e89b-12d3-a456-426614174000",
"major": 1,
"minor": 1,
"message": "Welcome to the venue"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
passTemplate: {
name: 'PassEntry Supermarket',
templateType: 'generic',
defaultLanguage: 'en',
centralTitle: 'PassEntry Supermarket',
notificationHeader: 'PassEntry Supermarket',
description: 'PassEntry Supermarket',
colors: {background: '#dbdbdb', label: '#000000', text: '#000000'},
images: {
banner: 'https://example.com/images/banner.jpg',
logo: 'https://example.com/images/logo.jpg',
icon: 'https://example.com/images/icon.jpg',
watermark: {color: 'light', position: 'bottomRight'}
},
fields: {
header: {
one: {
id: 'points',
label: 'Points',
defaultValue: '0',
localisation: {
fr: {label: 'Points', defaultValue: '0'},
is: {label: 'Stig', defaultValue: '0'}
}
}
},
central: {
one: {
id: 'name',
label: 'Central',
defaultValue: 'Sample Name',
localisation: {
fr: {label: 'Central', defaultValue: 'Exemple de Nom'},
is: {label: 'Miðja', defaultValue: 'Sýnishorn Nafn'}
}
}
},
details: {
one: {
id: 'name',
label: 'Name',
defaultValue: 'Jane Doe',
localisation: {
fr: {label: 'Nom', defaultValue: 'Jeanne Dupont'},
is: {label: 'Nafn', defaultValue: 'Jóna Jónsdóttir'}
}
},
two: {
id: 'discount',
label: 'Discount',
defaultValue: '15%',
localisation: {
fr: {label: 'Réduction', defaultValue: '15%'},
is: {label: 'Afsláttur', defaultValue: '15%'}
}
},
three: {
id: 'tier',
label: 'Membership Tier',
defaultValue: 'Silver',
localisation: {
fr: {label: 'Niveau de fidélité', defaultValue: 'Argent'},
is: {label: 'Aðildarstig', defaultValue: 'Silfur'}
}
}
},
back: {
one: {
id: 'email',
label: 'Email',
defaultValue: '[email protected]',
localisation: {
fr: {label: 'E-mail', defaultValue: '[email protected]'},
is: {label: 'Netfang', defaultValue: '[email protected]'}
}
}
}
},
appLinking: {
apple: {appStoreUrl: ['https://apps.apple.com/gb/app/whatsapp-messenger/id310633997']},
google: {
app: {playStoreUrl: 'https://play.google.com/store/apps/details?id=com.whatsapp'},
displayText: {text: 'Click here for more!'}
}
},
barcode: {enabled: true, type: 'qr', source: 'custom', value: '123abcd'},
locations: [
{
name: 'Venue',
latitude: 51.54321132456805,
longitude: -0.022901231803803924,
radius: 100,
message: 'Welcome to the venue'
}
],
beacons: [
{
name: 'Beacon',
proximityUuid: '123e4567-e89b-12d3-a456-426614174000',
major: 1,
minor: 1,
message: 'Welcome to the venue'
}
]
}
})
};
fetch('https://api.passentry.com/api/v1/pass-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.passentry.com/api/v1/pass-templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'passTemplate' => [
'name' => 'PassEntry Supermarket',
'templateType' => 'generic',
'defaultLanguage' => 'en',
'centralTitle' => 'PassEntry Supermarket',
'notificationHeader' => 'PassEntry Supermarket',
'description' => 'PassEntry Supermarket',
'colors' => [
'background' => '#dbdbdb',
'label' => '#000000',
'text' => '#000000'
],
'images' => [
'banner' => 'https://example.com/images/banner.jpg',
'logo' => 'https://example.com/images/logo.jpg',
'icon' => 'https://example.com/images/icon.jpg',
'watermark' => [
'color' => 'light',
'position' => 'bottomRight'
]
],
'fields' => [
'header' => [
'one' => [
'id' => 'points',
'label' => 'Points',
'defaultValue' => '0',
'localisation' => [
'fr' => [
'label' => 'Points',
'defaultValue' => '0'
],
'is' => [
'label' => 'Stig',
'defaultValue' => '0'
]
]
]
],
'central' => [
'one' => [
'id' => 'name',
'label' => 'Central',
'defaultValue' => 'Sample Name',
'localisation' => [
'fr' => [
'label' => 'Central',
'defaultValue' => 'Exemple de Nom'
],
'is' => [
'label' => 'Miðja',
'defaultValue' => 'Sýnishorn Nafn'
]
]
]
],
'details' => [
'one' => [
'id' => 'name',
'label' => 'Name',
'defaultValue' => 'Jane Doe',
'localisation' => [
'fr' => [
'label' => 'Nom',
'defaultValue' => 'Jeanne Dupont'
],
'is' => [
'label' => 'Nafn',
'defaultValue' => 'Jóna Jónsdóttir'
]
]
],
'two' => [
'id' => 'discount',
'label' => 'Discount',
'defaultValue' => '15%',
'localisation' => [
'fr' => [
'label' => 'Réduction',
'defaultValue' => '15%'
],
'is' => [
'label' => 'Afsláttur',
'defaultValue' => '15%'
]
]
],
'three' => [
'id' => 'tier',
'label' => 'Membership Tier',
'defaultValue' => 'Silver',
'localisation' => [
'fr' => [
'label' => 'Niveau de fidélité',
'defaultValue' => 'Argent'
],
'is' => [
'label' => 'Aðildarstig',
'defaultValue' => 'Silfur'
]
]
]
],
'back' => [
'one' => [
'id' => 'email',
'label' => 'Email',
'defaultValue' => '[email protected]',
'localisation' => [
'fr' => [
'label' => 'E-mail',
'defaultValue' => '[email protected]'
],
'is' => [
'label' => 'Netfang',
'defaultValue' => '[email protected]'
]
]
]
]
],
'appLinking' => [
'apple' => [
'appStoreUrl' => [
'https://apps.apple.com/gb/app/whatsapp-messenger/id310633997'
]
],
'google' => [
'app' => [
'playStoreUrl' => 'https://play.google.com/store/apps/details?id=com.whatsapp'
],
'displayText' => [
'text' => 'Click here for more!'
]
]
],
'barcode' => [
'enabled' => true,
'type' => 'qr',
'source' => 'custom',
'value' => '123abcd'
],
'locations' => [
[
'name' => 'Venue',
'latitude' => 51.54321132456805,
'longitude' => -0.022901231803803924,
'radius' => 100,
'message' => 'Welcome to the venue'
]
],
'beacons' => [
[
'name' => 'Beacon',
'proximityUuid' => '123e4567-e89b-12d3-a456-426614174000',
'major' => 1,
'minor' => 1,
'message' => 'Welcome to the venue'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.passentry.com/api/v1/pass-templates"
payload := strings.NewReader("{\n \"passTemplate\": {\n \"name\": \"PassEntry Supermarket\",\n \"templateType\": \"generic\",\n \"defaultLanguage\": \"en\",\n \"centralTitle\": \"PassEntry Supermarket\",\n \"notificationHeader\": \"PassEntry Supermarket\",\n \"description\": \"PassEntry Supermarket\",\n \"colors\": {\n \"background\": \"#dbdbdb\",\n \"label\": \"#000000\",\n \"text\": \"#000000\"\n },\n \"images\": {\n \"banner\": \"https://example.com/images/banner.jpg\",\n \"logo\": \"https://example.com/images/logo.jpg\",\n \"icon\": \"https://example.com/images/icon.jpg\",\n \"watermark\": {\n \"color\": \"light\",\n \"position\": \"bottomRight\"\n }\n },\n \"fields\": {\n \"header\": {\n \"one\": {\n \"id\": \"points\",\n \"label\": \"Points\",\n \"defaultValue\": \"0\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Points\",\n \"defaultValue\": \"0\"\n },\n \"is\": {\n \"label\": \"Stig\",\n \"defaultValue\": \"0\"\n }\n }\n }\n },\n \"central\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Central\",\n \"defaultValue\": \"Sample Name\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Central\",\n \"defaultValue\": \"Exemple de Nom\"\n },\n \"is\": {\n \"label\": \"Miðja\",\n \"defaultValue\": \"Sýnishorn Nafn\"\n }\n }\n }\n },\n \"details\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Name\",\n \"defaultValue\": \"Jane Doe\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Nom\",\n \"defaultValue\": \"Jeanne Dupont\"\n },\n \"is\": {\n \"label\": \"Nafn\",\n \"defaultValue\": \"Jóna Jónsdóttir\"\n }\n }\n },\n \"two\": {\n \"id\": \"discount\",\n \"label\": \"Discount\",\n \"defaultValue\": \"15%\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Réduction\",\n \"defaultValue\": \"15%\"\n },\n \"is\": {\n \"label\": \"Afsláttur\",\n \"defaultValue\": \"15%\"\n }\n }\n },\n \"three\": {\n \"id\": \"tier\",\n \"label\": \"Membership Tier\",\n \"defaultValue\": \"Silver\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Niveau de fidélité\",\n \"defaultValue\": \"Argent\"\n },\n \"is\": {\n \"label\": \"Aðildarstig\",\n \"defaultValue\": \"Silfur\"\n }\n }\n }\n },\n \"back\": {\n \"one\": {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"defaultValue\": \"[email protected]\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"E-mail\",\n \"defaultValue\": \"[email protected]\"\n },\n \"is\": {\n \"label\": \"Netfang\",\n \"defaultValue\": \"[email protected]\"\n }\n }\n }\n }\n },\n \"appLinking\": {\n \"apple\": {\n \"appStoreUrl\": [\n \"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997\"\n ]\n },\n \"google\": {\n \"app\": {\n \"playStoreUrl\": \"https://play.google.com/store/apps/details?id=com.whatsapp\"\n },\n \"displayText\": {\n \"text\": \"Click here for more!\"\n }\n }\n },\n \"barcode\": {\n \"enabled\": true,\n \"type\": \"qr\",\n \"source\": \"custom\",\n \"value\": \"123abcd\"\n },\n \"locations\": [\n {\n \"name\": \"Venue\",\n \"latitude\": 51.54321132456805,\n \"longitude\": -0.022901231803803924,\n \"radius\": 100,\n \"message\": \"Welcome to the venue\"\n }\n ],\n \"beacons\": [\n {\n \"name\": \"Beacon\",\n \"proximityUuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"major\": 1,\n \"minor\": 1,\n \"message\": \"Welcome to the venue\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.passentry.com/api/v1/pass-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"passTemplate\": {\n \"name\": \"PassEntry Supermarket\",\n \"templateType\": \"generic\",\n \"defaultLanguage\": \"en\",\n \"centralTitle\": \"PassEntry Supermarket\",\n \"notificationHeader\": \"PassEntry Supermarket\",\n \"description\": \"PassEntry Supermarket\",\n \"colors\": {\n \"background\": \"#dbdbdb\",\n \"label\": \"#000000\",\n \"text\": \"#000000\"\n },\n \"images\": {\n \"banner\": \"https://example.com/images/banner.jpg\",\n \"logo\": \"https://example.com/images/logo.jpg\",\n \"icon\": \"https://example.com/images/icon.jpg\",\n \"watermark\": {\n \"color\": \"light\",\n \"position\": \"bottomRight\"\n }\n },\n \"fields\": {\n \"header\": {\n \"one\": {\n \"id\": \"points\",\n \"label\": \"Points\",\n \"defaultValue\": \"0\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Points\",\n \"defaultValue\": \"0\"\n },\n \"is\": {\n \"label\": \"Stig\",\n \"defaultValue\": \"0\"\n }\n }\n }\n },\n \"central\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Central\",\n \"defaultValue\": \"Sample Name\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Central\",\n \"defaultValue\": \"Exemple de Nom\"\n },\n \"is\": {\n \"label\": \"Miðja\",\n \"defaultValue\": \"Sýnishorn Nafn\"\n }\n }\n }\n },\n \"details\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Name\",\n \"defaultValue\": \"Jane Doe\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Nom\",\n \"defaultValue\": \"Jeanne Dupont\"\n },\n \"is\": {\n \"label\": \"Nafn\",\n \"defaultValue\": \"Jóna Jónsdóttir\"\n }\n }\n },\n \"two\": {\n \"id\": \"discount\",\n \"label\": \"Discount\",\n \"defaultValue\": \"15%\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Réduction\",\n \"defaultValue\": \"15%\"\n },\n \"is\": {\n \"label\": \"Afsláttur\",\n \"defaultValue\": \"15%\"\n }\n }\n },\n \"three\": {\n \"id\": \"tier\",\n \"label\": \"Membership Tier\",\n \"defaultValue\": \"Silver\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Niveau de fidélité\",\n \"defaultValue\": \"Argent\"\n },\n \"is\": {\n \"label\": \"Aðildarstig\",\n \"defaultValue\": \"Silfur\"\n }\n }\n }\n },\n \"back\": {\n \"one\": {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"defaultValue\": \"[email protected]\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"E-mail\",\n \"defaultValue\": \"[email protected]\"\n },\n \"is\": {\n \"label\": \"Netfang\",\n \"defaultValue\": \"[email protected]\"\n }\n }\n }\n }\n },\n \"appLinking\": {\n \"apple\": {\n \"appStoreUrl\": [\n \"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997\"\n ]\n },\n \"google\": {\n \"app\": {\n \"playStoreUrl\": \"https://play.google.com/store/apps/details?id=com.whatsapp\"\n },\n \"displayText\": {\n \"text\": \"Click here for more!\"\n }\n }\n },\n \"barcode\": {\n \"enabled\": true,\n \"type\": \"qr\",\n \"source\": \"custom\",\n \"value\": \"123abcd\"\n },\n \"locations\": [\n {\n \"name\": \"Venue\",\n \"latitude\": 51.54321132456805,\n \"longitude\": -0.022901231803803924,\n \"radius\": 100,\n \"message\": \"Welcome to the venue\"\n }\n ],\n \"beacons\": [\n {\n \"name\": \"Beacon\",\n \"proximityUuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"major\": 1,\n \"minor\": 1,\n \"message\": \"Welcome to the venue\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.passentry.com/api/v1/pass-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"passTemplate\": {\n \"name\": \"PassEntry Supermarket\",\n \"templateType\": \"generic\",\n \"defaultLanguage\": \"en\",\n \"centralTitle\": \"PassEntry Supermarket\",\n \"notificationHeader\": \"PassEntry Supermarket\",\n \"description\": \"PassEntry Supermarket\",\n \"colors\": {\n \"background\": \"#dbdbdb\",\n \"label\": \"#000000\",\n \"text\": \"#000000\"\n },\n \"images\": {\n \"banner\": \"https://example.com/images/banner.jpg\",\n \"logo\": \"https://example.com/images/logo.jpg\",\n \"icon\": \"https://example.com/images/icon.jpg\",\n \"watermark\": {\n \"color\": \"light\",\n \"position\": \"bottomRight\"\n }\n },\n \"fields\": {\n \"header\": {\n \"one\": {\n \"id\": \"points\",\n \"label\": \"Points\",\n \"defaultValue\": \"0\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Points\",\n \"defaultValue\": \"0\"\n },\n \"is\": {\n \"label\": \"Stig\",\n \"defaultValue\": \"0\"\n }\n }\n }\n },\n \"central\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Central\",\n \"defaultValue\": \"Sample Name\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Central\",\n \"defaultValue\": \"Exemple de Nom\"\n },\n \"is\": {\n \"label\": \"Miðja\",\n \"defaultValue\": \"Sýnishorn Nafn\"\n }\n }\n }\n },\n \"details\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Name\",\n \"defaultValue\": \"Jane Doe\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Nom\",\n \"defaultValue\": \"Jeanne Dupont\"\n },\n \"is\": {\n \"label\": \"Nafn\",\n \"defaultValue\": \"Jóna Jónsdóttir\"\n }\n }\n },\n \"two\": {\n \"id\": \"discount\",\n \"label\": \"Discount\",\n \"defaultValue\": \"15%\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Réduction\",\n \"defaultValue\": \"15%\"\n },\n \"is\": {\n \"label\": \"Afsláttur\",\n \"defaultValue\": \"15%\"\n }\n }\n },\n \"three\": {\n \"id\": \"tier\",\n \"label\": \"Membership Tier\",\n \"defaultValue\": \"Silver\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Niveau de fidélité\",\n \"defaultValue\": \"Argent\"\n },\n \"is\": {\n \"label\": \"Aðildarstig\",\n \"defaultValue\": \"Silfur\"\n }\n }\n }\n },\n \"back\": {\n \"one\": {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"defaultValue\": \"[email protected]\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"E-mail\",\n \"defaultValue\": \"[email protected]\"\n },\n \"is\": {\n \"label\": \"Netfang\",\n \"defaultValue\": \"[email protected]\"\n }\n }\n }\n }\n },\n \"appLinking\": {\n \"apple\": {\n \"appStoreUrl\": [\n \"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997\"\n ]\n },\n \"google\": {\n \"app\": {\n \"playStoreUrl\": \"https://play.google.com/store/apps/details?id=com.whatsapp\"\n },\n \"displayText\": {\n \"text\": \"Click here for more!\"\n }\n }\n },\n \"barcode\": {\n \"enabled\": true,\n \"type\": \"qr\",\n \"source\": \"custom\",\n \"value\": \"123abcd\"\n },\n \"locations\": [\n {\n \"name\": \"Venue\",\n \"latitude\": 51.54321132456805,\n \"longitude\": -0.022901231803803924,\n \"radius\": 100,\n \"message\": \"Welcome to the venue\"\n }\n ],\n \"beacons\": [\n {\n \"name\": \"Beacon\",\n \"proximityUuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"major\": 1,\n \"minor\": 1,\n \"message\": \"Welcome to the venue\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "19cb334f9696e64e10e7759f0",
"type": "passTemplate",
"attributes": {
"name": "PassEntry Supermarket"
},
"meta": {
"message": "Your pass template is being processed, please check again in a few moments.",
"links": {
"self": "https://api.passentry.com/v1/pass-templates/19cb334f9696e64e10e7759f0"
}
}
}{
"errors": [
"<string>"
]
}{
"errors": [
"<string>"
]
}{
"errors": [
"<string>"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Pass Template object
Show child attributes
Show child attributes
Was this page helpful?
Previous
Update Pass TemplateSupports partial updates. <br/> Response may either be a 200 or 202 status code. Use the URL returned in the response to check the status of the pass template.
Next
⌘I
Create Pass Template
curl --request POST \
--url https://api.passentry.com/api/v1/pass-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"passTemplate": {
"name": "PassEntry Supermarket",
"templateType": "generic",
"defaultLanguage": "en",
"centralTitle": "PassEntry Supermarket",
"notificationHeader": "PassEntry Supermarket",
"description": "PassEntry Supermarket",
"colors": {
"background": "#dbdbdb",
"label": "#000000",
"text": "#000000"
},
"images": {
"banner": "https://example.com/images/banner.jpg",
"logo": "https://example.com/images/logo.jpg",
"icon": "https://example.com/images/icon.jpg",
"watermark": {
"color": "light",
"position": "bottomRight"
}
},
"fields": {
"header": {
"one": {
"id": "points",
"label": "Points",
"defaultValue": "0",
"localisation": {
"fr": {
"label": "Points",
"defaultValue": "0"
},
"is": {
"label": "Stig",
"defaultValue": "0"
}
}
}
},
"central": {
"one": {
"id": "name",
"label": "Central",
"defaultValue": "Sample Name",
"localisation": {
"fr": {
"label": "Central",
"defaultValue": "Exemple de Nom"
},
"is": {
"label": "Miðja",
"defaultValue": "Sýnishorn Nafn"
}
}
}
},
"details": {
"one": {
"id": "name",
"label": "Name",
"defaultValue": "Jane Doe",
"localisation": {
"fr": {
"label": "Nom",
"defaultValue": "Jeanne Dupont"
},
"is": {
"label": "Nafn",
"defaultValue": "Jóna Jónsdóttir"
}
}
},
"two": {
"id": "discount",
"label": "Discount",
"defaultValue": "15%",
"localisation": {
"fr": {
"label": "Réduction",
"defaultValue": "15%"
},
"is": {
"label": "Afsláttur",
"defaultValue": "15%"
}
}
},
"three": {
"id": "tier",
"label": "Membership Tier",
"defaultValue": "Silver",
"localisation": {
"fr": {
"label": "Niveau de fidélité",
"defaultValue": "Argent"
},
"is": {
"label": "Aðildarstig",
"defaultValue": "Silfur"
}
}
}
},
"back": {
"one": {
"id": "email",
"label": "Email",
"defaultValue": "[email protected]",
"localisation": {
"fr": {
"label": "E-mail",
"defaultValue": "[email protected]"
},
"is": {
"label": "Netfang",
"defaultValue": "[email protected]"
}
}
}
}
},
"appLinking": {
"apple": {
"appStoreUrl": [
"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997"
]
},
"google": {
"app": {
"playStoreUrl": "https://play.google.com/store/apps/details?id=com.whatsapp"
},
"displayText": {
"text": "Click here for more!"
}
}
},
"barcode": {
"enabled": true,
"type": "qr",
"source": "custom",
"value": "123abcd"
},
"locations": [
{
"name": "Venue",
"latitude": 51.54321132456805,
"longitude": -0.022901231803803924,
"radius": 100,
"message": "Welcome to the venue"
}
],
"beacons": [
{
"name": "Beacon",
"proximityUuid": "123e4567-e89b-12d3-a456-426614174000",
"major": 1,
"minor": 1,
"message": "Welcome to the venue"
}
]
}
}
'import requests
url = "https://api.passentry.com/api/v1/pass-templates"
payload = { "passTemplate": {
"name": "PassEntry Supermarket",
"templateType": "generic",
"defaultLanguage": "en",
"centralTitle": "PassEntry Supermarket",
"notificationHeader": "PassEntry Supermarket",
"description": "PassEntry Supermarket",
"colors": {
"background": "#dbdbdb",
"label": "#000000",
"text": "#000000"
},
"images": {
"banner": "https://example.com/images/banner.jpg",
"logo": "https://example.com/images/logo.jpg",
"icon": "https://example.com/images/icon.jpg",
"watermark": {
"color": "light",
"position": "bottomRight"
}
},
"fields": {
"header": { "one": {
"id": "points",
"label": "Points",
"defaultValue": "0",
"localisation": {
"fr": {
"label": "Points",
"defaultValue": "0"
},
"is": {
"label": "Stig",
"defaultValue": "0"
}
}
} },
"central": { "one": {
"id": "name",
"label": "Central",
"defaultValue": "Sample Name",
"localisation": {
"fr": {
"label": "Central",
"defaultValue": "Exemple de Nom"
},
"is": {
"label": "Miðja",
"defaultValue": "Sýnishorn Nafn"
}
}
} },
"details": {
"one": {
"id": "name",
"label": "Name",
"defaultValue": "Jane Doe",
"localisation": {
"fr": {
"label": "Nom",
"defaultValue": "Jeanne Dupont"
},
"is": {
"label": "Nafn",
"defaultValue": "Jóna Jónsdóttir"
}
}
},
"two": {
"id": "discount",
"label": "Discount",
"defaultValue": "15%",
"localisation": {
"fr": {
"label": "Réduction",
"defaultValue": "15%"
},
"is": {
"label": "Afsláttur",
"defaultValue": "15%"
}
}
},
"three": {
"id": "tier",
"label": "Membership Tier",
"defaultValue": "Silver",
"localisation": {
"fr": {
"label": "Niveau de fidélité",
"defaultValue": "Argent"
},
"is": {
"label": "Aðildarstig",
"defaultValue": "Silfur"
}
}
}
},
"back": { "one": {
"id": "email",
"label": "Email",
"defaultValue": "[email protected]",
"localisation": {
"fr": {
"label": "E-mail",
"defaultValue": "[email protected]"
},
"is": {
"label": "Netfang",
"defaultValue": "[email protected]"
}
}
} }
},
"appLinking": {
"apple": { "appStoreUrl": ["https://apps.apple.com/gb/app/whatsapp-messenger/id310633997"] },
"google": {
"app": { "playStoreUrl": "https://play.google.com/store/apps/details?id=com.whatsapp" },
"displayText": { "text": "Click here for more!" }
}
},
"barcode": {
"enabled": True,
"type": "qr",
"source": "custom",
"value": "123abcd"
},
"locations": [
{
"name": "Venue",
"latitude": 51.54321132456805,
"longitude": -0.022901231803803924,
"radius": 100,
"message": "Welcome to the venue"
}
],
"beacons": [
{
"name": "Beacon",
"proximityUuid": "123e4567-e89b-12d3-a456-426614174000",
"major": 1,
"minor": 1,
"message": "Welcome to the venue"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
passTemplate: {
name: 'PassEntry Supermarket',
templateType: 'generic',
defaultLanguage: 'en',
centralTitle: 'PassEntry Supermarket',
notificationHeader: 'PassEntry Supermarket',
description: 'PassEntry Supermarket',
colors: {background: '#dbdbdb', label: '#000000', text: '#000000'},
images: {
banner: 'https://example.com/images/banner.jpg',
logo: 'https://example.com/images/logo.jpg',
icon: 'https://example.com/images/icon.jpg',
watermark: {color: 'light', position: 'bottomRight'}
},
fields: {
header: {
one: {
id: 'points',
label: 'Points',
defaultValue: '0',
localisation: {
fr: {label: 'Points', defaultValue: '0'},
is: {label: 'Stig', defaultValue: '0'}
}
}
},
central: {
one: {
id: 'name',
label: 'Central',
defaultValue: 'Sample Name',
localisation: {
fr: {label: 'Central', defaultValue: 'Exemple de Nom'},
is: {label: 'Miðja', defaultValue: 'Sýnishorn Nafn'}
}
}
},
details: {
one: {
id: 'name',
label: 'Name',
defaultValue: 'Jane Doe',
localisation: {
fr: {label: 'Nom', defaultValue: 'Jeanne Dupont'},
is: {label: 'Nafn', defaultValue: 'Jóna Jónsdóttir'}
}
},
two: {
id: 'discount',
label: 'Discount',
defaultValue: '15%',
localisation: {
fr: {label: 'Réduction', defaultValue: '15%'},
is: {label: 'Afsláttur', defaultValue: '15%'}
}
},
three: {
id: 'tier',
label: 'Membership Tier',
defaultValue: 'Silver',
localisation: {
fr: {label: 'Niveau de fidélité', defaultValue: 'Argent'},
is: {label: 'Aðildarstig', defaultValue: 'Silfur'}
}
}
},
back: {
one: {
id: 'email',
label: 'Email',
defaultValue: '[email protected]',
localisation: {
fr: {label: 'E-mail', defaultValue: '[email protected]'},
is: {label: 'Netfang', defaultValue: '[email protected]'}
}
}
}
},
appLinking: {
apple: {appStoreUrl: ['https://apps.apple.com/gb/app/whatsapp-messenger/id310633997']},
google: {
app: {playStoreUrl: 'https://play.google.com/store/apps/details?id=com.whatsapp'},
displayText: {text: 'Click here for more!'}
}
},
barcode: {enabled: true, type: 'qr', source: 'custom', value: '123abcd'},
locations: [
{
name: 'Venue',
latitude: 51.54321132456805,
longitude: -0.022901231803803924,
radius: 100,
message: 'Welcome to the venue'
}
],
beacons: [
{
name: 'Beacon',
proximityUuid: '123e4567-e89b-12d3-a456-426614174000',
major: 1,
minor: 1,
message: 'Welcome to the venue'
}
]
}
})
};
fetch('https://api.passentry.com/api/v1/pass-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.passentry.com/api/v1/pass-templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'passTemplate' => [
'name' => 'PassEntry Supermarket',
'templateType' => 'generic',
'defaultLanguage' => 'en',
'centralTitle' => 'PassEntry Supermarket',
'notificationHeader' => 'PassEntry Supermarket',
'description' => 'PassEntry Supermarket',
'colors' => [
'background' => '#dbdbdb',
'label' => '#000000',
'text' => '#000000'
],
'images' => [
'banner' => 'https://example.com/images/banner.jpg',
'logo' => 'https://example.com/images/logo.jpg',
'icon' => 'https://example.com/images/icon.jpg',
'watermark' => [
'color' => 'light',
'position' => 'bottomRight'
]
],
'fields' => [
'header' => [
'one' => [
'id' => 'points',
'label' => 'Points',
'defaultValue' => '0',
'localisation' => [
'fr' => [
'label' => 'Points',
'defaultValue' => '0'
],
'is' => [
'label' => 'Stig',
'defaultValue' => '0'
]
]
]
],
'central' => [
'one' => [
'id' => 'name',
'label' => 'Central',
'defaultValue' => 'Sample Name',
'localisation' => [
'fr' => [
'label' => 'Central',
'defaultValue' => 'Exemple de Nom'
],
'is' => [
'label' => 'Miðja',
'defaultValue' => 'Sýnishorn Nafn'
]
]
]
],
'details' => [
'one' => [
'id' => 'name',
'label' => 'Name',
'defaultValue' => 'Jane Doe',
'localisation' => [
'fr' => [
'label' => 'Nom',
'defaultValue' => 'Jeanne Dupont'
],
'is' => [
'label' => 'Nafn',
'defaultValue' => 'Jóna Jónsdóttir'
]
]
],
'two' => [
'id' => 'discount',
'label' => 'Discount',
'defaultValue' => '15%',
'localisation' => [
'fr' => [
'label' => 'Réduction',
'defaultValue' => '15%'
],
'is' => [
'label' => 'Afsláttur',
'defaultValue' => '15%'
]
]
],
'three' => [
'id' => 'tier',
'label' => 'Membership Tier',
'defaultValue' => 'Silver',
'localisation' => [
'fr' => [
'label' => 'Niveau de fidélité',
'defaultValue' => 'Argent'
],
'is' => [
'label' => 'Aðildarstig',
'defaultValue' => 'Silfur'
]
]
]
],
'back' => [
'one' => [
'id' => 'email',
'label' => 'Email',
'defaultValue' => '[email protected]',
'localisation' => [
'fr' => [
'label' => 'E-mail',
'defaultValue' => '[email protected]'
],
'is' => [
'label' => 'Netfang',
'defaultValue' => '[email protected]'
]
]
]
]
],
'appLinking' => [
'apple' => [
'appStoreUrl' => [
'https://apps.apple.com/gb/app/whatsapp-messenger/id310633997'
]
],
'google' => [
'app' => [
'playStoreUrl' => 'https://play.google.com/store/apps/details?id=com.whatsapp'
],
'displayText' => [
'text' => 'Click here for more!'
]
]
],
'barcode' => [
'enabled' => true,
'type' => 'qr',
'source' => 'custom',
'value' => '123abcd'
],
'locations' => [
[
'name' => 'Venue',
'latitude' => 51.54321132456805,
'longitude' => -0.022901231803803924,
'radius' => 100,
'message' => 'Welcome to the venue'
]
],
'beacons' => [
[
'name' => 'Beacon',
'proximityUuid' => '123e4567-e89b-12d3-a456-426614174000',
'major' => 1,
'minor' => 1,
'message' => 'Welcome to the venue'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.passentry.com/api/v1/pass-templates"
payload := strings.NewReader("{\n \"passTemplate\": {\n \"name\": \"PassEntry Supermarket\",\n \"templateType\": \"generic\",\n \"defaultLanguage\": \"en\",\n \"centralTitle\": \"PassEntry Supermarket\",\n \"notificationHeader\": \"PassEntry Supermarket\",\n \"description\": \"PassEntry Supermarket\",\n \"colors\": {\n \"background\": \"#dbdbdb\",\n \"label\": \"#000000\",\n \"text\": \"#000000\"\n },\n \"images\": {\n \"banner\": \"https://example.com/images/banner.jpg\",\n \"logo\": \"https://example.com/images/logo.jpg\",\n \"icon\": \"https://example.com/images/icon.jpg\",\n \"watermark\": {\n \"color\": \"light\",\n \"position\": \"bottomRight\"\n }\n },\n \"fields\": {\n \"header\": {\n \"one\": {\n \"id\": \"points\",\n \"label\": \"Points\",\n \"defaultValue\": \"0\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Points\",\n \"defaultValue\": \"0\"\n },\n \"is\": {\n \"label\": \"Stig\",\n \"defaultValue\": \"0\"\n }\n }\n }\n },\n \"central\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Central\",\n \"defaultValue\": \"Sample Name\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Central\",\n \"defaultValue\": \"Exemple de Nom\"\n },\n \"is\": {\n \"label\": \"Miðja\",\n \"defaultValue\": \"Sýnishorn Nafn\"\n }\n }\n }\n },\n \"details\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Name\",\n \"defaultValue\": \"Jane Doe\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Nom\",\n \"defaultValue\": \"Jeanne Dupont\"\n },\n \"is\": {\n \"label\": \"Nafn\",\n \"defaultValue\": \"Jóna Jónsdóttir\"\n }\n }\n },\n \"two\": {\n \"id\": \"discount\",\n \"label\": \"Discount\",\n \"defaultValue\": \"15%\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Réduction\",\n \"defaultValue\": \"15%\"\n },\n \"is\": {\n \"label\": \"Afsláttur\",\n \"defaultValue\": \"15%\"\n }\n }\n },\n \"three\": {\n \"id\": \"tier\",\n \"label\": \"Membership Tier\",\n \"defaultValue\": \"Silver\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Niveau de fidélité\",\n \"defaultValue\": \"Argent\"\n },\n \"is\": {\n \"label\": \"Aðildarstig\",\n \"defaultValue\": \"Silfur\"\n }\n }\n }\n },\n \"back\": {\n \"one\": {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"defaultValue\": \"[email protected]\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"E-mail\",\n \"defaultValue\": \"[email protected]\"\n },\n \"is\": {\n \"label\": \"Netfang\",\n \"defaultValue\": \"[email protected]\"\n }\n }\n }\n }\n },\n \"appLinking\": {\n \"apple\": {\n \"appStoreUrl\": [\n \"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997\"\n ]\n },\n \"google\": {\n \"app\": {\n \"playStoreUrl\": \"https://play.google.com/store/apps/details?id=com.whatsapp\"\n },\n \"displayText\": {\n \"text\": \"Click here for more!\"\n }\n }\n },\n \"barcode\": {\n \"enabled\": true,\n \"type\": \"qr\",\n \"source\": \"custom\",\n \"value\": \"123abcd\"\n },\n \"locations\": [\n {\n \"name\": \"Venue\",\n \"latitude\": 51.54321132456805,\n \"longitude\": -0.022901231803803924,\n \"radius\": 100,\n \"message\": \"Welcome to the venue\"\n }\n ],\n \"beacons\": [\n {\n \"name\": \"Beacon\",\n \"proximityUuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"major\": 1,\n \"minor\": 1,\n \"message\": \"Welcome to the venue\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.passentry.com/api/v1/pass-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"passTemplate\": {\n \"name\": \"PassEntry Supermarket\",\n \"templateType\": \"generic\",\n \"defaultLanguage\": \"en\",\n \"centralTitle\": \"PassEntry Supermarket\",\n \"notificationHeader\": \"PassEntry Supermarket\",\n \"description\": \"PassEntry Supermarket\",\n \"colors\": {\n \"background\": \"#dbdbdb\",\n \"label\": \"#000000\",\n \"text\": \"#000000\"\n },\n \"images\": {\n \"banner\": \"https://example.com/images/banner.jpg\",\n \"logo\": \"https://example.com/images/logo.jpg\",\n \"icon\": \"https://example.com/images/icon.jpg\",\n \"watermark\": {\n \"color\": \"light\",\n \"position\": \"bottomRight\"\n }\n },\n \"fields\": {\n \"header\": {\n \"one\": {\n \"id\": \"points\",\n \"label\": \"Points\",\n \"defaultValue\": \"0\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Points\",\n \"defaultValue\": \"0\"\n },\n \"is\": {\n \"label\": \"Stig\",\n \"defaultValue\": \"0\"\n }\n }\n }\n },\n \"central\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Central\",\n \"defaultValue\": \"Sample Name\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Central\",\n \"defaultValue\": \"Exemple de Nom\"\n },\n \"is\": {\n \"label\": \"Miðja\",\n \"defaultValue\": \"Sýnishorn Nafn\"\n }\n }\n }\n },\n \"details\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Name\",\n \"defaultValue\": \"Jane Doe\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Nom\",\n \"defaultValue\": \"Jeanne Dupont\"\n },\n \"is\": {\n \"label\": \"Nafn\",\n \"defaultValue\": \"Jóna Jónsdóttir\"\n }\n }\n },\n \"two\": {\n \"id\": \"discount\",\n \"label\": \"Discount\",\n \"defaultValue\": \"15%\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Réduction\",\n \"defaultValue\": \"15%\"\n },\n \"is\": {\n \"label\": \"Afsláttur\",\n \"defaultValue\": \"15%\"\n }\n }\n },\n \"three\": {\n \"id\": \"tier\",\n \"label\": \"Membership Tier\",\n \"defaultValue\": \"Silver\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Niveau de fidélité\",\n \"defaultValue\": \"Argent\"\n },\n \"is\": {\n \"label\": \"Aðildarstig\",\n \"defaultValue\": \"Silfur\"\n }\n }\n }\n },\n \"back\": {\n \"one\": {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"defaultValue\": \"[email protected]\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"E-mail\",\n \"defaultValue\": \"[email protected]\"\n },\n \"is\": {\n \"label\": \"Netfang\",\n \"defaultValue\": \"[email protected]\"\n }\n }\n }\n }\n },\n \"appLinking\": {\n \"apple\": {\n \"appStoreUrl\": [\n \"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997\"\n ]\n },\n \"google\": {\n \"app\": {\n \"playStoreUrl\": \"https://play.google.com/store/apps/details?id=com.whatsapp\"\n },\n \"displayText\": {\n \"text\": \"Click here for more!\"\n }\n }\n },\n \"barcode\": {\n \"enabled\": true,\n \"type\": \"qr\",\n \"source\": \"custom\",\n \"value\": \"123abcd\"\n },\n \"locations\": [\n {\n \"name\": \"Venue\",\n \"latitude\": 51.54321132456805,\n \"longitude\": -0.022901231803803924,\n \"radius\": 100,\n \"message\": \"Welcome to the venue\"\n }\n ],\n \"beacons\": [\n {\n \"name\": \"Beacon\",\n \"proximityUuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"major\": 1,\n \"minor\": 1,\n \"message\": \"Welcome to the venue\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.passentry.com/api/v1/pass-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"passTemplate\": {\n \"name\": \"PassEntry Supermarket\",\n \"templateType\": \"generic\",\n \"defaultLanguage\": \"en\",\n \"centralTitle\": \"PassEntry Supermarket\",\n \"notificationHeader\": \"PassEntry Supermarket\",\n \"description\": \"PassEntry Supermarket\",\n \"colors\": {\n \"background\": \"#dbdbdb\",\n \"label\": \"#000000\",\n \"text\": \"#000000\"\n },\n \"images\": {\n \"banner\": \"https://example.com/images/banner.jpg\",\n \"logo\": \"https://example.com/images/logo.jpg\",\n \"icon\": \"https://example.com/images/icon.jpg\",\n \"watermark\": {\n \"color\": \"light\",\n \"position\": \"bottomRight\"\n }\n },\n \"fields\": {\n \"header\": {\n \"one\": {\n \"id\": \"points\",\n \"label\": \"Points\",\n \"defaultValue\": \"0\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Points\",\n \"defaultValue\": \"0\"\n },\n \"is\": {\n \"label\": \"Stig\",\n \"defaultValue\": \"0\"\n }\n }\n }\n },\n \"central\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Central\",\n \"defaultValue\": \"Sample Name\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Central\",\n \"defaultValue\": \"Exemple de Nom\"\n },\n \"is\": {\n \"label\": \"Miðja\",\n \"defaultValue\": \"Sýnishorn Nafn\"\n }\n }\n }\n },\n \"details\": {\n \"one\": {\n \"id\": \"name\",\n \"label\": \"Name\",\n \"defaultValue\": \"Jane Doe\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Nom\",\n \"defaultValue\": \"Jeanne Dupont\"\n },\n \"is\": {\n \"label\": \"Nafn\",\n \"defaultValue\": \"Jóna Jónsdóttir\"\n }\n }\n },\n \"two\": {\n \"id\": \"discount\",\n \"label\": \"Discount\",\n \"defaultValue\": \"15%\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Réduction\",\n \"defaultValue\": \"15%\"\n },\n \"is\": {\n \"label\": \"Afsláttur\",\n \"defaultValue\": \"15%\"\n }\n }\n },\n \"three\": {\n \"id\": \"tier\",\n \"label\": \"Membership Tier\",\n \"defaultValue\": \"Silver\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"Niveau de fidélité\",\n \"defaultValue\": \"Argent\"\n },\n \"is\": {\n \"label\": \"Aðildarstig\",\n \"defaultValue\": \"Silfur\"\n }\n }\n }\n },\n \"back\": {\n \"one\": {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"defaultValue\": \"[email protected]\",\n \"localisation\": {\n \"fr\": {\n \"label\": \"E-mail\",\n \"defaultValue\": \"[email protected]\"\n },\n \"is\": {\n \"label\": \"Netfang\",\n \"defaultValue\": \"[email protected]\"\n }\n }\n }\n }\n },\n \"appLinking\": {\n \"apple\": {\n \"appStoreUrl\": [\n \"https://apps.apple.com/gb/app/whatsapp-messenger/id310633997\"\n ]\n },\n \"google\": {\n \"app\": {\n \"playStoreUrl\": \"https://play.google.com/store/apps/details?id=com.whatsapp\"\n },\n \"displayText\": {\n \"text\": \"Click here for more!\"\n }\n }\n },\n \"barcode\": {\n \"enabled\": true,\n \"type\": \"qr\",\n \"source\": \"custom\",\n \"value\": \"123abcd\"\n },\n \"locations\": [\n {\n \"name\": \"Venue\",\n \"latitude\": 51.54321132456805,\n \"longitude\": -0.022901231803803924,\n \"radius\": 100,\n \"message\": \"Welcome to the venue\"\n }\n ],\n \"beacons\": [\n {\n \"name\": \"Beacon\",\n \"proximityUuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"major\": 1,\n \"minor\": 1,\n \"message\": \"Welcome to the venue\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "19cb334f9696e64e10e7759f0",
"type": "passTemplate",
"attributes": {
"name": "PassEntry Supermarket"
},
"meta": {
"message": "Your pass template is being processed, please check again in a few moments.",
"links": {
"self": "https://api.passentry.com/v1/pass-templates/19cb334f9696e64e10e7759f0"
}
}
}{
"errors": [
"<string>"
]
}{
"errors": [
"<string>"
]
}{
"errors": [
"<string>"
]
}