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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Resource not found for the segment

(0) ShareShare
ReportReport
Posted on by 140

Hi,

I am trying to call the action from XRM Javascript using API. when I tried to call the API(https://innovations.api.crm8.dynamics.com/api/data/v9.0/tech_sampleaction) I am getting the error

"{"error":{"code":"0x80040216","message":"Resource not found for the segment 'tech_sampleaction'.","innererror":{"message":"Resource not found for the segment 'tech_sampleaction'.","type":"Microsoft.OData.UriParser.ODataUnrecognizedPathException","stacktrace":"   at Microsoft.OData.UriParser.ODataPathParser.CreateDynamicPathSegment(ODataPathSegment previous, String identifier, String parenthesisExpression)\r\n   at Microsoft.OData.UriParser.ODataPathParser.CreateFirstSegment(String segmentText)\r\n   at Microsoft.OData.UriParser.ODataPathParser.ParsePath(ICollection`1 segments)\r\n   at Microsoft.OData.UriParser.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n   at Microsoft.OData.UriParser.ODataUriParser.Initialize()\r\n   at Microsoft.OData.UriParser.ODataUriParser.ParsePath()\r\n   at System.Web.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer, Boolean template)\r\n   at System.Web.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)"}}}"  Cany Any one please suggest me how to fix this issue? Thanks in Advance

*This post is locked for comments

I have the same question (0)
  • Ash06 Profile Picture
    104 on at
    RE: Resource not found for the segment

    Make sure you are using the correct plural name for the entity "tech_sampleaction". i got the same error for my query and when i updated the plural name it worked fine.

    pastedimage1668743479372v1.png

    pastedimage1668743537212v2.png

  • Suggested answer
    Ahmad Pirani Profile Picture
    90 on at
    RE: Resource not found for the segment

    Make sure that your custom action has at least one output parameter. Does not matter if you are using it or not. Unless an output parameter is specified, your custom action won't show up in web api metadata.

    Amazing design by Microsoft "engineers" right? And what is extremely helpful is that it is not documented anywhere. And guess what Microsoft is going to keep only Wep API (with almost useless documentation) as the only way to access CRM in the future.

    I Love Inconsistencies by Microsoft in their products. Keeps my time wasted.

  • Suggested answer
    Preeti Sharma Profile Picture
    2,678 on at
    RE: Resource not found for the segment

    Hi,

    Can you please try accessing action by adding "Microsoft.Dynamics.CRM" first.

    For example:

    innovations.api.crm8.dynamics.com/.../Microsoft.Dynamics.CRM.tech_sampleaction

    Please check below link:

    www.c-sharpcorner.com/.../calling-custom-actions-using-web-api

    Hope this helps:)

  • Community Member Profile Picture
    on at
    RE: Resource not found for the segment

    Hope the below URL would help in resolving it. Mark this as answered if the issue is resolved.

    community.dynamics.com/.../why-my-action-is-not-available-through-webapi

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans