David JonesSEMARCHY TEAM
Technical Client Success Manager at Semarchy
Asked a question 10 months ago

What tools can be used for troubleshooting REST API's?


David JonesSEMARCHY TEAM
Technical Client Success Manager at Semarchy

The first and best tool to start with is the existing documentation.

Native Resources

Leveraging the existing Semarchy documentation within your API-related project will help create a solid foundation for understanding the available tools, architecture, and implementation patterns. Refer to our official documentation for the most accurate details on using Semarchy REST API's. 

1. Semarchy xDM Integration Guide contains thorough documentation on our REST client, including an Overview section as well as complete examples. 

2.Semarchy xDM Administration Guide contains extensive details on Managing REST Clients.

3. Within the application, select REST API to access in-application resources, the Documentation section loads by default.

Click on REST API
Click on REST API

4. Click on Getting Started to see additional menu options.

Getting Started Menu
Getting Started Menu

Selecting one of the menu options enables the user to download OpenAPI specifications for the selected object, as well as access fully-functional context-based API examples.

What tools can be used for troubleshooting REST API's?

5. Use the REST Client Validate and Testoptions

Use the built-in testing solution by selecting Test from a configured REST Client.

What tools can be used for troubleshooting REST API's?

Match the displayed errorId to the Semarchy Error Log.

Use built-in REST Client Test
Use built-in REST Client Test
Error - No data location with name (XYZ..) exists
Error - No data location with name (XYZ..) exists

Secondary tools and use-cases

1. Postman

Postman is a great tool for troubleshooting syntax, connection access, performance, and others. The examples below show validation results for successful, and unsuccessful GET operations. 

Postman - Get Operation - Query Single Record - Status 200 OK
Postman - Get Operation - Query Single Record - Status 200 OK

On failures, review matching error in Semarchy Error Log.

Postman - Get Operation - Query Single Record - Status 500 Internal Server Error
Postman - Get Operation - Query Single Record - Status 500 Internal Server Error
Semarchy Error Log
Semarchy Error Log
Semarchy Error Log Details
Semarchy Error Log Details

In the example below, we use Postman to validate the POST URLBody(payload), Status, and (return)Body

Postman - Validate URL, Body and Status
Postman - Validate URL, Body and Status

2. Using Jayway JsonPath Evaluator

Jayway is a simple, web-based path evaluator. 

The example below illustrates a scenario in which the Response Output is configured as surrounded/encapsulated by unnecessary quotation marks. 

Improperly-configured Response Output
Improperly-configured Response Output

Entering the specific values into Jayway, we can see that "Content" is an invalid path. 

Jayway - "Content" is an invalid JSON Path
Jayway - "Content" is an invalid JSON Path

3. Using JSON Path Finder

JSON Path Finder is very useful in scenarios where a need exists to identify a valid JSON Path. Using the example above, once the path has been confirmed to be inaccurate, find the correct value using JSON Path Finder. The illustration below shows incorrect JSON being entered on the left, and the correct path highlighted on the right. The correct path is Content, vs "Content".

JSON Path Finder - returns correct JSON path
JSON Path Finder - returns correct JSON path