Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

C# WebApi call : "Invalid URI: The Uri string is too long.",

(0) ShareShare
ReportReport
Posted on by 5

Hi All,

I am experiencing below error

Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

I am trying to do Get Request 

Passed 1000 Guids

string path = "https://dev.api.crm.dynamics.com/api/data/v9.1/accounts?$select=name&$filter=Microsoft.Dynamics.CRM.In(PropertyName = 'accountid', PropertyValues = ["Guid"])

public JToken Get(string path, Dictionary<string, List<string>> headers = null)
{
return GetAsync(path, headers).Result;
}

Please assist..

  • cloflyMao Profile Picture
    25,208 on at
    RE: C# WebApi call : "Invalid URI: The Uri string is too long.",

    Hi Sai13,

    Could you share full code?

    In general, we should keep URL under 2000 characters when sending GET request.

    You could consider using batch operations for Web API request.

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/execute-batch-operations-using-web-api

    Here is sample in C#:

    https://thucnguyen77.blogspot.com/2019/02/dynamics-365-how-to-execute-batch.html

    Regards,

    Clofly

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 87

Overall leaderboard

Product updates

Dynamics 365 release plans