Last active
June 28, 2022 16:54
-
-
Save birinder-lobana/89f41d87f48dcf5bca6f076020478ca0 to your computer and use it in GitHub Desktop.
Create a new contact in an Openscreen project
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', | |
'emailAddress': 'bsmith@test.com', | |
'mailingAddress': { | |
'address': '123 Street', | |
'city': 'Toronto', | |
'provinceOrState': 'ON', | |
'country': 'Canada', | |
'postalOrZip': 'A1B2C3' | |
}, | |
'consent': [{'url': 'https://sidewalkqr.com/123main/consent', '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