View contact_sms_template_and_SMS.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initiate the Openscreen node SDK and include the project ID that you recieved using the Openscreen dashboard | |
const { Openscreen } = require("@openscreen/sdk"); | |
require('dotenv').config(); | |
const os = new Openscreen().config({key: process.env.OS_API_KEY, secret: process.env.OS_API_SECRET}); | |
// Obtain projectId from the Openscreen Dashboard | |
const projectId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'; | |
// Capture scanId from the QR code scan | |
const scanId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'; | |
async function main(){ |
View create_contact_with_project_consent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Obtain your projectId from the Openscreen Dashboard and paste below | |
const projectId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; | |
const create_contact_by_project_id = await os.project(projectId).contacts().create({ | |
firstName: "Brian", | |
lastName: "Smith", | |
emailAddress: "bsmith@test.com", | |
cellPhone: "+14162121212", | |
mailingAddress: { | |
address: "123 Street", |
View create_sms_template.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
projectId = os.environ.get('PROJECT_ID') | |
sms_template = os.project(projectId).smsTemplates().create({ | |
'body': 'Body of the message for {{asset.name}}', | |
'smsTemplateName': 'firstTemplate', | |
'responseUrl': 'https://myapp/sms-response', | |
'statusUrl': 'https://myapp/sms-status' | |
}) |
View get_scan_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openscreen import Openscreen | |
import os | |
#Obtain your access key and secret from Openscreen Dashboard | |
ospro = Openscreen(access_key=os.environ.get('OS_ACCESS_KEY'), access_secret=os.environ.get('OS_ACCESS_SECRET')) | |
#Create a new project on Openscreen Dashboard. Paste the projectId below | |
projectId = os.environ.get('PROJECT_ID') | |
assetId = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' | |
scans = os.asset(assetId).scans().get() |
View create_contact_by_project.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openscreen import Openscreen | |
import os | |
#Obtain your access key and secret from Openscreen Dashboard | |
ospro = Openscreen(access_key=os.environ.get('OS_ACCESS_KEY'), access_secret=os.environ.get('OS_ACCESS_SECRET')) | |
#Create a new project on Openscreen Dashboard. Paste the projectId below | |
projectId = os.environ.get('PROJECT_ID') | |
create_contact_by_project_id = ospro.project(projectId).contacts().create({ | |
'firstName': 'Brian', | |
'lastName': 'Smith', |
View create_batch_qr_codes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openscreen import Openscreen | |
import os | |
#Obtain your access key and secret from Openscreen Dashboard | |
ospro = Openscreen(access_key=os.environ.get('OS_ACCESS_KEY'), access_secret=os.environ.get('OS_ACCESS_SECRET')) | |
#Create a new project on Openscreen Dashboard. Paste the projectId below | |
projectId = os.environ.get('PROJECT_ID') | |
create_assets_by_project_id = ospro.project(projectId).assetsBatch().create([{ | |
'name': 'Billboard 1', | |
'description': 'Billboard at Yonge and Eglington for 123 Cherry Street Listing', |
View create_static_QR_code.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openscreen import Openscreen | |
import os | |
#Obtain your access key and secret from Openscreen Dashboard | |
ospro = Openscreen(access_key=os.environ.get('OS_ACCESS_KEY'), access_secret=os.environ.get('OS_ACCESS_SECRET')) | |
#Create a new project on Openscreen Dashboard. Paste the projectId below | |
projectId = os.environ.get('PROJECT_ID') | |
#Create an Asset with a QR code | |
my_asset_response = ospro.project(projectId).assets().create({ | |
'name': '123 Main Steet Sign', |
View send_sms_by_scan_id.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scanId = create_contact_by_scan_id.contact.customAttributes[0] | |
contactId = create_contact_by_scan_id.contact.contactId | |
sms = ospro.scan(scanId).sms().send({ | |
# You may use an SMS template to send SMS or pass the body as plain text | |
'body': 'Congratulations! You are the winner of our campaign', | |
'contactId': contactId | |
}) |
View create_contact_by_scan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scanId = 'SCANID_FROM_YOUR_APPLICATION' | |
create_contact_by_scan_id = ospro.scan(scanId).contacts().create({ | |
'firstName': 'Brian', | |
'lastName': 'Smith', | |
'emailAddress': 'bsmith@test.com', | |
'mailingAddress': { | |
'address': '123 Street', | |
'city': 'Toronto', | |
'provinceOrState': 'ON', |
View create_asset_and_qr_code.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openscreen import Openscreen | |
import os | |
#Obtain your access key and secret from Openscreen Dashboard | |
ospro = Openscreen(access_key=os.environ.get('OS_ACCESS_KEY'), access_secret=os.environ.get('OS_ACCESS_SECRET')) | |
#Create a new project on Openscreen Dashboard. Paste the projectId below | |
projectId = os.environ.get('PROJECT_ID') | |
#Create an Asset with a QR code | |
my_asset_response = ospro.project(projectId).assets().create({ | |
'name': '123 Main Steet Sign', |
NewerOlder