<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I make Databricks API calls from notebook? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/76634#M35287</link>
    <description>&lt;P&gt;This was a question and answer in one&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 14:10:34 GMT</pubDate>
    <dc:creator>StephanieAlba</dc:creator>
    <dc:date>2024-07-03T14:10:34Z</dc:date>
    <item>
      <title>How can I make Databricks API calls from notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/25313#M17586</link>
      <description>&lt;P&gt;Access to Databricks APIs require the user to &lt;A href="https://docs.databricks.com/dev-tools/api/latest/authentication.html" alt="https://docs.databricks.com/dev-tools/api/latest/authentication.html" target="_blank"&gt;authenticate&lt;/A&gt;.  This usually means creating a PAT (Personal Access Token) token. Conveniently, a token is readily available to you when you are using a Databricks notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;databricksURL = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiUrl().getOrElse(None)
myToken = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiToken().getOrElse(None)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thus you don't need to generate and manage a token yourself.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import requests
&amp;nbsp;
header = {'Authorization': 'Bearer {}'.format(myToken)}
endpoint = '/api/2.0/jobs/runs/list'
payload = """{"limit": "5", "offset": "0"}"""
&amp;nbsp;
resp = requests.get(
  databricksURL + endpoint,
  data=payload,
  headers=header
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 17:04:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/25313#M17586</guid>
      <dc:creator>User16752245312</dc:creator>
      <dc:date>2021-06-10T17:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make Databricks API calls from notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/40885#M27252</link>
      <description>&lt;P&gt;hmmm.... no resolution yet?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 01:43:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/40885#M27252</guid>
      <dc:creator>519320</dc:creator>
      <dc:date>2023-08-22T01:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make Databricks API calls from notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/76634#M35287</link>
      <description>&lt;P&gt;This was a question and answer in one&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 14:10:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/76634#M35287</guid>
      <dc:creator>StephanieAlba</dc:creator>
      <dc:date>2024-07-03T14:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make Databricks API calls from notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/94805#M38972</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/233"&gt;@User16752245312&lt;/a&gt;&amp;nbsp; You can use &lt;STRONG&gt;Databricks Secret Scope&lt;/STRONG&gt; to manage sensitive data such as personal access tokens (PATs) securely. Storing your token in a &lt;STRONG&gt;secret scope&lt;/STRONG&gt; ensures you don’t hard-code credentials in your notebook, making it more secure.&lt;BR /&gt;&lt;A href="https://tinyurl.com/4pjr76kd" target="_self"&gt;For more details how to use Databricks REST API&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 10:32:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-make-databricks-api-calls-from-notebook/m-p/94805#M38972</guid>
      <dc:creator>Panda</dc:creator>
      <dc:date>2024-10-18T10:32:25Z</dc:date>
    </item>
  </channel>
</rss>

