I need help setting up an automation workflow between my CRM and Member Mouse using Zapier. When a specific tag gets added to a contact in my CRM, I want to automatically grant access to protected content bundles in Member Mouse.
Member Mouse provides this Python code example for their API:
import requests
# authentication details
api_token = 'ABC123XYZ'
api_secret = 'DEF456UVW'
level_id = '2'
partner_id = 'mypartner'
# member information
first_name = 'Jane'
last_name = 'Doe'
email_address = '[email protected]'
# build request data
data = {
'api_token': api_token,
'api_secret': api_secret,
'level_id': level_id,
'partner_id': partner_id,
'first_name': first_name,
'last_name': last_name,
'email': email_address
}
response = requests.post(
'https://www.MYSITE.com/wp-content/plugins/membermouse/api/request.php?q=/addMember',
data=data
)
if response.status_code == 200:
print('Member created successfully')
else:
print('Error occurred:', response.text)
I’m not a programmer and I’m struggling with a few things. First, how do I properly configure the Code step in Zapier to run this API call? Second, the sample code throws a syntax error on line 32 even with valid credentials. Third, do I need to use a PUT request step or is the Code step enough for this workflow?
Any guidance would be really appreciated since Zapier support referred me here for technical help with the API integration.