Using OData to Return or Obtain a JSON Document
You can publish a page as a web service and consume it using JavaScript Object Notation (JSON).
Obtain a document based on JSON
You can build applications that consume and display Business Central data using JSON. This example assumes that you have registered and published a page web service in Business Central.
Start a supported web browser, such as Microsoft Edge. In the Address field, enter a URI in this format:
https://<Server>:<WebServicePort>/<ServerInstance>/ODataV4/<web service>?$format=json
If Business Central Server is running on the local computer and is using the default Business Central Server instance and OData port, and you have published a web service that is based on page 21 that is called Customer, then the address is:
https://localhost:7048/BC230/ODataV4/Customer?$format=json
This generates a text file that contains metadata and data from the web service. You can open the file from the browser, or you can save it to disk.
Note
The value of the format attribute must be lowercase:
?$format=json
.If you want to consume the web service as JSON-P, you can add the
?$callback=<callback function name>
parameter.You can use a similar URI to return the web service as an AtomPub document, in which case the attribute is
?$format=atom
. For more information, see Using OData to Return-Obtain an AtomPub Document.
See Also
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기