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)

How can i achieve to access fetchxml Web API? Is it possible to Access from web service with authorization token?

(0) ShareShare
ReportReport
Posted on by 50

Hi friends,

I am trying to access web api as below

Currently I am calling below Web API

xxx.crm8.dynamics.com/.../contacts;fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="contact"><attribute name="contactid" /><attribute name="firstname" /><attribute name="middlename" /><attribute name="lastname" /><attribute name="mobilephone" /><attribute name="emailaddress1" /><order attribute="createdon" descending="true" /><filter type="and"><filter type="and"><condition attribute="emailaddress1" operator="like" value="mrxxx@gmail.com%" /><condition attribute="firstname" operator="like" value="name%" /><condition attribute="lastname" operator="like" value="shaikh%" /><condition attribute="mobilephone" operator="like" value="98251xxx%" /><condition attribute="statuscode" operator="eq" value="1" /></filter></filter></entity></fetch>

My output

{"@odata.context":"xxx.crm8.dynamics.com/.../v8.0$metadata#contacts(contactid,firstname,middlename,lastname,mobilephone,emailaddress1,createdon)","value":[{"@odata.etag":"W/\"101141016\"","contactid":"fb53fcf0-4da1-e811-a95f-000d3af06ac5","firstname":"name","middlename":"middlename","lastname":"shaikh","mobilephone":"98251xxxxx","emailaddress1":"mrxxxx@gmail.com","createdon":"2018-08-16T12:14:41Z"}]}


My concern:

How can i access same format API from Partner Portal. I don't mind making custom web service. but i want my output format to be same. How can i acheive this? Can you please guide me. 

I tried to make same request from SOAPUI but error says "The query parameter fetchxml is not supported". So i wonder, can i achieve this or not?

*This post is locked for comments

I have the same question (0)
  • RidvanShaikh Profile Picture
    50 on at
    RE: How can i achieve to access fetchxml Web API? Is it possible to Access from web service with authorization token?

    Thanks Ravi. This is what exactly i was looking for.  Really appreciate your help!

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: How can i achieve to access fetchxml Web API? Is it possible to Access from web service with authorization token?

    Hi,

    In order to access web api outside of CRM you need to register the app. Check this blog for step by step details-

    debajmecrm.com/.../step-by-step-guide-query-dynamics-crm-web-api-using-server-to-server-authentication-with-application-user

    Hope this helps.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: How can i achieve to access fetchxml Web API? Is it possible to Access from web service with authorization token?

    Hi,

    You can't execute fetchxml using WebAPI but you can use liquid in your web template in Dynamics portal to execute your FetchXML, For reference you can check these posts: stoneridgesoftware.com/using-liquid-templates-and-fetchxml-to-retrieve-data-in-a-dynamics-365-online-portal

    www.ktlsolutions.com/.../using-fetchxml-with-liquid-templates-for-crm-data-queries

    Later you can use jquery to use your result from fetchxml.

  • RidvanShaikh Profile Picture
    50 on at
    RE: How can i achieve to access fetchxml Web API? Is it possible to Access from web service with authorization token?

    Thanks and i have been to this article. My concern is, can i get same output as i am expecting with format request i sent. With link you shared sample, i cannot achieve output format. bcz this sample return output in xml.

  • gdas Profile Picture
    50,091 Moderator on at
    RE: How can i achieve to access fetchxml Web API? Is it possible to Access from web service with authorization token?

    You can not directly access web api from portal . If you are in on premise then create a wcf rest service connecting  through SDK with  CRM User and host it to the CRM server and then access the service using Xmlhttprequest from portal.

    www.inogic.com/.../programming-using-webapi-through-c-in-dynamics-crm-2016

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans