I'm trying to fetch timeslots with Resource Scheduling API but it always return earliest available time for resources and I want it to be multiple 15 min. slots.

I guess it's beacuse "Fulfillment preference" Field is not specified in Resource Requirement.


I tried to use existing Resource Requirement with Fulfillment preference specified as well as Resource Requirement created on the fly (according to API documentation https://cloudblogs.microsoft.com/dynamics365/it/2019/05/21/retrieve-resource-availability-with-universal-resource-scheduling-api/ )

but still didn't get results.

Could you please tell me what can I do about it?

My c# code is:

OrganizationRequest or = new OrganizationRequest("msdyn_SearchResourceAvailability");
or.Parameters.Add("Version", "1");

var requirement = new Entity("msdyn_resourcerequirement");
requirement.Attributes["msdyn_fromdate"] = DateTime.Now;
requirement.Attributes["msdyn_todate"] = DateTime.Now.AddDays(days);
requirement.Attributes["msdyn_effort"] = (decimal)1;
requirement.Attributes["msdyn_duration"] = 15;
requirement.Attributes["msdyn_timegroup"] = fullfillmentReq.ToEntityReference();

var settings = new Entity();
or.Parameters.Add("Requirement", requirement);
or.Parameters.Add("Settings", settings);

var resp = connection.Execute(or);

Thank you,