Skip to main content

1E SDK

Excercise in accessing Consumer API

Hello world example

First we'll try to determine if you can access the API by browsing to https://<MyTachyonServer>/Consumer/Information.

This endpoint doesn't require the X-Tachyon-Consumer field to be present in the request's header so can be made from a web browser.

If everything works you should see a piece of XML that will state the version of the product.

Performing this step will help you establish that everything it up and running and can be accessed via given URL.

233276518.png

Next, access the API using an API testing tool, like Postman www.getpostman.com or Telerik Fiddler https://www.telerik.com/fiddler. With Postman (shown in the picture) remember that not all versions handle Windows Authentication correctly. Please have a look at API testing tools page which discusses several tools and their configuration.

In the examples below we'll use Postman.

First, issue a GET request to https://<MyTachyonServer>/Consumer/SystemInformation

You should see something like the screenshot on the right.

This is because you didn't include X-Tachyon-Consumer in the request header.

233276516.png

Now let us add this field to the header. The example on the right is using "Explorer" as the Consumer name, but you should use the name of you Consumer.

Now when you make the request you should see something like this:

233276519.png

You might see something like this:

233276520.png

Or like this:

233276521.png

In the case of the first error above, you've reached Tachyon and it's telling you the Principal you're using is not authorized. This can mean that it has not been added to Tachyon or does not have permissions to use the endpoint being called. The error you see follows the Tachyon standard error reporting mechanism described in Handling errors returned by Tachyon.

If you get a web page back, like in the second error, it means your request has been rejected by IIS, not Tachyon. This can mean there's a problem with the credentials supplied in the request (incorrect username or password), your IIS settings or the tool you're using. It can also be because your tool does not support Windows Authentication, or because Windows Authentication is disabled. Tachyon uses Windows Authentication for API calls so your chosen tool must support it.

Payload format

Most API endpoints use application JSON data formatting for expected and returned data.

Note

Be aware that some endpoints take multi-part form-data or in a few cases return an octet stream.

Read the Swagger documentation included in the product or Consumer API reference for the details of all endpoints provided by the Consumer API.