TDAPI

TDAPI

new TDAPI(options)

Base TeamDynamix API class
Parameters:
Name Type Description
options TDAPIOptions The options to configure the TDAPI client with.
Source:

Methods

(static) editCustomAttributeChoice(id, choiceId, customAttributeChoice) → {Promise.<CustomAttributeChoice>}

Edits an existing choice associated with the specified custom attribute.
Parameters:
Name Type Description
id Number The custom attribute ID.
choiceId Number The choice ID.
customAttributeChoice CustomAttributeChoice The choice with updated values.
Source:
Returns:
Type
Promise.<CustomAttributeChoice>

(static) getCustomAttributes(componentId, associatedTypeIdopt, appIdopt) → {Promise.<Array.<CustomAttribute>>}

Gets the custom attributes for the specified component.
Parameters:
Name Type Attributes Description
componentId Number The component ID.
associatedTypeId Number <optional>
The associated type ID to get attributes for. For instance, a ticket type ID might be provided here.
appId Number <optional>
The associated application ID to get attributes for.
Source:
Returns:
Type
Promise.<Array.<CustomAttribute>>

addAssetFeedEntry(id, feedEntry) → {Promise.<ItemUpdate>}

Adds a comment to an asset.
Parameters:
Name Type Description
id Number The asset ID.
feedEntry FeedEntry The item update containing the comment.
Source:
Returns:
Type
Promise.<ItemUpdate>

addAssetResource(id, resourceId) → {Promise.<Object>}

Adds a resource to an asset.
Parameters:
Name Type Description
id Number The asset ID.
resourceId Number The resource ID.
Source:
Returns:
message
Type
Promise.<Object>

addAssetToTicket(id, ticketId) → {Promise.<Object>}

Adds an asset to a ticket.
Parameters:
Name Type Description
id Number The asset ID.
ticketId Number The ticket ID. This must belong to an application that the user can access.
Source:
Returns:
message
Type
Promise.<Object>

addCustomAttributeChoice(id, customAttributeChoice) → {Promise.<CustomAttributeChoice>}

Adds a new choice to the specified custom attribute.
Parameters:
Name Type Description
id Number The ID of the custom attribute.
customAttributeChoice CustomAttributeChoice The choice to add to the custom attribute.
Source:
Returns:
Type
Promise.<CustomAttributeChoice>

addUsersToGroup(id, uids, isPrimaryopt, isNotifiedopt, isManageropt)

Bulk-adds a set of users to a group. Adds a collection of users to a group. Users that did not exist in the group beforehand will have their settings set to the specified values. Existing users will not have their settings overwritten.
Parameters:
Name Type Attributes Default Description
id Boolean ID of the group
uids Array.<Guid> The UIDs of the people being added to entries in groupIds.
isPrimary Boolean <optional>
false If set to true, new users will have this group set as their primary group.
isNotified Boolean <optional>
false If set to true, new users will be sent notifications for this group.
isManager Boolean <optional>
false If set to true, new users will be set as a manager for this group.
Source:

applyDesktop(templateDesktopId, uids, isDefaultopt)

Bulk-applies a desktop template to a set of users.
Parameters:
Name Type Attributes Default Description
templateDesktopId Guid The ID of the desktop template to apply.
uids Array.<Guid> The UIDs of the users to apply the desktop to.
isDefault Boolean <optional>
false If set to true, each of the specified users will be set to be active.
Source:

changeAcctDepts(userUids, accountIds, replaceExistingAccounts)

Bulk-adds a set of users to a set of accounts. Optionally, supports removing any accounts for the specified users that are not included in the set of accounts.
Parameters:
Name Type Description
userUids Array.<Guid> The user UIDs to add to the accounts provided in AccountIDs
accountIds Array.<Number> The account IDs to add the users provided in userUIDs to.
replaceExistingAccounts Boolean Value indicating whether accounts that provided users already belong to should be removed.
Source:

changeActiveStatus(uids, isActive)

Bulk-updates the active status of the set of users.
Parameters:
Name Type Description
uids Guid The UIDs of the people to update the active status of.
isActive Boolean If set to true, each of the specified users will be set to be active.
Source:

changeApplications(userUids, applicationNames, replaceExistingApplications)

