new TDAPI(options)
Base TeamDynamix API class
Parameters:
Name | Type | Description |
---|---|---|
options |
TDAPIOptions | The options to configure the TDAPI client with. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
createAccount(account) → {Promise.<Account>}
Creates a new account.
Parameters:
Name | Type | Description |
---|---|---|
account |
Account | The account to be created. |
Returns:
account
- Type
- Promise.<Account>
createAsset(asset) → {Promise.<Asset>}
Creates an asset.
Parameters:
Name | Type | Description |
---|---|---|
asset |
Asset |
Returns:
- Type
- Promise.<Asset>
createGroup(group) → {Promise.<Group>}
Creates a new group.
Parameters:
Name | Type | Description |
---|---|---|
group |
Group | The group to be created. |
Returns:
The group.
- Type
- Promise.<Group>
createLocation(location) → {Promise.<Location>}
Creates a location.
Parameters:
Name | Type | Description |
---|---|---|
location |
Location | The location to create. |
Returns:
location
- Type
- Promise.<Location>
createProductModel(productModel) → {ProductModel}
Creates a new product model.
Parameters:
Name | Type | Description |
---|---|---|
productModel |
ProductModel |
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. |
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 |
createUser(user) → {Promise.<User>}
Creates a user object with specified attributes.
Parameters:
Name | Type | Description |
---|---|---|
user |
User | The user to create. |
Returns:
- Type
- Promise.<User>
createVendor(vendor) → {Promise.<Vendor>}
Creates a new vendor.
Parameters:
Name | Type | Description |
---|---|---|
vendor |
Vendor | The vendor to be created. |
Returns:
- Type
- Promise.<Vendor>
deleteAttachment(id) → {Promise.<Object>}
Deletes an attachment.
Parameters:
Name | Type | Description |
---|---|---|
id |
Guid | The attachment ID. |
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. |
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. |
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. |
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. |
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. |
Returns:
location
- Type
- Promise.<Location>
editProductModel(productModel) → {Promise.<ProductModel>}
Edits a product model.
Parameters:
Name | Type | Description |
---|---|---|
productModel |
ProductModel | The locally edited product model |
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. |
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 |
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. |
Returns:
account
- Type
- Promise.<Account>
getAccounts() → {Promise.<Array.<Account>>}
Gets a list of all active accounts/departments.
Returns:
accounts
getArticle(articleID) → {Promise.<Article>}
Gets an article from Knowledge Base.
Parameters:
Name | Type | Description |
---|---|---|
articleID |
Number | The article ID. |
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 |
Returns:
getAsset(id) → {Promise.<Asset>}
Gets an asset.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The asset ID. |
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. |
Returns:
- Type
- Promise.<Array.<ItemUpdate>>
getAssetResources(id) → {Promise.<ResourceItem>}
Gets the asset resources.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The asset ID. |
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. |
Returns:
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. |
Returns:
message
- Type
- Promise.<Object>
getAssetStatuses() → {Promise.<Array.<AssetStatus>>}
Gets a list of all asset statuses.
Returns:
- Type
- Promise.<Array.<AssetStatus>>
getAttachment(id) → {Attachment}
Gets an attachment.
Parameters:
Name | Type | Description |
---|---|---|
id |
Guid | The attachment ID. |
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. |
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. |
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. |
Returns:
- Type
- Promise.<Array.<CustomAttribute>>
getGroup(id) → {Promise.<Group>}
Gets a Group.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The group ID. |
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. |
Returns:
groupMembers
getGroups(searchParamsopt) → {Promise.<Array.<Group>>}
Gets Groups.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
searchParams |
GroupSearch |
<optional> |
{} | The search parameters to use. |
Returns:
A collection of groups.
getLocation(id) → {Promise.<Location>}
Gets a location.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The ID of the location. |
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. |
Returns:
locations
getProductModel(id) → {Promise.<ProductModel>}
Gets the specified product model.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
Returns:
- Type
- Promise.<ProductModel>
getProductModels() → {Promise.<Array.<ProductModel>>}
Gets a list of active product models.
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. |
Returns:
- Type
- Promise.<Report>
getReports() → {Promise.<Array.<ReportInfo>>}
Gets a list of all Report Builder reports visible to the user.
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. |
Returns:
securityRole
- Type
- Promise.<SecurityRole>
getSecurityRoles(searchParams) → {Promise.<Array.<SecurityRole>>}
Gets Security Roles.
Parameters:
Name | Type | Description |
---|---|---|
searchParams |
SecurityRoleSearch | The search parameters to use. |
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. |
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. |
Returns:
getTicketStatuses(appId) → {Promise.<Array.<TicketStatus>>}
Get ticket statuses.
Parameters:
Name | Type | Description |
---|---|---|
appId |
Number | The ID of the ticketing application. |
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 |
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. |
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. |
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. |
Returns:
getVendor(id) → {Promise.<Vendor>}
Gets a vendor.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The vendor ID. |
Returns:
- Type
- Promise.<Vendor>
getVendors() → {Promise.<Array.<Vendor>>}
Gets a list of active vendors.
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. |
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. |
Returns:
message
- Type
- Promise.<Object>
login() → {Promise.<String>}
Gets a Bearer Token for authenticating other requests.
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. |
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. |
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. |
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. |
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. |
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. |
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 |
Returns:
accounts
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. |
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 |
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. |
Returns:
itemUpdate
- Type
- Promise.<ItemUpdate>