This guide will share additional API resources for creating and testing blockchain application authentication layer. These resources might be more familiar with some users and allow the greatest flexibility and simplicity for quickly testing out and understanding these APIs.
Overview
This page will outline various other API documentation resources that are available to developers to quickly test and generate code for making these calls. They are organized slightly differently and some might seem familiar so please choose whichever resource suites the developer best! These will include Swagger, Postman, and Azure Developer Portal sites for Test and Main network.
Azure Developer Portal
The azure developer portal is a very powerful and robust portal to not only see the various API calls but to also easily test each API call right in the browser. Below are the links to the test and main network portals.
Test Network (latest version is v1.5)
https://integraledger.developer.azure-api.net/
Main Network
https://productionapis.developer.azure-api.net/
![azure_try_it_now.png 2126](https://files.readme.io/924d428-azure_try_it_now.png)
Figure 1: Click the "Try It" button to test the API calls in browser
As seen in the image above, any of the API calls can be tested simply by clicking on the "Try It" button. The best way to see a complete interaction with the blockchain is to register a value that is unique, simply grab an SHA-256 hash of a document and paste that value into the "Value" field. Once a successful result is obtained, then click on the API call ValueExists. Paste in the same value that you used above and the record that was just created will be returned. This is your first example of registering a hash and retrieving that hash on the Integra blockchain.
Figure 2: The body payload can be edited on the page before sending the request. Once complete, click the "Send" button to test the API call.
In addition to ValueExists the data can be retrieved using opt1exists, opt2exists, or opt3exists but make sure to insert unique values for each one of these fields. These collections in Azure Developer Portal can also be Grouped by Tag on the left hand panel, which will filter the API calls by "Key Management", "Register Identity", "Token Management" and "Verify Identity".
Swagger Helper API Calls
The reason for these being called "Helper" API calls is due to the calls not actually directly interacting with the blockchain, they sit on top of the calls mentioned in the previous section. These calls have to do with creating smart PDF files, smart DOCX files, Identity Smart Documents in addition to reading the metadata and verifying already created Smart Documents. Without having to know the inner workings of how a PDF or DOCX file actually stores metadata these calls allow the quick generation and reading of metadata from smart documents.
Test Network (Production)
https://integraapiproduction.azurewebsites.net/docs/
Main Network
https://integraapi.azurewebsites.net/docs/
Figure 3: Overview of the Swagger documentation of the Helper API calls.
The most important calls to understand are /pdf and /analyze. The /pdf call will create a smart document from the PDF document that is passed to the call with the JSON values that are passed along with the file. The Smart Document PDF will be returned from this call without the user having to know anything about how PDF documents store metadata or calculate the hash of a file! Using the downloaded document from /pdf call, it can be passed to the /analyze API call. This will calculate the hash of the file, check it against the blockchain, and extract the metadata if it is a valid, unaltered, file. The return format is JSON.
![swagger_try_it_now.png 2011](https://files.readme.io/65ec1e2-swagger_try_it_now.png)
Figure 4: Test any of the API calls by expanding the call and clicking the "Try it out" button shown here.
![swagger_execute_call.png 2007](https://files.readme.io/0b1e344-swagger_execute_call.png)
Figure 5: Select an Integra Smart Document PDF to test, once the file is selected then click the "Execute" button for the API call to be executed.
Figure 6: A successful response from the Swagger API call /analyze in the browser.
Postman Collection
Below is a link to the postman collection for the chaincode API calls, these are the calls that are in the Azure developer portal above or in the left hand navigation of this page with the header "Integra Ledger Base API Calls".
GitHub Repo for Postman Collection
https://github.com/IntegraLedger/Base_API_Postman