cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Rest API Error 404

hbs59
New Contributor III

I am trying to export a notebook or directory using /api/2.0/workspace/export.

When I run /api/2.0/workspace/list with a particular url and path, I get the results that I expect, a list of objects (notebooks and folders) at that location.

But when I run /api/2.0/workspace/export with the same url and path, I get an error 404: resource does not exist.

Why would this be?

 

requests.request(
    method = 'GET',
    url = 'https://{host}/api/2.0/workspace/list',
    params = {'path' : '/Users/{user}/{folder}/'},
    headers = {'Authorization' : f'Bearer {host_token}'}
    )

requests.request(
    method = 'GET',
    url = 'https://{host}/api/2.0/workspace/export/', 
    params = {'path' : '/Users/{user}/{folder}/', 'format' : 'AUTO', 'direct_download' : True},
    headers = {'Authorization' : f'Bearer {host_token}'}
    )

 

1 ACCEPTED SOLUTION

Accepted Solutions

nkraj
New Contributor III
New Contributor III

Hi @hbs59 , Could you please try changing the export URL from : 

 

https://{host}/api/2.0/workspace/export/

 

To : 

 

https://{host}/api/2.0/workspace/export

 

Removing Extra '/' from the end.

View solution in original post

5 REPLIES 5

Debayan
Esteemed Contributor III
Esteemed Contributor III

Hi, Could you please remove the parameters , (format and direct_download) and confirm? 

hbs59
New Contributor III

Sure, I ran the following:

requests.request(
    method = 'GET',
    url = 'https://{host}/api/2.0/workspace/export/', 
    params = {'path' : '/Users/{user}/{folder}/'},
    headers = {'Authorization' : f'Bearer {host_token}'}
    )

As far as I can tell, the error is the same:

<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Bad Target: GET /2.0/workspace/export/</title>
</head>
<body><h2>HTTP ERROR 404 Bad Target: GET /2.0/workspace/export/</h2>
<table>
<tr><th>URI:</th><td>/api/2.0/workspace/export/</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Bad Target: GET /2.0/workspace/export/</td></tr>
<tr><th>SERVLET:</th><td>com.databricks.webapp.WebappDispatcherServletWithProxy-45f675a4</td></tr>
</table>

 

Debayan
Esteemed Contributor III
Esteemed Contributor III

Hi, Could you please raise a support ticket with us to investigate this further? We want to run this and check in your workspace. 

hbs59
New Contributor III

Hi, thank you for following up. I just opened a ticket for this.

nkraj
New Contributor III
New Contributor III

Hi @hbs59 , Could you please try changing the export URL from : 

 

https://{host}/api/2.0/workspace/export/

 

To : 

 

https://{host}/api/2.0/workspace/export

 

Removing Extra '/' from the end.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.