This tutorial teaches you how to install and configure a REST client in order to call the REST API on Semarchy xDM.

What you'll learn

Before you start

This tutorial is the fourth unit within the Integration track, which is composed of SQL-based and REST-based tutorials.

The current unit is a prerequisite for the REST-based units of the Integration track:

Before following this tutorial, you must have set up Semarchy xDM and completed the Customer B2C tutorial. If you have not yet, follow the Quick Install and Demo Application tutorials from the Tutorials menu.

GO TO TUTORIALS

The estimated duration of this unit is about 15 minutes.

Enjoy this tutorial!

While it is possible to make calls to the REST API via your web browser or using a command line tool like cURL, we recommend to use a tool specialized for API development environment. This will be particularly useful for the 2 tutorial units dedicated to the REST API Query Data via the REST API and Load Data via the REST API.

Therefore, we recommend you use Postman because it is available for free, and it is easy to use. If you prefer to use another tool that your organization supports, you're welcome to do so.

Get the Postman app

To begin, download the Postman app for your platform from the Postman website:

Download POSTMAN

Once you have downloaded the application, install it.

Initialize a request

Initiate your first request in Postman:

  1. Click on the "New" button on the top left corner:

  1. Select "Request"

  1. On the next screen:

Set up authentication

Access the REST API is a task normally performed by an integration developer. As a result, we are going to use the semadmin user who has full administrative privileges to do everything in the xDM platform, including using the REST API.

To set up authorization:

  1. Click on the Authorization tab.
  2. Under Type, click the drop-down menu.
  3. Select Basic Auth.

Enter the username and password for your semarchy admin user. You will use the same credentials that you use to connect to xDM as the semadmin user.

  1. Click on the Save button.

To test your Postman configuration, you will now retrieve all the customer golden records in the Person entity from the CustomerB2CDemo data location. The template request you need is:

http://[host]:[port]/semarchy/api/rest/query/CustomerB2CDemo/Person/GD

You need to modify the request to use your host and port:

http://localhost:8088/semarchy/api/rest/query/CustomerB2CDemo/Person/GD

http://[public_IP_or_DNS]/semarchy/api/rest/query/CustomerB2CDemo/Person/GD

You can use either the public DNS address or the public IP address. We will proceed with the IP address in future examples in this tutorial.

To test your credentials:

  1. Check the request is using the GET method.
  2. Enter the customized request URL (modified for your environment) in the Request field.

  1. Click Send.
  2. If you have correctly set up the authorization with your credentials, then you should see results returned. These are all the golden customer records returned in JSON format.

Great job! You successfully configured a REST client and sent a first request via the REST API.

What's next?

In the next part of the Integration tutorial track, you will learn how to query data in xDM via the REST API: you will perform basic queries and learn about setting up and using named queries.

Thanks for going through this tutorial.