Retrieve XML or JSON elements with the Apigize XPATH REST API

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 XPATH Web API and specify the xpath expression you want to use.


In the following example is Postman used to retrieve XML or JSON elements but you can also use other tools or languages.

Request URL
Select POST and enter: in the Request URL.

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