API testing in practice: REST, SOAP and the Dynamics 365 Web API
In short: an API test checks business logic and integrations below the UI by calling the service directly. It is faster and more stable than a UI test, and it can run before the UI is finished. Dataverse, the data layer of Dynamics 365, offers an OData v4 REST API with Microsoft Entra ID authentication; we build tests on it with Tricentis Tosca API Scan, Playwright or Postman and run them in CI before every deployment.
What is API testing, and how does it differ from UI testing?
An API (application programming interface) is the contract two systems use to talk to each other: which requests can be sent and which responses must come back. An API test checks this contract: it sends a request and verifies the status code, the structure and content of the response, the headers, the response time and, if the call wrote data, whether the system really stored it.
That does not make UI tests redundant: only they see the user journey end to end. Following the test pyramid, the right mix is many API tests and fewer, carefully chosen UI tests — more on this in manual vs automated testing.
REST or SOAP: what is the difference for testing?
The two most common API styles describe the contract differently and report errors differently; the test tool has to handle both when a process crosses both.
| Criterion | REST | SOAP |
|---|---|---|
| Message | usually JSON; the URL identifies the resource, the HTTP verb (GET, POST, PATCH, DELETE) the operation | an XML envelope sent to one endpoint; the message name defines the operation |
| Contract | OpenAPI/Swagger; for OData services the $metadata document | WSDL and XSD |
| Errors | HTTP status code (4xx, 5xx) and an error message in the response body | a SOAP Fault element, over HTTP with status 500 |
| What we check | status code, JSON schema, field values, headers, response time | schema-valid XML, field values via XPath, fault codes |
| Where you meet it | modern web and cloud services, the Dataverse Web API | older enterprise systems: ERP, banking and logistics integrations |
The test logic is the same for both: valid request, correct response (positive case), invalid request, meaningful error (negative case), and side effect: the record was really created, the status really changed, the connected system really received the data.
How does the Dynamics 365 (Dataverse) Web API work?
The data of the Dynamics 365 CRM apps (Sales, Customer Service and the others) lives in Dataverse. According to Microsoft Learn, the Dataverse Web API implements the OData 4.0 protocol, so it is a standard REST API: tables and columns are described by the $metadata document, and records are read, created, updated and deleted with GET, POST, PATCH and DELETE requests.
What should be tested at API level in a Dynamics 365 system?
- Plug-in and rule logic: create or update a record through the API, then read back calculated fields, status changes and related records that were created.
- Permissions: the same request with test users in different security roles; what a role may not see or change, the system must reject.
- Integrations: data going to ERP, invoicing or a web shop, field by field, compared with the receiving side’s API.
- Custom APIs and actions: input, output and error paths of your own endpoints.
- Error handling: a missing required field, an invalid lookup reference, text that is too long — the response must be clear, and the system must not be left half-updated.
An API test works with its own test data: it creates the records it needs at the start, deletes them at the end and never runs against production. Where GDPR-compliant data for this comes from is covered in test data management for Dynamics 365.
Which tool: Tricentis Tosca API Scan, Playwright or Postman?
The choice depends on the team, not the API: Tosca if business testers maintain the tests, Playwright if developers do, Postman for exploratory and integration checks. A general comparison: Tricentis Tosca vs Katalon vs Playwright.
How do API tests run in CI/CD?
API tests go into the same deployment pipeline as UI tests: they run against the test environment before every deployment and every night, the results are attached to the pipeline as a JUnit report, and a failure stops the deployment. Credentials (client ID, secret or certificate) come from the CI secret store, never from the repository.
With Dynamics 365, API tests are especially valuable before the twice-yearly update: an integration failure is invisible in the UI but shows up at once at API level. See Dynamics 365 test automation and release waves.
How do we help with API testing?
We review the integrations and custom logic, select the cases to test at API level by risk, build the suite with the tool that fits your team, wire it into CI and maintain it together with the system.
More about the service: test automation and testing.
Frequently asked questions
What is the difference between an API test and an integration test?
An API test checks the contract of one service: does a given request return the correct response. An integration test checks whether two or more systems work correctly together. In practice, most integration tests consist of API calls.
Do you need to code for API testing?
Not necessarily. Tricentis Tosca API Scan builds tests from the service description without code; Postman needs only light scripting for checks. Playwright is code-based and suits developers.
Can Playwright test a SOAP service?
Yes, because Playwright can send any HTTP request, so a SOAP envelope can be posted as an XML body. It has no WSDL support, though, and the test has to parse the XML response itself. For many SOAP services Tosca or Postman is more convenient.
How does a test authenticate to the Dynamics 365 Web API?
With an OAuth 2.0 token from Microsoft Entra ID. Automated tests need an app registration and an application user in the Dynamics environment with a suitable security role; the secret or certificate comes from the CI secret store.
Can API tests run against production?
We do not run write tests in production: they would create records and trigger plug-ins and flows. Tests run in a sandbox; in production at most read-only checks that change no data are an option, by agreement.
Let’s talk about your project.
Tell us what you are planning and we will get back to you within a few days.
Get in touch