Bulk-adds or removes a set of users to a set of applications. Optionally, supports removing any application associations for users.
Parameters:
Name Type Description
userUids Array.<Guid> The UIDs of the people being added to entries in applicationsNames.
applicationNames Array.<String> The Applications that will be added to each entry in userUids.
replaceExistingApplications Boolean Value indicating whether applications that provided users already belong to should be removed.
Source:

changeSecurityRole(securityRoleId, uids)

Bulk-changes the security role of a set of users.
Parameters:
Name Type Description
securityRoleId Guid The ID of the security role to apply to each user.
uids Array.<Guid> The groups that will be added to each entry in userUids.
Source:

createAccount(account) → {Promise.<Account>}

Creates a new account.
Parameters:
Name Type Description
account Account The account to be created.
Source:
Returns:
account
Type
Promise.<Account>

createAsset(asset) → {Promise.<Asset>}

Creates an asset.
Parameters:
Name Type Description
asset Asset
Source:
Returns:
Type
Promise.<Asset>

createGroup(group) → {Promise.<Group>}

Creates a new group.
Parameters:
Name Type Description
group Group The group to be created.
Source:
Returns:
The group.
Type
Promise.<Group>

createLocation(location) → {Promise.<Location>}

Creates a location.
Parameters:
Name Type Description
location Location The location to create.
Source:
Returns:
location
Type
Promise.<Location>

createProductModel(productModel) → {ProductModel}

Creates a new product model.
Parameters:
Name Type Description
productModel ProductModel
Source:
Returns:
- The new Product Model.
Type
ProductModel

createRoom(id, room) → {Promise.<LocationRoom>}

Creates a room in a location.
Parameters:
Name Type Description
id Number The containing location ID.
room LocationRoom The room to create.
Source:
Returns:
room
Type
Promise.<LocationRoom>

createTicket(appId, ticket, options)

Creates a Ticket.
Parameters:
Name Type Description
appId Number The ID of the ticketing application.
ticket any The ticket body
options TicketCreateOptions The creation options
Source:

createUser(user) → {Promise.<User>}

Creates a user object with specified attributes.
Parameters:
Name Type Description
user User The user to create.
Source:
Returns:
Type
Promise.<User>

createVendor(vendor) → {Promise.<Vendor>}

Creates a new vendor.
Parameters:
Name Type Description
vendor Vendor The vendor to be created.
Source:
Returns:
Type
Promise.<Vendor>

deleteAttachment(id) → {Promise.<Object>}

Deletes an attachment.
Parameters:
Name Type Description
id Guid The attachment ID.
Source:
Returns:
- A response message indicating if the operation was successful or not.
Type
Promise.<Object>

deleteRoom(id, roomId) → {Promise.<Object>}

Deletes a room in a location.
Parameters:
Name Type Description
id Number The containing location ID.
roomId Number The room ID.
Source:
Returns:
message
Type
Promise.<Object>

editAccount(id, account) → {Promise.<Object>}

Edits the account specified by the account ID.
Parameters:
Name Type Description
id Number The account ID.
account Account The fields that the updated account should hold.
Source:
Returns:
body
Type
Promise.<Object>

editAsset(id, asset) → {Promise.<Asset>}

Edits an existing asset.
Parameters:
Name Type Description
id Number The asset ID.
asset Asset The asset with updated values.
Source:
Returns:
Type
Promise.<Asset>

editGroup(id, group) → {Promise.<Group>}

Edits an existing group.
Parameters:
Name Type Description
id Number The group ID.
group Group The fields that the updated group should hold.
Source:
Returns:
The updated group, if the operation was successful.
Type
Promise.<Group>

editLocation(id, location) → {Promise.<Location>}

Edits the specified location.
Parameters:
Name Type Description
id Number The ID of the location.
location Location The location with updated values.
Source:
Returns:
location
Type
Promise.<Location>

editProductModel(productModel) → {Promise.<ProductModel>}

Edits a product model.
Parameters:
Name Type Description
productModel ProductModel The locally edited product model
Source:
Returns:
- The updated Product Model in TDx
Type
Promise.<ProductModel>

editRoom(id, roomId, room) → {Promise.<LocationRoom>}

Edits the specified room in a location.
Parameters:
Name Type Description
id Number The containing location ID.
roomId Number The room ID.
room LocationRoom The room with updated values.
Source:
Returns:
room
Type
Promise.<LocationRoom>

