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(){ |
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", |
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' | |
}) |
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() |
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', |
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', |
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', |
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 | |
}) |
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', |
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