ARTICLE · TEST AUTOMATION · API

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.

FasterNo browser, no page load: an API test typically runs in a fraction of the time of its UI equivalent, so many cases can run on every deployment.
More stableA rearranged form, a new button or a renamed tab does not break it. When an API test fails, it is usually a real defect.
EarlierThe API is usually ready before the UI, so testing can start earlier.
Where integrations liveData exchange between systems (ERP, invoicing, web shop) is invisible in the UI; it can only be checked field by field at API level.

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.

CriterionRESTSOAP
Messageusually JSON; the URL identifies the resource, the HTTP verb (GET, POST, PATCH, DELETE) the operationan XML envelope sent to one endpoint; the message name defines the operation
ContractOpenAPI/Swagger; for OData services the $metadata documentWSDL and XSD
ErrorsHTTP status code (4xx, 5xx) and an error message in the response bodya SOAP Fault element, over HTTP with status 500
What we checkstatus code, JSON schema, field values, headers, response timeschema-valid XML, field values via XPath, fault codes
Where you meet itmodern web and cloud services, the Dataverse Web APIolder 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.

AuthenticationAn OAuth 2.0 access token from Microsoft Entra ID. Automated tests need an app registration and an application user in the environment with a suitable security role; the test stores no password.
QueriesOData query options: $select (columns), $filter, $expand (related records), $orderby, $top. The test requests exactly what it verifies.
Business logicThe Web API runs on the same platform as the UI: plug-ins, business rules and real-time workflows also fire on API calls, so the logic can be tested at API level.
OperationsMessages that are not CRUD operations are exposed as functions or actions; your own custom APIs are called the same way.
LimitsDataverse applies service protection limits: when a client sends too many requests it returns 429 Too Many Requests with a Retry-After header. The test framework must handle this, or throttling turns into false failures.
Microsoft has deprecated the old 2011 SOAP endpoint of Dataverse (Organization service); for new development and tests the Web API or the .NET SDK is recommended. In Dynamics projects, SOAP therefore mostly appears on the side of older connected systems.

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?

Tricentis Tosca API ScanAccording to the Tosca 2026.1 documentation it handles REST and SOAP services, reads the contract from OData 4.0, OpenAPI 3.0, Swagger, WSDL, RAML and WADL descriptions, and supports OAuth 2.0 among other authentication methods. The scanned messages become Tosca modules and no-code test cases, so one test case can mix API and UI steps. Menus and steps in older (12.x) training material may differ; we work from the current documentation.
PlaywrightAPIRequestContext (the request fixture in tests) sends HTTP requests without a browser. It works for standalone API tests, but its real strength is in combination with UI tests: the test prepares data through the API, runs the process in the UI and verifies the result through the API again. Open source, no licence fee.
PostmanCollections, environment variables and scripted checks; convenient for exploratory API testing and for working with developers. In CI it runs from the command line: besides Newman, Postman now recommends its own Postman CLI.

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.

Certified API testingTricentis Tosca Automation Specialist for API and for Database, plus Automation Specialist and Test Design Specialist Level 1–2.
Dynamics 365 and testing in one handThe same team knows Dataverse, the plug-ins and the test tool, so the cause of a failed test is not lost between tickets.

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

Cookie settings

Choose what you consent to. We remember your choice for 6 months; change it any time via “Cookie settings” in the footer.

Privacy notice