Dear all,
I have an issue I can't exit. I need to connect to bc to send a json. I'm using postman. But everytime it gives me error 400.
I do a post method as shown below, showing also the json:
I set the authorization (to get data I used NTLM and it ran):
I don't show username for reasons nut I inserted it
I set content-type="application/json" in header tab.
But everytime it gives me error 400. Can someone help me? I have never used nav so I don't know if there are any specific issues
Thanks
If I do a get method, I'll receive following JSON:
{
"odata.metadata": "https://**.dynamicscloud.it:7058/PROD_WS/OData/$metadata#OrdProdEMS",
"value": [
{
"odata.etag": "W/\"'20%3BZsMAAAJ7ATEAAAAAAA%3D%3D7%3B92072020%3B'\"",
"Transaction_ID": "1",
"Prod_Order_No": "TEST-EMS1",
"Line_No": 10000,
"Operation_No": "10",
"Item_No": "08692",
"Quantity": "100",
"Work_Center_No": "P1",
"Standard_Task_Code": "",
"Sales_Order_No": "ODV20-0030",
"Sales_Order_Line_No": 10000,
"Creation_Date": "2020-06-04T00:00:00",
"Imported": true,
"Error": "",
"ETag": "20;ZsMAAAJ7ATEAAAAAAA==7;92072020;"
}]}
While checking JSON properties, I don't find document type
I can't connect. I hope that my pc means properly my computer IP address. I can't also see anything browsing it
My example above was based on standard CRONUS data, did that work in your end?
MyPC:16048/.../SalesOrder
{
"Document_Type": "Order",
"Sell_to_Customer_No": "30000"
}
Moreover the problem is due to bad syntax, error
What I can tell you is that, if I do a get, connecting to this address https://***.dynamicscloud.it:7058/PROD_WS/OData/Company('***_test_20200603')/OrdProdEMS?$format=json, I can do it without any problems. If I post something, I won't be able to do it. It's impossible very time it says error 400
I got it to work like this:
Body:
{
"Document_Type": "Order",
"Sell_to_Customer_No": "30000"
}
POST MyPC:16048/.../SalesOrder
Also consider using API https://docs.microsoft.com/en-us/graph/dynamics-business-central-concept-overview - especially if you are doing something for long-term solutions. Thougs it all is OData so I cannot give you any specifics why API is better than OData, except it is newer.
Hi sdfs,
Can you do a simple GET command? Like this:
GET http://MyPC:16048/BC160/OData/Company('CRONUS%20International%20Ltd.')/SalesOrder
Sohail Ahmed
944
YUN ZHU
841
Super User 2025 Season 1
Mansi Soni
602