Once your account is activated, site creation is handled with the Create Site API. The API examples are written in Python.
API Documentation for the the Site Software Key mentioned in the example below can be found with the Get Site Software API.
Create Site: Example Code
import requests, base64, json
# Enter Log In credentials
username = "john.dow@securitycompany.com" # Enter email Here
password = "pass12345!" # Enter password Here
site_name = "Test Site" # Enter site name Here
base64key = "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyA=" # Enter Base64Key Here
default_host_add = "http:www.securitycompany.com" # Enter Default Host Address Here
site_software_key = "identicard" # Enter Site Software Key Here
str1 = (username + ':' + password).encode('utf-8')
auth = base64.b64encode(str1)
headers = {
'Authorization': "Basic " + str(auth.decode('utf-8')),
'Content-Type': "application/json"
}
# Register a Site
url = "https://partner.lockwebserv.com/engage/sites/register"
payload = {
"SiteName": site_name,
"Base64Key": base64key,
"IsEngageManaged": 0,
"DefaultHostAddress": default_host_add,
"SiteSoftwareKey": site_software_key
}
response = requests.request("POST", url, data=json.dumps(payload), headers=headers)
# List Site References
url = "https://partner.lockwebserv.com/engage/sites"
response = requests.request("GET", url, headers=headers)
print(response.text)
Output:
{“SiteReference”:”0b925e80-4681-4fa7-affb-10cffff351e5”,”Name”:”Test Site”,”IsEngageManaged”:false}