editTicketTask(appId, ticketID, taskID, taskData) → {Promise.<Object>}

Edit a ticket's task
Parameters:
Name Type Description
appId the ID of the ticket application
ticketID ID of the ticket
taskID ID of the task
taskData data of the edited task
Source:
Returns:
Type
Promise.<Object>

getAccount(id) → {Promise.<Account>}

Gets the account specified by the account ID.
Parameters:
Name Type Description
id Number The ID of the account.
Source:
Returns:
account
Type
Promise.<Account>

getAccounts() → {Promise.<Array.<Account>>}

Gets a list of all active accounts/departments.
Source:
Returns:
accounts
Type
Promise.<Array.<Account>>

getArticle(articleID) → {Promise.<Article>}

Gets an article from Knowledge Base.
Parameters:
Name Type Description
articleID Number The article ID.
Source:
Returns:
Type
Promise.<Article>

getArticles(searchParams) → {Promise.<Array.<Article>>}

Searches for articles from Knowledge Base.
Parameters:
Name Type Description
searchParams ArticleSearch the search parameters for an article
Source:
Returns:
Type
Promise.<Array.<Article>>

getAsset(id) → {Promise.<Asset>}

Gets an asset.
Parameters:
Name Type Description
id Number The asset ID.
Source:
Returns:
Type
Promise.<Asset>

getAssetFeedEntries(id) → {Promise.<Array.<ItemUpdate>>}

Gets the feed entries for an asset.
Parameters:
Name Type Description
id Number The asset ID.
Source:
Returns:
Type
Promise.<Array.<ItemUpdate>>

getAssetResources(id) → {Promise.<ResourceItem>}

Gets the asset resources.
Parameters:
Name Type Description
id Number The asset ID.
Source:
Returns:
Type
Promise.<ResourceItem>

getAssets(searchParamsopt) → {Promise.<Array.<Asset>>}

Gets a list of assets.
Parameters:
Name Type Attributes Description
searchParams AssetSearch <optional>
The search parameters to use.
Source:
Returns:
Type
Promise.<Array.<Asset>>

getAssetsFromTicket(appId, ticketId) → {Promise.<Object>}

Get assets associated with a ticket. The endpoint also returns additional configuration items.
Parameters:
Name Type Description
appId Number The associated application ID to get attributes for.
ticketId Number The ticket ID. This must belong to an application that the user can access.
Source:
Returns:
message
Type
Promise.<Object>

getAssetStatuses() → {Promise.<Array.<AssetStatus>>}

Gets a list of all asset statuses.
Source:
Returns:
Type
Promise.<Array.<AssetStatus>>

getAttachment(id) → {Attachment}

Gets an attachment.
Parameters:
Name Type Description
id Guid The attachment ID.
Source:
Returns:
- The attachment object, if found.
Type
Attachment

getAttachmentContents(id) → {Promise.<Object>}

Gets the contents of an attachment.
Parameters:
Name Type Description
id Guid The attachment ID.
Source:
Returns:
- The attachment's file contents, if found.
Type
Promise.<Object>

getCustomAttributeChoices(id) → {Promise.<Array.<CustomAttributeChoice>>}

Gets the choices for the specified custom attribute.
Parameters:
Name Type Description
id Number The ID of the custom attribute.
Source:
Returns:
Type
Promise.<Array.<CustomAttributeChoice>>

getCustomAttributes(componentId, associatedTypeId, appId) → {Promise.<Array.<CustomAttribute>>}

Gets the custom attributes for the specified component.
Parameters:
Name Type Description
componentId Number The component ID.
associatedTypeId Number The associated type ID to get attributes for. For instance, a ticket type ID might be provided here.
appId Number The associated application ID to get attributes for.
Source:
Returns:
Type
Promise.<Array.<CustomAttribute>>

getGroup(id) → {Promise.<Group>}

Gets a Group.
Parameters:
Name Type Description
id Number The group ID.
Source:
Returns:
The group.
Type
Promise.<Group>

getGroupMembers(groupId) → {Promise.<Array.<User>>}

Gets group members for a specified group.
Parameters:
Name Type Description
groupId Number The ID of the group.
Source:
Returns:
groupMembers
Type
Promise.<Array.<User>>

