@useems/octadesk-api
v2.2.5
Published
Node proxy for Octadesk API - https://api.octadesk.services
Downloads
110
Readme
octadesk-api
Node proxy to Octadesk APIs
Install
npm install @useems/octadesk-api
Usage
Use your API Token or your Octadesk credentials.
const octadeskAPI = require('octadesk-api')
let octadesk = new octadeskAPI('https://api.octadesk.services')
await octadesk.authenticate({ 'subdomain': 'YOUR_SUBDOMAIN', 'apitoken': 'octa.YOUR_API_TOKEN', 'username': 'A_VALID_USERNAME' })
/* or */
let octadesk = new octadeskAPI('https://api.octadesk.services')
await octadesk.authenticate({ 'subdomain': 'YOUR_SUBDOMAIN', 'username': 'A_VALID_USERNAME', 'password': 'THE_USER_PASSWORD' })
/* then */
octadesk.tags.get("")
.then(tags => {
tags.forEach(tag => {
console.log(tag.name)
})
})
Functions
Company (octadesk.company)
- company.get() - GET /
Custom Fields (octadesk.customfields)
- customfields.getAll() - GET /
- customfields.get(id) - GET /{id}
- customfields.getByFieldId(id, domainType) - GET /{fieldId}/{domainType}
- customfields.create(customField) - POST /
- customfields.update(customField) - PUT /
- customfields.remove(id) - DELETE /{id}
- customfields.reoderFields(customFields) - POST /reorder
- customfields.getAllFieldsBySystemType(domainType, showEnabledItems = true) - GET /system-type/{systemType}
- customfields.getFiltersFields() - GET /filters
- customfields.getSetterFields() - GET /setters
- customfields.getOutputsFields() - GET /outputs
Forms (octadesk.forms)
- forms.getAll() - GET /
- forms.get(id) - GET /{id}
- forms.getDefault(domain) - GET /default
- forms.create(form) - POST /
- forms.update(form) - PUT /
- forms.remove(id) - DELETE /
- forms.render.getByDomain(domain = 'Ticket', area = 'Ticket') - GET /render/{domain}
- forms.render.getById(id, area = 'Ticket') - GET /render/{domain}
- forms.fields.get(domain = 'Ticket') - GET /fields
Groups (octadesk.groups)
Help Center (octadesk.helpcenter)
- helpcenter.get() - GET /helpcenter
- helpcenter.update(helpcenter) - PUT /helpcenter
Macros (octadesk.macros)
- macros.getAll() - GET /
- macros.get(id) - GET /{id}
- macros.getByOwner(idOwner, includeExcludedRecords = true) - GET /all/{idOwner}/{includeExcludedRecords}
- macros.getByOwnerAndStatus(idOwner, status, name) - GET /{idOwner}/{status}
- macros.create(macro) - POST /
- macros.update(macro) - PUT /
- macros.remove(id) - DELETE /
- macros.execute(id, ticket = undefined) - GET /{id/execute}
Organizations (octadesk.organizations)
- organizations.get(id) - GET /{id}
- organizations.create(organization) - POST /
- organizations.update(organization) - PUT /{id}
Persons (octadesk.persons)
- persons.get(id) - GET /{id}
- persons.getByEmail(email) - GET /?email=
- persons.create(person) - POST /
- persons.update(person) - PUT /{id}
Products (octadesk.products)
- products.get(id) - GET /{id}
- products.create(product) - POST /
- products.update(product) - PUT /{id}
- products.remove(id) - DELETE /{id}
- products.search(keyword, onlyEnabledItems = true) - GET /search
- products.search(idProductGroup, keyword, onlyEnabledItems = true) - GET /search/{idProductGroup}
- products.search(idProductGroup, fieldName, keyword, onlyEnabledItems = true) - GET /search/{idProductGroup/{fieldName}
Smart Forms (octadesk.smartforms)
Subjects (octadesk.subjects)
- subjects.getAll() - GET /
- subjects.get(id) - GET /{id}
- subjects.search(keyword, onlyEnabledItems = true, invisibleToClient = true) - GET /search
Tags (octadesk.tags)
- tags.get(keyword = "") - GET /?keyword=
- tags.create(tagName) - POST /
Tickets (octadesk.tickets)
- tickets.get(number) - GET /{number}
- tickets.getByRequester(idRequester, lastNumber = 0) - GET /?idRequester=&lastNumber=
- tickets.getInteractions(number) - GET /{number}/interactions
- tickets.create(ticket) - POST /
- tickets.update(ticket) - PUT /{number}
- tickets.getCustomLists() - GET /custom-lists
- tickets.getCustomListsCounts() - GET /custom-lists/counts
- tickets.getCustomList(idList) - GET /custom-list/{idList}
- tickets.getCustomListCount(idList) - GET /custom-list/{idList}/count
- tickets.executeList(idList, options = {}) - POST /list/{idList/execute}
- tickets.getDefaultLists() - GET /default-lists
- tickets.search(options) - GET /search?status=&lastDateUpdate=&openDate=&lastTicketReference=
Workflow (octadesk.workflow)
- workflow.getAllAvailableStatus() - GET /available-status
- workflow.getAvailableStatus(idCurrentStatus) - GET /available-status?idCurrentStatus=
- workflow.getCustomAvailableStatus(idTypeStepFlow) - GET /available-status/custom/{idTypeStepFlow}