My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Sandeep Pawar

1 like

·

2.1K reads

3 comments

Swapnil Saxena
Swapnil Saxena
Jan 20, 2024

Awesome post.

Can I ask how do the POST requests work with FabricRestClient? I'm trying to invoke Job scheduler APIs to invoke an item job instance as covered in below REST API doc.

"Job Scheduler - Run On Demand Item Job" (Can't post links as I'm restricted currently)

I tried this: response = client.post(f"v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances?jobType={jobType}")

But I'm getting this exception FabricHTTPException: 400 Bad Request for url: . . . "moreDetails":[{"errorCode":"InvalidParameter","message":"'runOnDemandItemJobRequest' is a required parameter"}],"message":"The request has an invalid input"}

I understand that as per the doc, there's a request body that must go along too but can't figure out where to put that in the request method. Would appreciate any help on this. Thanks!

·
·2 replies
Sandeep Pawar
Sandeep Pawar
Author
·Jan 21, 2024

Swapnil Saxena please check the updated blog. I have added an example.

·
Swapnil Saxena
Swapnil Saxena
Jan 22, 2024

Sandeep Pawar

Thanks a lot! I could replicate your example to see the POST work.

However, for some reason, I'm unable to get the On demand job scheduler to work. It complains that the job type is invalid. I used the jobType=DefaultJob for a Data pipeline item.

learn.microsoft.com/en-us/rest/api/fabric/c..

·