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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to get all contracts with API

(0) ShareShare
ReportReport
Posted on by 10

Hello,

I have tried to get all contracts by API with xxx.crm4.dynamics.com/.../contracts but result is : 

{"@odata.context":""value":[]}">xxx.crm4.dynamics.com/.../$metadata

Could you help me ?
I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Your API query looks good to me.

    Please verify if you have read access on Contracts entity. Have you tried running this api query using system admin user.

    You don't see any value because either you don't have access to Read Contracts OR you don't have any record in yoru instance.

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Please refer below API.

    1. If you need entity data(All the records) then refer below API.

    GET [Organization URL]/api/data/v9.2/accounts

    2. If you need specific record information in specific entity then provide the GUID in 2nd API.

    GET [Organization URL]/api/data/v9.2/accounts(b4cea450-cb0c-ea11-a813-000d3a1b1223)

    3. if you need specific record information in specific entity(with limited fields) then provide the GUID in 3nd API as well as the logical name of the fields.

    GET [Organization URL]/api/data/v9.2/accounts(b4cea450-cb0c-ea11-a813-000d3a1b1223)?$select=websiteurl,name

    docs.microsoft.com/.../query-data-web-api

    Thank you,

    Amit katariya

  • Cedric GIRARD Profile Picture
    10 on at

    The used user is the global administrator of dynamics 365 and there is 30 contracts saved on the platform... :-(

  • Cedric GIRARD Profile Picture
    10 on at

    with accounts it is work but not with contracts....

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Try below

    CRM URL/api/data/v9.2/contracts

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Also you can check out from your browser where you are already logged in with the credentials.

    pastedimage1653394271865v1.png

    if you will just replace the URL with your URL then it will also work for you.

    CRM URL/api/data/v9.2/contracts

  • Luke Jones Profile Picture
    20 on at

    Hello, I am an associate of Cedric Girard.

    I have already tried with our URL and the value is empty but on dynamics 365 we have 30 contracts saved on the platform.

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Are you an admin or are you able to see this contracts from the advanced find?

    because if you are not able see this records then it will be not visible in API result also.

  • Luke Jones Profile Picture
    20 on at

    I think I'm admin and I can see the contracts from Dynamics 365 in Field service.

  • Guido Preite Profile Picture
    54,086 Moderator on at

    are you sure is Contract entity and not some other entity that got renamed inside the UI?

    if you can find the records with advanced find post here the FetchXML (you can download from the button "Download Fetch XML") inside the FetchXML is written the exact entity name the query is using

    or you can get the entityname also from the url of a link to a specific record

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans