Have been trying to retrieve the data from the Details tab of the Sales Orders(SO301000) screen using the below link with GET request and have been getting the attached screenshot in the response. The requirement is to retrieve the data from the Details tab for all the Sales Orders.
I would like to retrieve the data based on the following example: If there are two Sales Orders with IDs SO-001 and SO-002, and each Sales Order has two Line Items, then the API should return a list of four Line Items, which would be the two Line Items associated with SO-001 and the two Line Items associated with SO-002.
Hello @Harshita as @vigneshponnusamy89 suggested, make sure you $expand on Details but still use SalesOrder endpoint.
Make sure you do login call before trying to work with REST APIs though.
Thank you @RohitRattan88 for the solution. It worked now. The main issue I was facing was related to the value for Accept & Content Type keys under the Headers section. The values are required to be set to application/json.
Hello @vigneshponnusamy89 & @RohitRattan88 Similarly I have been trying to update the status of the Sales Orders to “Completed” by using a PUT request with the below mentioned URL and request body:
URL: /entity/Default/20.200.001/SOOrder and also tried with /entity/Default/20.200.001/SalesOrder
I have defined a new Action that is required to be performed as shown below and did try to run a POST request, but still triggering the error 415-Unsupported Media Type
@Harshita, Please ensure you have the request body type set to JSON,
@Harshita also make sure you have correct Headers set for the call:
Thank you @RohitRattan88 for listing out the Header point. I checked out by modifying the Headers and as @vigneshponnusamy89 had mentioned, to set the body type to JSON. I ran the POST request, and looks like it is working now.
But since the button is disabled, the action wont work. But still need to confirm on this if still it could work or not.