getGroups(searchParamsopt) → {Promise.<Array.<Group>>}

Gets Groups.
Parameters:
Name Type Attributes Default Description
searchParams GroupSearch <optional>
{} The search parameters to use.
Source:
Returns:
A collection of groups.
Type
Promise.<Array.<Group>>

getLocation(id) → {Promise.<Location>}

Gets a location.
Parameters:
Name Type Description
id Number The ID of the location.
Source:
Returns:
location
Type
Promise.<Location>

getLocations(searchParams) → {Promise.<Array.<Location>>}

Gets a list of locations.
Parameters:
Name Type Description
searchParams LocationSearch The search parameters to use.
Source:
Returns:
locations
Type
Promise.<Array.<Location>>

getProductModel(id) → {Promise.<ProductModel>}

Gets the specified product model.
Parameters:
Name Type Description
id Number
Source:
Returns:
Type
Promise.<ProductModel>

getProductModels() → {Promise.<Array.<ProductModel>>}

Gets a list of active product models.
Source:
Returns:
Type
Promise.<Array.<ProductModel>>

getReport(id, withDataopt, dataSortExpressionopt) → {Promise.<Report>}

Gets information about a report, optionally including data.
Parameters:
Name Type Attributes Description
id Number The report ID.
withData Boolean <optional>
If true, will populate the returned report's collection of rows.
dataSortExpression String <optional>
The sorting expression to use for the report's data. Only applicable when data is being retrieved. When not provided, will fall back to the default used for the report.
Source:
Returns:
Type
Promise.<Report>

getReports() → {Promise.<Array.<ReportInfo>>}

Gets a list of all Report Builder reports visible to the user.
Source:
Returns:
Type
Promise.<Array.<ReportInfo>>

getSecurityRole(roleId) → {Promise.<SecurityRole>}

Gets a Security Role.
Parameters:
Name Type Description
roleId Guid The ID of the security role.
Source:
Returns:
securityRole
Type
Promise.<SecurityRole>

getSecurityRoles(searchParams) → {Promise.<Array.<SecurityRole>>}

Gets Security Roles.
Parameters:
Name Type Description
searchParams SecurityRoleSearch The search parameters to use.
Source:
Returns:
securityRoles
Type
Promise.<Array.<SecurityRole>>

getTicket(appId, ticketId) → {Promise.<Ticket>}

Gets a Ticket.
Parameters:
Name Type Description
appId Number The ID of the ticketing application.
ticketId Number The ID of the ticket.
Source:
Returns:
ticket
Type
Promise.<Ticket>

getTickets(appId, searchParamsopt) → {Promise.<Array.<Ticket>>}

Gets Tickets.
Parameters:
Name Type Attributes Default Description
appId Number The ID of the ticketing application.
searchParams TicketSearch <optional>
{} The search parameters to use.
Source:
Returns:
Type
Promise.<Array.<Ticket>>

getTicketStatuses(appId) → {Promise.<Array.<TicketStatus>>}

Get ticket statuses.
Parameters:
Name Type Description
appId Number The ID of the ticketing application.
Source:
Returns:
statuses
Type
Promise.<Array.<TicketStatus>>

getTicketTask(appId, ticketID, taskID) → {Promise.<Object>}

Get a ticket's task
Parameters:
Name Type Description
appId the ID of the ticket application
ticketID ID of the ticket
taskID ID of the task
Source:
Returns:
Type
Promise.<Object>

getTicketTypes(appId) → {Promise.<Array.<TicketType>>}

Gets all active ticket types
Parameters:
Name Type Description
appId Number The ID of the ticketing application.
Source:
Returns:
types
Type
Promise.<Array.<TicketType>>

getUser(uid) → {Promise.<User>}

Gets a user object.
Parameters:
Name Type Description
uid Guid The UID of the user.
Source:
Returns:
Type
Promise.<User>

getUsers(searchParams) → {Promise.<Array.<User>>}

Gets all user objects matching specified search parameters.
Parameters:
Name Type Description
searchParams UserSearch The search parameters to use.
Source:
Returns:
Type
Promise.<Array.<User>>

getVendor(id) → {Promise.<Vendor>}

