Web services integration

This article gives a overview of the Web Services provided by the SAFE X3 platform.

The SAFE X3 platform is fundamentally a service-oriented platform. The applicative modules expose either a Web API (RESTful services) or more traditional SOAP web services that you can call from any language.

This article gives an overview of the Web Services supported by the platform and it gives pointers to articles that illustrate the various Web Services scenarios through small examples.

Web API and SOAP services

SAFE X3 Web Services come in two flavors:

The applicative modules of Sage X3 are undergoing a progressive upgrade from a classic implementation based on masks, screens and windows to a new service oriented implementation based on classes and representations. So the flavor of web service that you should use for a given applicative module depends on whether the module has been upgraded or not. The general rule is the following:

SOAP services have been available since V6 and have their own documentation. This guide does not give detailed documentation on them. Instead, it focuses on the Web API and on common mechanisms such as authentication.

Authentication

Web Service calls can be authenticated with a username and password (basic authentication), with a certificate or with OAuth2 tokens. The following articles describe how to use these authentication methods:

SData 2.0

The SAFE X3 Web API is based on SData 2.0, a RESTful protocol specification published by Sage.

There are a few differences between this Web API and the SData protocol. They are summarized in this article.

Testing interactively

Web API calls are usually issued by programs but, as they are just HTTP requests they can also be tested interactively, directly in the browser, or better, with a tool like Postman.

If you test the URL with your browser you will be redirected to the login page first. After login you will get the result of your query.

If you test with a tool like Postman you will need to add an HTTP `Autorization` header to your request. An easy way to start is to configure [basic authentication](../integration-guide/ws-basic-authentication.md). If you have installed node.js on your machine you can obtain this header with:
CODECODE CODEshnode -e "console.log('Basic ' + new Buffer('user:password').toString('base64'))"
where `user` and `password` are the user and password that you have configured for web services. This will print something like:
Basic dXNlcjpwYXNzd29yZA==

Using the Web API

The following articles cover various usage scenarios around the Web API:

Links