Retrieve XML or JSON elements with the XPATH Web API

It's really easy to execute a xpath expression on an XML or JSON document using the XPATH Web API.
You only have to post a message to the Web API and specify the xpath expression you want to use.


You can use code to call the Web API but you can also use tool like Postman to test it for example.


URI
Select POST and enter: https://free.apigize.io/v1/xpath in the Request URL.

Authentication
You must authenticate every API request by including an "Ocp-Apim-Subscription-Key" header.
This header should include your API Key that has already been assigned the necessary permissions.
Click here for more information.

Content Headers
Use the Content-Type header to specify if you want to send an XML or JSON document.
Use the Accept header to specify if you want to retrieve an XML or JSON document.

XPath Expression
Use the XPath-Expression header to specify the xpath expression that select nodes or node-sets in the message.

Postman - Headers for XPATH API


Request Body
In the Body select the raw radio button and then enter the XML or JSON message that you want to use.
Click on the Send button to to execute the xpath expression on the message.

Postman - Retrieve a JSON element with XPATH API