How to remove Dynamics 365 finance & operation metadata from odata call?

932 views Asked by At

I try to get data from OData. The link is as below.

https://*********.cloudax.dynamics.com/data/PurchaseOrderHeadersV2?$select=PurchaseOrderNumber,RequestedDeliveryDate,DeliveryAddressDescription&$filter=OrderVendorAccountNumber%20eq%20%27100001%27

I only add 3 fields to the select clause. But the "@odata.etag" field has added to the response. The response is as below.

{
  "@odata.context":"https://****.cloudax.dynamics.com/data/$metadata#PurchaseOrderHeadersV2(PurchaseOrderNumber,RequestedDeliveryDate,DeliveryAddressDescription)","value":[
    {
      "@odata.etag":"W/\"JzE5MDYyOTE2NzcsNTYzNzMwMzU3NjswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003871","RequestedDeliveryDate":"2020-10-07T12:00:00Z","DeliveryAddressDescription":"******"
    },{
      "@odata.etag":"W/\"JzE5NjkzNDMzOTUsNTYzNzMwMzU3NzswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003872","RequestedDeliveryDate":"2020-09-16T12:00:00Z","DeliveryAddressDescription":"*******"
    },{
      "@odata.etag":"W/\"JzIwNzgyNTg4OSw1NjM3MzAzNTc4OzAsMDsxLDU2MzcxNjMzMjY7MCwwOzAsMCc=\"","PurchaseOrderNumber":"PO00003873","RequestedDeliveryDate":"2020-10-08T12:00:00Z","DeliveryAddressDescription":"*****"
    },{
      "@odata.etag":"W/\"JzE3MjYzMjQ0NzUsNTYzNzMwMzU3OTswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003874","RequestedDeliveryDate":"2020-10-08T12:00:00Z","DeliveryAddressDescription":"**********"
    },{
      "@odata.etag":"W/\"JzEsNTYzNzMwNDMyNjswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003881","RequestedDeliveryDate":"2020-10-09T12:00:00Z","DeliveryAddressDescription":"*********"
    }
  ]
} 

How can I remove this metadata information from response?

1

There are 1 answers

1
Arun Vinoth-Precog Tech - MVP On BEST ANSWER

You can try these headers, which will eliminate metadata from response.

Content-Type: application/json; odata.metadata=minimal

In fact you can mention odata.metadata=none for further

apiurl?$format=application/json;odata.metadata=none