Databricks Rest API

Ramya
New Contributor III

Hi, I am having an issue accessing data bricks API 2.0/workspace/mkdirs through python. I am using the below azure method to generate the access token. I am not sure why I am getting 404 any suggestions?

token_credential = DefaultAzureCredential()

scope = "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default".

Below is the snippet of my code.

response = requests.post(

 url="https://databricksurl/api/2.0/workspace/mkdir",

 headers={ 'Authorization': "Bearer " + access_token,

      'Accept': 'application/json'},

 json = {'path' : '/user/test'}

)

print(json.dumps(json.loads(response.text), indent = 2))

print(response)

Error:

{

 "error_code": "ENDPOINT_NOT_FOUND",

 "message": "No API found for 'POST /workspace/mkdir'"

}