/AutotaskClientAPI

An API Forwarder for Autotask that sandboxes requests to a specific organization.

Primary LanguageJavaScript

Autotask Client API

This Azure Function can be used to connect individual companies to the Autotask API. It will sandbox the functions to just that individual company. Each company gets configured with their own API Key (in local.settings.json) and then each company is assigned to a company ID (the Autotask company ID, in OrgList.json). Only specific endpoints are allowed, you can see the whitelisted endpoints at the top of index.js.

Currently this will not support any Child API Endpoints nor any endpoints that are not scoped to a specific company.

Configuration:

  • Setup an Autotask API account with access to all of the whitelisted endpoints. Currently thats is: READ Companies, Locations, Contracts & ConfigurationItems, to READ/WRITE Tickets and to WRITE TicketNotes. Fill in the Autotask configuration with API account details in local.settings.json.
  • Create API keys for each company you want to setup in local.settings.json. See the template, replace "STS" with the companies acronym.
  • Map each companies acronym to their Autotask Company ID in OrgList.json. See the template, replace "STS" with the companies acronym and 0 with the Autotask Company ID.
  • Push the code and settings to an Azure Function.

Usage:

Send a POST request to the full azure function URL (with the function key), include the following in the request:

  • In the Header, set the key apikey to the unique API Key for that organization (set in local.settings.json).
  • In the Body, a JSON object with the following: