Forum Discussion
can't get semantic model definition via API call
- 1 year ago
Hi Jeanxyz,
Thank you for reaching out to the Microsoft Fabric Forum Community.
The 202 Accepted status means your request to retrieve the semantic model definition has been received and is being processed asynchronously. It is not an error, but a confirmation that the process is in progress.
Please consider the following steps:
- After receiving a 202 Accepted response, the API usually provides a polling URL in the response body. This URL is used to monitor the status of your request, indicating whether it’s still processing, completed, or encountered an issue. Make sure to capture and use it for tracking progress.
- You can regularly query the polling URL to check the status of your request, which could be InProgress, Succeeded, Failed, or Cancelled. If it shows InProgress, wait before querying again. Some responses might include a Retry-After header, indicating how long to wait.
- Once the status changes to Succeeded, the response will provide a download URL. Use this URL to download the semantic model definition. If the downloadUrl is still null, keep polling until it becomes available.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Tried both url, it didn't provide any new information. Is it just me who encountered the API problem?
Hi Jeanxyz,
Thank you for reaching out to the Microsoft Fabric Forum Community.
The 202 Accepted status means your request to retrieve the semantic model definition has been received and is being processed asynchronously. It is not an error, but a confirmation that the process is in progress.
Please consider the following steps:
- After receiving a 202 Accepted response, the API usually provides a polling URL in the response body. This URL is used to monitor the status of your request, indicating whether it’s still processing, completed, or encountered an issue. Make sure to capture and use it for tracking progress.
- You can regularly query the polling URL to check the status of your request, which could be InProgress, Succeeded, Failed, or Cancelled. If it shows InProgress, wait before querying again. Some responses might include a Retry-After header, indicating how long to wait.
- Once the status changes to Succeeded, the response will provide a download URL. Use this URL to download the semantic model definition. If the downloadUrl is still null, keep polling until it becomes available.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
- abhilash_o_p1 year agoFrequent Visitor
Hi v-saisrao-msft - I'm also facing similar issue. I got status_code 202 from this
client.post(f"/v1/workspaces/{workspaceId}/items/{itemId}/getDefinition")Then I extracted x-ms-operation-id and Retry-After from the response. Waited till the Retry-After & polled this
requests.get(f"https://api.fabric.microsoft.com/v1/operations/{operation_id}", headers=headers)I got the below mentioned response
{'status': 'Succeeded', 'createdTimeUtc': '2025-07-23T09:49:32.9426438', 'lastUpdatedTimeUtc': '2025-07-23T09:49:34.2863596', 'percentComplete': 100, 'error': None}I did not get the actual definition for semantic model. Please help.
- lbendlin1 year ago
Super User
Aren't you supposed to get a request id with your 202, and then you need to present that ID in the polling calls and the retrieval call?
- abhilash_o_p1 year agoFrequent Visitor
Thats what I did. Afterwhich upon getting status as 'Succeeded'. I again have to get the result using
requests.get(f"https://api.fabric.microsoft.com/v1/operations/{operation_id}/results", headers=headers)Which I haven't done. Now I'm getting.
Ref: Long Running Operations - Get Operation Result - REST API (Core) | Microsoft Learn