• Home
  • How to use Dynatrace
  • Davis Assistant
  • Integrations
  • Custom integrations

Build a custom Davis Assistant integration

Learn how to build a custom integration using the Davis Assistant API for platforms that aren't supported out of the box.

General requirements

  • A valid, enabled Davis Assistant API token
  • A system with network access to Davis Assistant on port 443

Authorization

  • All requests must include the Authorization header that includes a Davis Assistant API token.

  • Create a new Davis Assistant API token in the Davis Assistant API page (navigate to Configurations > Davis Assistant API in Davis Assistant Web).

    Note

    If the token is invalid, the API returns a 401 Unauthorized status code. If you're attempting to perform an action that requires administrative privileges for the selected environment and lack these privileges, the API returns a 403 Forbidden status code.

POST user interaction input

URLhttps://assistant.dynatrace.com/api/v2/interact
MethodPOST
HeaderContent-Type: application/json
HeaderAuthorization: api-token ${DAVIS ASSISTANT API TOKEN}
Request format
PropertyDescriptionTypeRequired
timezoneUser's time zone in tzdata formatstringrequired
sessionIdUniquely identifies a session to avoid conversation collisions (unique for each user).stringrequired
inputQuestion or phrase to be sent to Davis Assistantstringrequired
responseFormat

The output format desired

Valid formats:

  • "all"
  • "audible"
  • "visual"
stringoptional
tags

An array of tags for filtering interactions—all tags must match an underlining entity in order to be included in the response.

Valid formats:

  • "test"
  • { "key": "environment", "value": "prod" }
  • { "context": "AWS", "key": "environment", "value": "dev" }
arrayoptional

Request body:

json
{ "timezone": "America/Detroit", "sessionId": "custom:test@dynatrace.com:1", "input": "What happened this week?", "responseFormat": "audible", "tags": ["test", { "key": "environment", "value": "prod" }] }
Response format
PropertyTypeDescription
responseFormatstringIncluded response formats
response.textstringPlain text version of response
response.visualobjectSlack– and Davis Assistant Web–compatible format
response.audibleobjectSSML-compatible format used for Alexa speech responses
tenantstringName of environment associated with response
urlstringA URL is included in the response when there's a related Dynatrace dashboard. This property might not be on every response.

Response body (Status code 200):

json
{ "responseFormat": "all", "response": { "text": "Today, 11 problems occurred. The largest concentration of problems was around today at 9:00 AM. Would you like to see a listing of these issues?", "visual": { "text": "Today, 11 problems occurred. The largest concentration of problems was around <!date^1525093200^{date_long_pretty} at {time}|today at 9:00 AM>. Would you like to see a listing of these issues?" }, "audible": { "ssml": "Today, 11 problems occurred. The largest concentration of problems was around today at 9:00 AM. Would you like to hear a listing of these issues?" } }, "tenant": "Demo Environment", "url": "https://demo.dynatrace.com/e/131245bf-c8f0-4f70-b37d-0ac6e0b32a1e/#problems;gtf=c_1525060800000_1525147199999" }
Related topics
  • Root cause analysis

    Find out how Dynatrace identifies the root cause of problems and see how you can use the root cause section of a problem overview page to perform your analysis.