Can you use the Databricks API from a notebook?

tj-cycyota
Databricks Employee
Databricks Employee

I want to test out different APIs directly from a Databricks notebook instead of using Postman or CURL. Is this possible?

Mooune_DBU
Databricks Employee
Databricks Employee

If you're question is about using the Databricks API from within a databricks notebook, then the answer is yes of course, you can definitely orchestrate anything and invoke the REST API from a python notebook using the `requests` library already baked in the runtime for example.

Any other system/bash -based commands can also be run from a notebook if you precede them with the magic %sh command

Boris2
New Contributor II

You cannot consume the api across multiple workspaces because of isolation nonsense. Databricks pushes our notebooks outside the platform?

Panda
Valued Contributor

@tj-cycyota We have a couple of options using the REST API and the Databricks Python SDK. Please review the link for more details with examples. 
Streamlining Data Engineering: Databricks SDK for Python vs Databricks REST API

Boris2
New Contributor II

@Panda There is no REST API for databricks. "RE" in REST stands for Ready Everywhere. You cannot connect to the API in workspace 1, from a notebook in workspace 2. Therefor it is Not Ready Everywhere. Workspace 1 cannot resolve the hostname for Workspace 2.