function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alexander LandmannAlexander Landmann 

We are trying to create tasks through api but we struggle to get the users notification email of a new task to be sent when the task is created through the API.

pconpcon
Are you creating these tasks via the API as a centeralized user or are you creating the tasks via the API as the user that owns the task?  What API are you using to create the tasks?  Can you please provide an example of the API call you are making to create the task?
Alexander LandmannAlexander Landmann
Hi,
Are you creating these tasks via the API as a centeralized user or are you creating the tasks via the API as the user that owns the task?
-->We are creating the task as a centralized user.

What API are you using to create the tasks?
-->We are using the SOAP api via the PHP library. We are using an enterprise WSDL and client

Can you please provide an example of the API call you are making to create the task?

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header><ns1:SessionHeader><ns1:sessionId>00D8E0000008eZd!AQcAQBNHquRZygS9Mie4p2dHvRIWArlv2.AG8nHufSxtHRYsMRlsQl3iq5NZJz6yeJtkR6qPRs7rH_72NKGjhgzJWjOQoA_s</ns1:sessionId></ns1:SessionHeader><ns1:EmailHeader><ns1:triggerAutoResponseEmail>true</ns1:triggerAutoResponseEmail><ns1:triggerOtherEmail>true</ns1:triggerOtherEmail><ns1:triggerUserEmail>true</ns1:triggerUserEmail></ns1:EmailHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:create><ns1:sObjects xsi:type="ns1:Task"><Id/><OwnerId>005D00000069MdXIAU</OwnerId><Priority>Normal (default)</Priority><Subject>test task assignment</Subject><Type>Other</Type><WhoId>00Q8E000001Gu2XUAS</WhoId></ns1:sObjects></ns1:create></SOAP-ENV:Body></SOAP-ENV:Envelope>
POST /services/Soap/c/35.0/00D8E0000008eZd/0DF8E000000003j HTTP/1.1 Host: cs87.salesforce.com Connection: Keep-Alive User-Agent: salesforce-toolkit-php/27.0 Accept-Encoding: gzip, deflate Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 926