Gets a vendor.
Parameters:
Name Type Description
id Number The vendor ID.
Source:
Returns:
Type
Promise.<Vendor>

getVendors() → {Promise.<Array.<Vendor>>}

Gets a list of active vendors.
Source:
Returns:
Type
Promise.<Array.<Vendor>>

importAssets(importData) → {Promise.<ItemResult>}

Performs a bulk insert/update of assets in the system.
Parameters:
Name Type Description
importData BulkImport.<Array.<Asset>> The collection of items that are being imported and the corresponding import settings.
Source:
Returns:
Type
Promise.<ItemResult>

importPeople(file) → {Promise.<Object>}

Accepts a file, stores that file on disk, and places an entry into the databse to indicate to the import file processor to pick up the file and run a People import on it.
Parameters:
Name Type Description
file String The path of the .xlsx file to upload.
Source:
Returns:
message
Type
Promise.<Object>

login() → {Promise.<String>}

Gets a Bearer Token for authenticating other requests.
Source:
Returns:
Type
Promise.<String>

manageGroups(userUids, groupIds, removeOtherGroups)

Bulk-adds a set of users to a set of groups. Optionally, supports removing any memberships for those users that are outside of those groups.
Parameters:
Name Type Description
userUids Array.<Guid> The UIDs of the people being added to entries in groupIds.
groupIds Array.<Number> The groups that will be added to each entry in userUids.
removeOtherGroups Boolean Value indicating whether groups that provided users already belong to should be removed.
Source:

patchTicket(appId, ticketId, patch, falseopt) → {Promise.<Ticket>}

Edits a ticket via HTTP PATCH (Edits only specified fields)
Parameters:
Name Type Attributes Description
appId Number The ID of the ticketing application.
ticketId Number The ID of the ticket to update.
patch any The patch document containing changes to apply to the ticket.
false Boolean <optional>
notifyNewResponsible - If true, will notify the newly-responsible resource(s) if the responsibility is changed as a result of the edit.
Source:
Returns:
ticket
Type
Promise.<Ticket>

removeAssetFromTicket(id, ticketId) → {Promise.<Object>}

Removes a ticket from an asset.
Parameters:
Name Type Description
id Number The asset ID.
ticketId Number The ticket ID. This must belong to an application that the user can access.
Source:
Returns:
message
Type
Promise.<Object>

removeAssetResource(assetId, resourceId) → {Promise.<Object>}

Removes a resource from an asset.
Parameters:
Name Type Description
assetId Number The asset ID.
resourceId Number The resource ID.
Source:
Returns:
message
Type
Promise.<Object>

removeCustomAttributeChoice(id, choiceId) → {Promise.<Object>}

Removes the specified choice from the custom attribute.
Parameters:
Name Type Description
id Number The custom attribute ID.
choiceId any The choice ID.
Source:
Returns:
message
Type
Promise.<Object>

removeFromGroup(id, uids) → {Promise.<Object>}

Removes a collection of users from a group.
Parameters:
Name Type Description
id Number The group ID.
uids Array.<Guid> The search parameters to use.
Source:
Returns:
A response message indicating if the operation was successful or not.
Type
Promise.<Object>

searchAccounts(searchParams) → {Promise.<Array.<Account>>}

Gets a list of accounts/departments
Parameters:
Name Type Description
searchParams AccountSearch
Source:
Returns:
accounts
Type
Promise.<Array.<Account>>

searchReports(reportSearch) → {Promise.<ReportInfo>}

Gets a list of all Report Builder reports visible to the user that match the provided search criteria.
Parameters:
Name Type Description
reportSearch Object The searching parameters to use.
Source:
Returns:
Type
Promise.<ReportInfo>

searchVendors(query) → {Promise.<Array.<Vendor>>}

Gets a list of vendors.
Parameters:
Name Type Description
query VendorSearch The searching parameters to use
Source:
Returns:
Type
Promise.<Array.<Vendor>>

updateTicket(appId, ticketId, feedEntry) → {Promise.<ItemUpdate>}

Updates a ticket / Adds a new feed entry.
Parameters:
Name Type Description
appId Number The ID of the ticketing application.
ticketId Number The ID of the ticket to update.
feedEntry TicketFeedEntry The new feed entry to add.
Source:
Returns:
itemUpdate
Type
Promise.<ItemUpdate>