API 1.1 and 1.2 allow faster, simpler authentication are should be used in preference to 1.0
See API 1.0 for an explanation of how to create methods and triggers for your Conducttr project.

The difference between API 1.1 and 1.2 is the data structure returned. 

Example API 1.2 with Python



#------------------------------------------------------------
# Simple example of GET and POST request
# ------------------------------------------------------------

#------------------------------------------------------------
# Replace xxxx with project-specific details
# Only need partition id for projects working with partitions
#------------------------------------------------------------

project = "xxxx"
partition = "xxxx"   
method ="xxxxxxx"
consumer_key = "xxxxxxxxxxxxxxxxxxxxx"

import
requests, json

url = "https://api.conducttr.com/v1.2/project/"+project+"/"+method+"?partition_id="+partition
headers = {"Authorization":"Bearer "+consumer_key}

# GET request
response = requests.get(url, headers=headers)
data = json.loads(response.content)
print(data)

# POST request
payload = {'signups': '20'}
response = requests.post(url, data=payload, headers=headers)
print(response)


Example output
{'answers': {'core.optin1.1': '1', 'DefSc.1.1': 'stage2', 'DefSc.2.1': 'stage3', 'DefSc.2.2': 'stage4'}, 'signups': '19'} <Response [200]>