Hi, from what I'm seeing, there are different endpoints for creating a new contact and a new action. Is it possible to create both with the same request? I'm using python. Here's what worked to create a contact:
new_contact = {"first_name": user.first_name, "last_name": "OPT web form",\
"emails": [{ "type": "home", "value": user.email}], \
"phones": [{ "type": "mobile", "value": user.phone}] }
crm = requests.post("https://app.onepagecrm.com/api/v3/contacts", json=new_contact, auth=(app.config['ONEPAGECRM_ID'], app.config['ONEPAGECRM_PW']))
I then tried this, which still created the contact but (predictably) failed to create the action. I'm hoping it's not necessary to create the contact, get the contact id with another request, then create a new action.
new_contact = {"first_name": user.first_name, "last_name": "OPT web form",\
"emails": [{ "type": "home", "value": user.email}], \
"phones": [{ "type": "mobile", "value": user.phone}], \
"data": {
"action":{"text":"Reply to new contact email",
"date": datetime.now().strftime('%Y-%m-%d')}
}
}
crm = requests.post("https://app.onepagecrm.com/api/v3/contacts", json=new_contact, auth=(app.config['ONEPAGECRM_ID'], app.config['ONEPAGECRM_PW']))
-
Created
24 Apr 2023
-
Last post
27 Apr 2023
-
5
Posts
-
604
Views
-
2
Users