<?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: Not able to get json response for &amp;quot;/api/2.0/accounts/{account_id}/metastores&amp;quot; endpoint. in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4082#M42</link>
    <description>&lt;P&gt;Apparently, it is working if I add the header `X-Databricks-Account-Console-API-Version` with value `2.0` to the call&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 12:55:34 GMT</pubDate>
    <dc:creator>ruben1</dc:creator>
    <dc:date>2023-06-21T12:55:34Z</dc:date>
    <item>
      <title>Not able to get json response for "/api/2.0/accounts/{account_id}/metastores" endpoint.</title>
      <link>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4080#M40</link>
      <description>&lt;P&gt;&lt;B&gt;&lt;I&gt;Hi &lt;/I&gt;&lt;/B&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get list of all the metastores associated with an accountId. For this I am using the below REST API to get data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;accountId = json.loads(dbutils.notebook.entry_point.getDbutils().notebook().getContext().toJson())["tags"]["accountId"]
print(accountId)
url = 'https://accounts.cloud.databricks.com/api/2.0/accounts/{}/metastores'.format(accountId)
response = requests.get(url, auth=("&amp;lt;USERNAME&amp;gt;","&amp;lt;PASSWORD&amp;gt;"))
response.content&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have proper admin access and the response I get here is an HTML response, not a JSON one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="metastore_response"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/170iDFA1675B0AB60008/image-size/large?v=v2&amp;amp;px=999" role="button" title="metastore_response" alt="metastore_response" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to verify I also tried to use "Workspace" API like below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;accountId = json.loads(dbutils.notebook.entry_point.getDbutils().notebook().getContext().toJson())["tags"]["accountId"]
print(accountId)
url = 'https://accounts.cloud.databricks.com/api/2.0/accounts/{}/workspaces'.format(accountId)
response = requests.get(url, auth=("&amp;lt;USERNAME&amp;gt;","&amp;lt;PASSWORD&amp;gt;"))
response.content&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives a proper JSON response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can someone help in what am I doing wrong while hitting "Metastore" endpoint ? And how to get proper JSON response out of it ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 08:05:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4080#M40</guid>
      <dc:creator>nikhilkumawat</dc:creator>
      <dc:date>2023-05-23T08:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get json response for "/api/2.0/accounts/{account_id}/metastores" endpoint.</title>
      <link>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4081#M41</link>
      <description>&lt;P&gt;I'm having exactly the same problem. Seems a bug in the API.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:50:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4081#M41</guid>
      <dc:creator>ruben1</dc:creator>
      <dc:date>2023-06-21T12:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get json response for "/api/2.0/accounts/{account_id}/metastores" endpoint.</title>
      <link>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4082#M42</link>
      <description>&lt;P&gt;Apparently, it is working if I add the header `X-Databricks-Account-Console-API-Version` with value `2.0` to the call&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:55:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/not-able-to-get-json-response-for-quot-api-2-0-accounts-account/m-p/4082#M42</guid>
      <dc:creator>ruben1</dc:creator>
      <dc:date>2023-06-21T12:55:34Z</dc:date>
    </item>
  </channel>
</rss>

