web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

WEB API "msdyn_SearchResourceAvailability" returns outputs empty

(2) ShareShare
ReportReport
Posted on by 51

Hi,

I´m trying to schedule a resource for a work order (automatically) when a new resource requirement is created in my CRM organization. For this, I read about the ‘Search resource availability API’ and the most information that I found it was in these blogs:

Search Resource Availability with Universal Resource Scheduling API - Microsoft Dynamics 365 Blog

How to use the Search Resource Availability API - Universal Resource Scheduling - Microsoft Dynamics 365 Blog

I noticed that normally the people design a web resource through which they send the request for use this API, but I am not have experience working with this kind of solutions, so I prefer to use Power Automate to call the API through the unbound action: msdyn_SearchResourceAvailability.

I decided to start with a small number of parameters to verify this functionality, but no matter what parameters I test, the answer never shows me any available timeslot or resource. These are an example:

Imagen1.png

the flow's outputs give me resources and time slots empty as following:

3051.img2.png

but when I try to book a resource requirement in Field Service using the schedule assistant with the same duration and dates it show me the resources list.

What do you think i doing wrong? thanks

NOTE: When I try to put the "@odata.type" in power automate json, it give me a error. So I create a variable to solve this problem as saw in this site: Solved: Why does Compose Action give me an error? - Power Platform Community (microsoft.com)

  • Suggested answer
    Gabriel Dias Junckes Profile Picture
    2,428 on at

    Hi.

    This API works well but it is hard to configure the first time. I will suggest you don't add many filters at the beginning before you get the results.

    I think the last time I built it, version 3.0 did not work so I user 2.0 or 2.1.1

    Regarding the  "@odata.type", you can try a compose function before or add a double @@ e.g.  "@@odata.type"

    I did not use the Dataverse action to do it before so I don't know it works. You can try to build it on the HTTP Request.

    powerusers.microsoft.com/.../921348

  • srueda Profile Picture
    51 on at

    Hi Gabriel,

    I had change the version to 2.1.1 on a HTTP request in Postman

    My HTML body is the following, similar to the Microsoft documentation example

    {
    
        "Version": "2.1.1",
    
        "IsWebApi": true,
    
        "Requirement": {
    
            "msdyn_fromdate": "2021-12-13",
    
            "msdyn_todate": "2021-12-17",
    
            "msdyn_remainingduration": 60,
    
            "msdyn_duration": 60,
    
            "@odata.type": "Microsoft.Dynamics.CRM.msdyn_resourcerequirement"
    
        },
    
        "Settings": {
    
            "ConsiderSlotsWithProposedBookings": false,
    
            "MovePastStartDateToCurrentDate": true,
    
            "@odata.type": "Microsoft.Dynamics.CRM.expando"
    
        },
    
        "ResourceSpecification": {
    
            "@odata.type": "Microsoft.Dynamics.CRM.expando",
    
            "ResourceTypes@odata.type": "Collection(Microsoft.Dynamics.CRM.expando)",
    
            "ResourceTypes": [
    
                {
    
                    "@odata.type": "Microsoft.Dynamics.CRM.expando",
    
                    "value": "3"
    
                }
    
            ]
    
        }
    
    }
    Captura3.PNG

    Now the API generate the following output, how can I fix this?

    {
        "@odata.context": "https://api.crm2.dynamics.com/api/data/v9.2/$metadata#Microsoft.Dynamics.CRM.msdyn_SearchResourceAvailabilityResponse",
        "TimeSlots": [
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.organization"
            },
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.organization"
            },
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.organization"
            }
        ],
        "Resources": [
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.organization"
            },
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.organization"
            },
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.organization"
            }
        ],
        "Related": {
            "@odata.type": "#Microsoft.Dynamics.CRM.organization"
        },
        "Exceptions": {
            "@odata.type": "#Microsoft.Dynamics.CRM.organization"
        }
    }

    Can you please share the HTML body you used the last time you built it the API?

    Thank you!

  • philc79 Profile Picture
    90 on at

    Not sure if you resolved this, I have had the same issue and I found the resolution in this article: www.praxiis.co.uk/.../fixing-the-search-resource-availability-api

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
11manish Profile Picture

11manish 48 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 45

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 18

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans