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 :
Customer experience | Sales, Customer Insights,...
Answered

request resonse (api req )

(0) ShareShare
ReportReport
Posted on by 20

is there is any document related to ,how to create a contact , account, incedent, case in dynamic 365 customer service.... i need a json request response and then key and value explanation api document ,api url for request is there is any document , kindly share the link 

I have the same question (0)
  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    Hi,

    You can use OData web API, please refer to official Microsoft documentation:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/query-data-web-api

    Also, to get more used to request in Dynamics 365, you could use CRM rest builder:

    https://github.com/jlattimer/CRMRESTBuilder

    It will help you build request and test them directly.

    Hope it helps,

    Marco

    If you've found the answer helpful for you or other readers, please mark it as Verified.

  • Reentry Profile Picture
    20 on at

    I TRIED REST BUILDER , ,,,ACCOUNT , CONTACT ALL THOES THINGS ARE OK i done already with help of rest builder, now i am got stuck with how to create cases(incident) using api

    /api/data/v9.1/incidents

    i can get all incedent using this and using contact , account end point i am able to get and then pose(create ) but in the case of incedent i am given wrong json formate some structure

    help out sending body to create a incident

    what are things need to given to create a incedent

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    try something like this:

    var entity = {};

    entity["customerid_account@odata.bind"] = "/accounts(9392B0D1-85FF-E611-8115-C4346BAC2AD8)"; //replace Guid

    var req = new XMLHttpRequest();

    req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v9.0/incidents", true);

    req.setRequestHeader("OData-MaxVersion", "4.0");

    req.setRequestHeader("OData-Version", "4.0");

    req.setRequestHeader("Accept", "application/json");

    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

    req.setRequestHeader("Authorization", "Bearer " + token); //Replace token with your token value

    req.onreadystatechange = function() {

       if (this.readyState === 4) {

           req.onreadystatechange = null;

           if (this.status === 204) {

               var uri = this.getResponseHeader("OData-EntityId");

               var regExp = /\(([^)]+)\)/;

               var matches = regExp.exec(uri);

               var newEntityId = matches[1];

           } else {

               Xrm.Utility.alertDialog(this.statusText);

           }

       }

    };

    req.send(JSON.stringify(entity));

  • Reentry Profile Picture
    20 on at

    i am using postman to create read all ..

    send me request body

    entity["customerid_account@odata.bind"] = "/accounts(9392B0D1-85FF-E611-8115-C4346BAC2AD8)"; //replace Guid

    how to sent this key and value in body

    {

    "title":"demo2sample",

    "contactid":"4c49b706-5888-ea11-a811-000d3a0a82c7"

    }

  • Reentry Profile Picture
    20 on at

    i got the things that for response and support

    s.crm8.dynamics.com/.../incidents

    body :

    {

    "title":"demo2sample",

    "customerid_account@odata.bind":"/accounts(556602a1-6e88-ea11-a811-000d3a0a82c7)"

    }

    response an incident is created with 204

    can you just explain what is mean by odata.bind

    thanks again

  • Verified answer
    Marco.P Profile Picture
    2,405 on at

    Hi,

    I'm glad you succed.

    With odata.bind you bind the URI (for a data record) to e.g. a lookup field in a web api request.

    "When inserting or updating an entity, relationships of navigation properties MAY be inserted or updated via bind operations. A bind operation is encoded as a property annotation odata.bind on the navigation property it belongs to and has a single value for singleton navigation properties or an array of values for collection navigation properties.

    The values are the ids of the related entities."

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/create-entity-web-api


    If you've found my answer helpful, please mark it as Verified (by clicking on "Yes" under a suggested answer). This will also mark the thread as "Closed" and will help future users.

     

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans