create()
IMPORTANT The SOAP API entered a limited enhancement phase in Q4 2020. Access to version 1.6 will eventually be deactivated. At this time, there is no end-of-lifecycle date.
Use the create() API call to add new objects in the Autotask system. Not all entities accept the create() call. To find out if an entity accepts create(), find the Entity in the , click the link, and check the Entity Details. Alternately, use the getEntityInfo() call.
This create() call is like an SQL INSERT statement. See "Considerations" after the code samples.
NOTE Use the Entity Returned by create() to Obtain Id Only.
You can use the entity returned by create() and update() to obtain the Id field content, but do not rely on the rest of the content. Some entity fields cannot be calculated immediately during create and update. In the returned entity , those fields may not be accurate.
If you need to access the entity for information other than the Id, query for the entity after the create() or update() succeeds.
Considerations
The following considerations apply to the Web Services create() call.
Permissions | By default, the API User (system) (API-only) security level grants Full access permissions, but copies of this security level may have been modified. The API user must have access to the appropriate Autotask module for the entity type and sufficient rights to perform the specified API call. |
id | The id is auto-generated by Autotask and uniquely identifies a particular entity instance. It is also used with the update() call to identify the target record. You cannot assign a value to this field. |
Read Only Fields | Some fields are set by Autotask and cannot be changed via the API. These are marked as Read Only in the tables for each entity type. New values assigned to these fields are ignored for any entity object passed to the create() or update() API calls. |
Required Fields | For update() and create() calls, you must specify values for required fields. If no value is specified, an error will occur and no data will be changed in Autotask. |
System Integrity | Some fields on Entities require an id to a parent Entity. These are referred to as Reference fields. For example, when creating a Ticket Note you must supply the id for the Ticket that the note will be associated with. |
Update/Create Maximum Entities | The Web Service API calls can update or create a maximum of 200 objects with one call. If you send more then 200 elements in your array, the call will fail and no changes will occur in Autotask. |
White Spacing | API functions will trim all white spaces in the beginning and end of each string type entry. |
Exists? | We suggest that when using the create() call you incorporate a query to check whether the object being created already exists. |
Sample create() SOAP XML
The following sample SOAP XML creates a new ticket.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<AutotaskIntegrations xmlns="http://autotask.net/ATWS/v1_6/">
<IntegrationCode>[insert your own tracking identifier]</IntegrationCode>
</AutotaskIntegrations>
</soap:Header>
<soap:Body>
<create xmlns="http://autotask.net/ATWS/v1_6/">
<Entities>
<Entity xsi:type="Ticket" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AccountID>174</AccountID>
<DueDateTime>2019-01-15</DueDateTime>
<Priority>3</Priority>
<QueueID>8</QueueID>
<Status>1</Status>
<Title>My Ticket Title</Title>
</Entity>
</Entities>
</create>
</soap:Body>
</soap:Envelope>