Skip to content

Instantly share code, notes, and snippets.

Last active June 28, 2022 16:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Create a new contact in an Openscreen project
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',
'emailAddress': '',
'mailingAddress': {
'address': '123 Street',
'city': 'Toronto',
'provinceOrState': 'ON',
'country': 'Canada',
'postalOrZip': 'A1B2C3'
'consent': [{'url': '', 'consentedAt': '2021-06-20 08:03:00.0', 'consented': true}],
'cellPhone': '+14162121212'
'customAttributes': {
'campaign': 'Toronto June listings'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment