Using the Datto REST API With Datto device Integrations

Topic

This article describes setting up and using the REST API with Datto device integrations.

Environment

  • Datto Partner Portal
  • Datto REST API

Description

Datto's REST API lets vendors create a dynamic integration experience in a more reliable and scalable way. It is also available for MSPs that have an experienced technical background.

Creating an integration with Datto's REST API provides an easy way to retrieve readily available device, agent, and backup status information. The Datto REST API uses the industry-standard Swagger UI for an interactive documentation experience that allows developers to trial responses from their own devices on their portal accounts.

Creating an API Key

  1. Log into the Datto Partner Portal.

  2. Click the Admin tab, then select Integrations from the drop-down menu.

  3. On the Integrations page, make sure you are on the API Keys tab, and then press Create API Key .

  4. On the Create API Key pane, provide a name for your API key and fill out any other fields as needed, and then press Create.

  5. The Datto REST API is now enabled, and configuration options will now appear.

REST API Configuration options

Configuration options are available for API keys through the three dot menu on the right side of the keys in the API Key Management section.

  • View keys: Displays public and private key(s)
  • Edit: Brings up the Edit API screen
  • Regenerate Key: generates a new public API key
  • Deactivate: disables the Datto REST API
  • Delete: Deletes created API key
  • Try it out: Populates the REST API documentation with public and private key for testing purposes
  • Reveal: displays the secret key's actual characters on-screen

Datto REST API documentation

Click the datto | Unified Continuity option under Documentation to expand the section. The API documentation includes basic API options and options for the individual endpoints.

Documentation pane options

  • Servers: This drop-down menu shows what server the API is currently communicating with, and lets you select different available servers.
  • Authorize: The REST API uses a basic authentication scheme, with an automatically generated public API key/secret API key.

Endpoint options

The API documentation provides a menu of all configurable endpoints. You can use the Try It Out button to change parameters within each endpoint. Click an endpoint to expand its options:

The endpoint will expand, showing all parameters accepted in the URL, as well as the JSON representation of the responses from the server.

Previewing API call results with the Swagger UI

The swagger UI lets you change endpoint parameters, run "preview" API calls, and view detailed results of the change at the presentation and code levels. In this view, you can:

  • Change each parameter and get a preview of the change's effect.
  • See the responses generated by each preview request as a Curl command and URL.
  • See the HTTP response codes generated when the server responds to the API call preview.
  • Download the JSON code block generated by your trial API calls.

A Datto device must be associated with the Partner Portal account, but not be associated with a vendor for these options to function.

To change parameters and preview an API call:

  1. Click the Try it out button in the upper right-hand corner.

  2. Edit fields will open for each parameter. Make the changes you want, then click the Execute bar to make the new API call.

  3. In the Responses pane beneath the Execute bar, you can view the Curl commands, request URL, HTTP code, response headers, and response code block generated by the preview API call. Click the Download button to download the code block as a JSON file. Click Clear to reset the API call preview.