Skip to content

Instantly share code, notes, and snippets.

@birinder-lobana
Last active June 28, 2022 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save birinder-lobana/333caf8d7a4a294ff504fa053931a292 to your computer and use it in GitHub Desktop.
Save birinder-lobana/333caf8d7a4a294ff504fa053931a292 to your computer and use it in GitHub Desktop.
Create multiple dynamic QR Codes using python SDK
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',
'qrCodes': [
{
'intent': 'https://jaydeenrealty.com/123cherry/',
'intentType': 'DYNAMIC_REDIRECT',
'locatorKeyType': 'SHORT_URL',
'dynamicRedirectType': 'NO_SCAN_ID',
'status': 'ACTIVE'
}
]
},{
'name': 'Billboard 2',
'description': 'Billboard at Yonge and Lawrence for 123 Cherry Street Listing',
'qrCodes': [
{
'intent': 'https://jaydeenrealty.com/123cherry/',
'intentType': 'DYNAMIC_REDIRECT',
'locatorKeyType': 'SHORT_URL',
'dynamicRedirectType': 'NO_SCAN_ID',
'status': 'ACTIVE'
}
]
},{
'name': 'Billboard 3',
'description': 'Billboard at Mt. Pleasant and Eglington for 123 Cherry Street Listing',
'qrCodes': [
{
'intent': 'https://jaydeenrealty.com/123cherry/',
'intentType': 'DYNAMIC_REDIRECT',
'locatorKeyType': 'SHORT_URL',
'dynamicRedirectType': 'NO_SCAN_ID',
'status': 'ACTIVE'
}
]
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment