Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4140

MS Fabric REST API - get notebook definition

$
0
0

I'm using a MS Fabric notebook and want to get the definition of another notebook using the REST APIhttps://learn.microsoft.com/en-us/rest/api/fabric/notebook/items/get-notebook-definition?tabs=HTTP

This code should do it:

import requeststoken_string = mssparkutils.credentials.getToken("https://api.fabric.microsoft.com/")header = {'Content-Type':'application/json','Authorization': f'Bearer {token_string}'}workspace_id = '...'notebook_id = '...'notebook_def_api_url = f'https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/notebooks/{notebook_id}/getDefinition'response = requests.get(url=notebook_def_api_url, headers=header)print(response.json())

However, the response is

{'requestId': '...', 'errorCode': 'UnknownError', 'message': 'An error occurred while processing the operation'}

What could be the issue here?

Meanwhile, other API requests work fine, including getting the notebook (without definition).https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/notebooks/{notebook_id}

(Also, I'm not using a service principal because the code runs directly in a Fabric notebook - see https://www.tackytech.blog/how-to-call-fabric-rest-apis-from-python-notebooks/ .)


Viewing all articles
Browse latest Browse all 4140

Latest Images

Trending Articles



Latest Images