Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM WebAPI Unknow Error

(1) ShareShare
ReportReport
Posted on by

HI,

In new CRM2016 SP1, im trying to use the CRM WebAPI

https://myserver/myorg/api/data/v8.1/

And im having this error: "Unknow Error"

 

  1. Error Details: Invalid URI: The hostname could not be parsed.
  2. RequestUri:
    /MYORG/api/data/v8.1/

I tried this but it doesnt solve the issue: https://support.microsoft.com/en-us/help/896861/you-receive-error-401.1-when-you-browse-a-web-site-that-uses-integrated-authentication-and-is-hosted-on-iis-5.1-or-a-later-version

Note: Im using CRM 2016 on premises, F5 load balance, 2 front-ends.

*This post is locked for comments

  • Remon Profile Picture
    Remon 1,485 on at
    RE: CRM WebAPI Unknow Error

    Hi Andrew Lehmann,


    Have you been able to solve this (and or find the cause)?

    We are having 1:1  the same setup, 4 front-ends (on HTTP), F5 in front of it which does SSL offloading + adds the header. CRM in NLB mode, and header setting added.

    CRM itself is working fine, only the odata endpoint is failing on us.

    Thanks,

    Remon

  • slx Profile Picture
    slx 386 on at
    RE: CRM WebAPI Unknow Error

    Could you please help with the following scenario ? I am running this code to delete a reference parentcustomerid_account

    This is working successfully on DEV but when executed on different environment IFD / ADFS the request is 404 NOT FOUND

    Do you have any idea ? Thank you

    // [Org URI]/api/data/v8.2/contacts([contactid#])/parentcustomerid_account/$ref

    contact1Uri = httpClient.BaseAddress + web_api + "contacts(" + myReader.Value.ToString().ToLower() + ")/parentcustomerid_account/$ref";

    HttpResponseMessage disassocResponse1 = await httpClient.DeleteAsync(contact1Uri);

    if (disassocResponse1.StatusCode == HttpStatusCode.NoContent)

    Status code is 404 = NOT FOUND

    Same code is successful on different environment

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: CRM WebAPI Unknow Error

    I would check IIS bindings for your side and Deployment Manager's web address settings.

    There is no actual API folder or virtual folder. It is all handled by HTTP Modules in IIS.

    Maybe your IIS or CRM's web.config settings got messed up. It's hard to tell why only your API request fails.

    Thats why I assume that some of the configurations got wrongly configured.

  • RE: CRM WebAPI Unknow Error

    Hi Andreas,

    I take out F5 and configure CRM to access via the FrontEnd node.

    Same results, all is working except the WEB API:

    "Hostname could not be parsed"

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: CRM WebAPI Unknow Error

    I do recommend to take out F5 and try to directly access CRM and see if it generally working.

  • ashlega Profile Picture
    ashlega 34,477 on at
    RE: CRM WebAPI Unknow Error

    I don't think there would be that directory - it's all done through the http modules/handlers, so it's all "virtual". In other words, it's probably normal you don't see those folders (but I can't check in the online environment). It would not matter for F5 redirection, though, since it'll be accessing those folders over HTTP rather than directly. My question was more about the redirect rules (whatever they are) on the F5 side - if they are correctly mapping those long httpS urls to CRM

  • RE: CRM WebAPI Unknow Error

    Hi,

    I made a trace and i found this:

    >FileExists ~/api/data returning False.

    [2017-06-22 11:31:44.127] Process: w3wp |Organization:8353ec38-860d-e711-80e9-005056a43f80 |Thread:   23 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose |ReqId: ee24c3ac-8fdb-4fb8-9460-22e60ea38851 | RouteCollection.GetRouteData  ilOffset = 0x41

    >DirectoryExists ~/api/data returning False.

    Silly me, i didnt check if there is a folder under CRM Web Site called, "/api/data".

    Im running CRM Version 8.1.0000.0381 and it is strange the lack of the API.. , i didnt see in documentation some extra steps to install the web API.

    do you have this directory /api/data/?

  • ashlega Profile Picture
    ashlega 34,477 on at
    RE: CRM WebAPI Unknow Error

    Hi Andrew,

     I don't know if it's too complicated to try.. and F5 is not what I work with all the time, to say the least.. but I would try to make sure it's, actually, a CRM problem:

    - Create a different web site (load balanced, configured similar to CRM.. maybe use a different host name.. or a different port), just have 1 static page there. Basically, replicate the same configuration just for a different site which has nothing but a statis html page

    - Make sure it works

    - Then move that page to a subfolder (like api..), and see if it works then

     Really what I'm wondering is whether those F5 rules you have set up to redirect traffic from HTTPS to HTTP etc are working correctly when the url is more complex.

  • RE: CRM WebAPI Unknow Error

    Hi Alex,

    Yes, i try with the CRM web API in the same browser i signed in into my crm.

    Im getting this error both from chrome and explorer and also calling from a custom javascript. But the discovery URL works.

    I did a tracing too, and i can see in the server logs same error.

  • ashlega Profile Picture
    ashlega 34,477 on at
    RE: CRM WebAPI Unknow Error

    Hi,

     did you try entering that web API url directly in the browser? Are you getting the same error? Can you open Dynamics using the same browser window?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans