Unable to map CRM task to a record
Use case: I want to programatically create a call for a given Contact (has a record id) and at the same time, the call is related to a Deal (another record id). This is easily possible when creating such task in the CRM UI.
- // POST /crm/v2.1/Calls
- {
- "data": [
- {
- "Call_Duration": "28:50",
- "Owner": {
- "id": "2883756000000133013"
- },
- "Call_Purpose": "Prospective",
- "Call_Status": "Attended",
- "Billable": false,
- "Who_Id": "2883756000000153031",
- "Call_Start_Time": "2018-01-09T22:30:00+05:30",
- "Subject": "Call from +13012670261",
- "Call_Type": "Inbound",
- "$se_module": "Contacts",
- "What_Id": "2883756000000153028"
- }
- ]
- }
For my use case the payload is slightly modified as I want to relate the the call to a deal, so it has "two dimensions", primary - contact, secondary - deal:
- {
- ...
- "Who_Id": "2883756000000153031", // Contact record id
- "$se_module": "Deals",
- "What_Id": "2883756000000153028" // Deal record id
- ...
- }
However, this does not work as intended and the Contact ID does not get written in the call record.
FYI When calling the POST API with $se_module set to 'Contacts', it throws an error (which is probably correct).
- {
- ...
- "Who_Id": "2883756000000153031", // Contact record id
- "$se_module": "Contacts",
"What_Id": "2883756000000153028" // Deal record id
...
}
Does it imply a bug in the POST api endpoint for a given combination of dimensions?
Any ideas please?