# SAP ALGORAND API

## Technical Documentation

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

Table of content

Table of content 2

1. SAP API Management 3
   1.1 Introduction 3
   1.2 High-level architecture 4
2. Accessing SAP API Management 7
   2.1 Accessing SAP API Portal 7
   2.2 Accessing SAP API Developer Portal 14
   2.2.1 Working on Cloud Platform 14
   2.2.2 Working on independent IDE applications 19
   Appendix 21
   Swagger File for Mainnet 21
   Code Snippet 51
   Javascript 51
   JAVA 52
   Swift 54
   Curl 55
   SAPUI5 55
   ABAP 56
   SAP Cloud Platform ABAP 58

* * *

# 1\. SAP API Management

## 1.1 Introduction

### SAP Cloud Platform API Management provides simple, scalable and secure access to digital assets through

### application programming interfaces (APIs) and enables developer communities to consume these.

It is intended to complement the SAP API Business Hub in terms of providing secure managed governance to API consumption.

### Highlights of API Management

- Best of breed engine with streamlined admin and developer experience in SAP Cloud Platform
- Increased productivity with to OData • Agnostic REST/OData or SOAP services management
- Enterprise Grade Security for the APIs against attacks like DoS, CSRF, XSS etc. and robust traffic management
- Secure connection to on-premise systems with Cloud connector
- Integration with SAP Cloud Platform services such as SAP API Business Hub, mobile service, WebIDE, Leonardo IoT etc.
- Platform for engaging with, and enabling employees and developers – internal and external
- Real-time insights & analytics on the APIs traffic, usage, error reporting and monitoring
  SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

1.2 High-level architecture

From a high-level perspective, SAP API Management is divided in 2 main areas: designing APIs through the
API Portal, and providing APIs through the Developer Portal.

Within the API Portal, the API Builder can abstract an existing API or SOAP WebService (through the façade
pattern) using so called “API proxies”. The API proxy should be the only access point to the actual API
implementation, hiding internal information and providing specific behaviours that would otherwise be coded
in the API itself, such as Security, Traffic Management or Data Transformation.
Having these features deported in an API Management layer will free up valuable development time for the
API developers focusing on business features more than technical features.

In API Portal the API Owner can:

• Create and manage API Providers

• Create and manage API Proxies

• Create and manage Products

• Analyze the usage of APIs

• Create and manage rate plans

In the following figure you can see how an API in SAP API Management is consumed.

SAP API Architecture Figure 1.2

* * *

# API Proxy allows for: - Hiding internal implementation information

- Versioning-Security, Traffic Management, Transformation
- Documentation-Usage analytics
- Technical analytics

# Policy: - Pre-defined, configurable behavior

- Used in the Policy Editor, and positioned on the request or response-Preconfigured for:
- Security-Traffic Management
- Message transformation-Caching

# Product:

- Logical bundle of APIs-Can be configured with Quota
- Developers subscribe to API Products in the Developer Portal

# Within the self-service Developer Portal, Developers can discover APIs, see their documentation, test them

and eventually subscribe to them as needed. The Developer Portal is tightly integrated with the API Portal

# providing a streamlined process to publish APIs.

Having a self-service Developer Portal for App or Integration Developers will simplify usage of APIs and increase Developer Experience. Once the APIs are being used by applications, apps, systems or by partners, they can be analysed from a

# technical and from a business perspective.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

SAP API Management High Level Architecture Figure 1.3

SAP API Management High Level Architecture Figure 1.4

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# 2\. Accessing SAP API Management

## 2.1 Accessing SAP API Portal

### You can access SAP API Portal by following the URL: [https://acdomain1.apiportal.cfapps.us10.hana.ondemand.com/](https://acdomain1.apiportal.cfapps.us10.hana.ondemand.com/)

### In figure 2.1, enter your SAP credentials.

Entering Credentials Figure 2.1

API Portal Home Page Figure 2.2

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

In API Portal homepage, you can see basic statistics regarding monitoring information, and activities of your deployed APIs. Besides Home Page, API Portal Menu has other sections: • Discover: Search SAP’s deployed APIs of its product ecosystem

- Develop: Create APIs, products which consume the API, and Policy templates
- Configure: Configure API Providers, Certificates and Key Value Maps • Monetize: Create Rate Plans and view the generated Bills
- Analyze: Discover the highlights and information related to various APIs • Test Console: Test your APIs

# In figure 2.3 you can see the Discover Section of the API Portal Menu.

API Portal Discover Section Figure 2.3 Let us try and see how to API is created. Please select ‘Discover’ as shown in figure 2.4.

# If you click on API: ‘SAP\_Algorand\_Mainnet’ you can find more information for this particular API.

This is the API interacting with Mainnet. If you would like to work on Testnet, please use API ‘SAP\_Algorand\_Testnet’.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

## API Portal Develop Section Figure 2.4

## SAP\_Algorand\_Mainnet API Overview Figure 2.5

We are first presented with an Overview properties tab where there is general information and description of

# the API. Other than Overview there are some other properties:

- Proxy End Point: It defines the way (or URL) for the consumer application to access the API. It also determines whether API is accessed over HTTP or HTTPS. Standard policies are attached to the proxy end point only to enforce security, access limit etc.
- Target End Point: It defines the way proxy interacts with the backend services. It is configured to forward request to the proper backend service, including any security settings (HTTP or HTTPS protocol) and other connection information. Policies can also be attached to the target endpoint to ensure that response messages are properly formatted.
- Resources: An API resource is a URI path fragment that identifies some entity that developers can access by calling the API. •
  SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# In ‘Target Endpoint’ you can find the URL where the API is based on.

SAP\_Algorand\_Mainnet API Target Endpoint Figure 2.6

# The API URL for Mainnet as shown above is: [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/sapalgo/mainnet/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/sapalgo/mainnet/)

# The URL for Testnet is: [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/sapalgo/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/sapalgo/)

# In ‘Resources’ tab you can find all resources of the API.

SAP\_Algorand\_Mainnet API Resources Figure 2.7

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# The resources for the API were created in API Designer.

They were created in OpenAPI specification. The complete swagger file can be found in the appendix.

# In figures 2.8 and 2.9 you can see how API Designer is accessed.

## SAP\_Algorand\_Mainnet Open API Designer Figure 2.8

SAP\_Algorand\_Mainnet API Designer Figure 2.9 Back in ‘Develop’ section as shown in figure 2.10, tab ‘Products’ shows the products published related to the APIs.

# If you click on ‘SAP\_Algorand\_Mainnet’ you can see that the aforementioned API has been consumed.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

Develop Section: Products Figure 2.10

SAP\_Algorand\_Mainnet Product Figure 2.11

We will return to the ‘SAP\_Algorand\_Mainnet’ product, later on the document, when we access SAP API Developer Portal.

# In ‘Analyze’ section you can see charts regarding the API performance and errors.

API Analytics Figure 2.12

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# In ‘Test’ section, you can test the resources and get a response from the API.

API Test Console Figure 2.13

After you select the resource you want to try, click on Send as shown in the below Figure.

API Test Console:Response Figure 2.14

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# 2.2 Accessing SAP API Developer Portal

## 2.2.1 Working on Cloud Platform

### In order to access API Developer Portal, please click on the following URL: [https://acdomain1.devportal.cfapps.us10.hana.ondemand.com/](https://acdomain1.devportal.cfapps.us10.hana.ondemand.com/)

### In figure 2.15, enter your SAP credentials.

#### Entering Credentials Figure 2.15

To access the specific Algorand API Product, please click on ‘SAP Algorand Mainnet Integration’ as presented in figure 2.16.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

SAP Developer Portal: Home Page Figure 2.16

## SAP Algorand API Product Figure 2.17

# In figure 2.17 you can see the API Product. There are three different tabs:

- APIs: where you can see the API which has been
- Rate Plan: in case a rate plan has been created • Details: Description and information regarding the Product
  SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

SAP Algorand API Product: Details Figure 2.18

In order to access the API, click on ‘SAP Algorand Mainnet API’ in ‘APIs’ tab as shown in figure 2.19.

## SAP Algorand API Figure 2.19

# After you click on the API, you can find all the resources available.

You can try out a resource to get the response as shown in the following figure.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

SAP Algorand API: Try out Resource Figure 2.20

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# In tab ‘Details’ you can see information regarding the API.

SAP Algorand API: Details Tab Figure 2.21

In Developer Portal, there is a Test Console similar to the one in API Portal. It can be found on top of the

# page. You can try out any resource available.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

SAP Developer Portal: Test Console Figure 2.22

# 2.2.2 Working on independent IDE applications

In Developer portal, after you have selected an API as shown in figure 2.19 and by selecting tab ‘Details’, you can generate the client SDK for an API package containing REST or OData APIs. The generated client SDK can be imported into any JAVA-based IDE application (for example, eclipse) to consume the APIs.

## You can generate a client SDK for an API by choosing Download SDK.

SAP Algorand API: Download SDK Figure 2.23 SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

You can use the code generation function to generate a template code in a programming language of your

# choice (such as JavaScript, Java, Swift, Curl, ABAP, or SAPUI5) to interact with the APIs.

SAP Algorand API: Code Snippet Figure 2.24

# Samples of the code generated can be found in the appendix.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# Appendix

## Swagger File for Mainnet

{ "consumes": \[ "application/json" \], "produces": \[ "application/json" \], "schemes": \[ "https" \], "swagger": "2.0", "info": { "description": "SAP integration enabling sophisticated application development on top of the Algorand's pure Proof of Stake blockchain platform. The API gives the interoperability between SAP enterprise applications and the distributed ledger", "title": "Algorand Mainnet", "contact": { "email": " [solutions@alphacons.gr](mailto:solutions@alphacons.gr)" }, "version": "1.0" }, "x-sap-stateInfo": { "state": "Active" }, "x-sap-shortText": "Blockchain Mainnet Endpoint for integration with SAP.", "securityDefinitions": { "apikeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-Key" } }, "security": \[{ "apikeyAuth": \[\] }\],

"x-servers": \[{ "url": "https://{host}.{region}.hana.ondemand.com/{basepath}", "description": "SAP integration enabling sophisticated application development on top of the Algorand platform", "templates": {\
\
"host": { "default": "acdevapi1.prod.apimanagement", "description": "hostname of the end point" }, "region": { "default": "us10", "description": "The SAP region where the SAP APIs are used." },\
\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
* * *\
\
"basepath": {\
"default": "sapalgo/mainnet/",\
"description": "Basepath of the API endpoint"\
}\
}\
}\],
"host": "hostname",
"basePath": "/sapalgo/",
"paths": {
"/health": {
"get": {
"tags": \[\
"Common"\
\],
"produces": \[\
"application/json"\
\],
"summary": "Returns OK if healthy.",
"operationId": "HealthCheck",
"responses": {
"200": {
"description": "The node is running."
},
"default": {
"description": "Unknown Error"
}
},
"description": "

Get node health

"
 }
 },
 "/metrics": {
 "get": {
 "tags": \[\
 "Common"\
 \],
 "produces": \[\
 "text/plain"\
 \],
 "summary": "Returns API metrics.",
 "operationId": "Metrics",
 "responses": {
 "200": {
 "description": "Response contains metrics about
algod"
 },
 "404": {
 "description": "metrics were compiled out"
 }
 },
 "description": "Returns metrics about algod functioning"
 }
 },
 "/v2/accounts/{address}": {
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"get": { "description": "Given a specific account public key, this call returns the accounts status, balance and spendable amounts", "tags": \[ "Account" \], "produces": \[ "application/json" \], "summary": "Get account information.", "operationId": "AccountInformation", "parameters": \[{ "pattern": "\[A-Z0-9\]{58}", "type": "string", "description": "An account public key", "name": "address", "in": "path", "required": true }\], "responses": { "200": { "$ref": "#/responses/AccountResponse" }, "400": { "description": "Malformed address", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } } } }, "/v2/accounts/{address}/transactions/pending": { "get": { "description": "Get the list of pending transactions by address, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.", "tags": \[ "Account", "Transaction" \], "produces": \[ "application/json", "application/msgpack" \], "summary": "Get a list of unconfirmed transactions currently in the transaction pool by address.",

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"operationId": "GetPendingTransactionsByAddress", "parameters": \[{ "pattern": "\[A-Z0-9\]{58}", "type": "string", "description": "An account public key", "name": "address", "in": "path", "required": true }, { "$ref": "#/parameters/max" }, { "$ref": "#/parameters/format" } \], "responses": { "200": { "$ref": "#/responses/PendingTransactionsResponse" }, "400": { "description": "Max must be a non-negative integer", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Service Temporarily Unavailable", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } } } }, "/v2/blocks/{round}": { "get": { "tags": \[ "Block" \], "produces": \[ "application/json", "application/msgpack" \], "summary": "Get the block for the given round.",

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"operationId": "GetBlock", "parameters": \[{ "minimum": 0, "type": "integer", "description": "The round from which to fetch block information.", "name": "round", "in": "path", "required": true }, { "$ref": "#/parameters/format" } \], "responses": { "200": { "$ref": "#/responses/BlockResponse" }, "400": { "description": "Bad Request-Non integer number", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "404": { "description": "None existing block", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } }, "description": "

Returns block information for the selected round.

" } }, "/v2/ledger/supply": { "get": { "tags": \[ "Node" \], "produces": \[ "application/json" \], "summary": "Get the current supply reported by the ledger.", "operationId": "GetSupply", "responses": { "200": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"$ref": "#/responses/SupplyResponse"
},
"default": {
"description": "Unknown Error"
}
},
"description": "

Returns the supply reported by the ledger at the current time.

"
 }
 },
 "/v2/status": {
 "get": {
 "tags": \[\
 "Node"\
 \],
 "produces": \[\
 "application/json"\
 \],
 "summary": "Gets the current node status.",
 "operationId": "GetStatus",
 "responses": {
 "200": {
 "description": "The response returns the current
node status.",
 "schema": {
 "type": "string"
 }
 },
 "500": {
 "description": "Internal Error",
 "schema": {
 "type": "string"
 }
 },
 "default": {
 "description": "Unknown Error"
 }
 },
 "description": "

Returns the status of the node at the current time.

"
 }
 },
 "/v2/status/wait-for-block-after/{round}": {
 "get": {
 "tags": \[\
 "Block",\
 "Node"\
 \],
 "description": "Waits for a block to appear after round {round} and returns the node's status
at the time.",
 "produces": \[\
 "application/json"\
 \],
 "summary": "Gets the node status after waiting for the given round.",
 "operationId": "WaitForBlock",
 "parameters": \[{\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
* * *\
\
"minimum": 0,\
"type": "integer",\
"description": "The round to wait until returning status",\
"name": "round",\
"in": "path",\
"required": true\
}\],
"responses": {
"200": {
"description": "Returns node's status after waiting
for a block to appear after selected round",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"400": {
"description": "Bad Request -- number must be non-negative integer",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"503": {
"description": "Service Temporarily Unavailable",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Unknown Error"
}
}
}
},
"/v2/transactions": {
"post": {
"tags": \[\
"Transaction"\
\],
"consumes": \[\
"application/x-binary"\
\],
"produces": \[\
"application/json"\
\],
"summary": "Broadcasts a raw transaction to the network.",
"operationId": "RawTransaction",
"parameters": \[{\
"description": "The byte encoded signed transaction to broadcast to network",\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
* * *\
\
"name": "rawtxn", "in": "body", "required": true, "schema": { "type": "string", "format": "binary" } }\], "responses": { "200": { "$ref": "#/responses/PostTransactionsResponse" }, "400": { "description": "Bad Request-Malformed Algorand transaction", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Service Temporarily Unavailable", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } }, "description": "

Our SAP Integration API is based on the Algod API. The Algod API can be used for querying information from the blockchain, getting information about blocks and transactions, and sending transactions via the SAP Cloud Platform or S/4 HANA Systems. The KMD API, by contrast, is used for wallet management, key management, and signing transactions with private keys. Due to the privacy of such information, in case you would like to use the Key Management Demon API please contact us at <a href="mailto: [solutions@alphacons.gr](mailto:solutions@alphacons.gr)" rel="nofollow"> [solutions@alphacons.gr](mailto:solutions@alphacons.gr).

" } }, "/v2/transactions/params": { "get": { "tags": \[ "Transaction" \], "produces": \[ "application/json" \], "summary": "Get parameters for constructing a new transaction", "operationId": "TransactionParams", "responses": { "200": { "$ref": "#/responses/TransactionParametersResponse"

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

}, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Service Temporarily Unavailable", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } }, "description": "

Get all the required parameters for constructing a new transaction and posting it to the blockchain

" } }, "/v2/transactions/pending": { "get": { "description": "Get the list of pending transactions, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.", "tags": \[ "Transaction" \], "produces": \[ "application/json", "application/msgpack" \], "summary": "Get a list of unconfirmed transactions currently in the transaction pool.", "operationId": "GetPendingTransactions", "parameters": \[{ "$ref": "#/parameters/max" }, { "$ref": "#/parameters/format" } \], "responses": { "200": { "$ref": "#/responses/PendingTransactionsResponse" }, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Service Temporarily Unavailable", "schema": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } } } }, "/v2/transactions/pending/{txid}": { "get": { "description": "Given a transaction id of a recently submitted transaction, it returns information about it. There are several cases when this might succeed: - transaction committed (committed round > 0) - transaction still in the pool (committed round = 0, pool error = "") - transaction removed from pool due to error (committed round = 0, pool error != "") Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.", "tags": \[ "Transaction" \], "produces": \[ "application/json" \], "summary": "Get a specific pending transaction.", "operationId": "PendingTransactionInformation", "parameters": \[{ "pattern": "\[A-Z0-9\]+", "type": "string", "description": "A transaction id", "name": "txid", "in": "path", "required": true }, { "$ref": "#/parameters/format" } \], "responses": { "200": { "$ref": "#/responses/PendingTransactionResponse" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "404": { "description": "Transaction Not Found", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" }

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

} } }, "/v2/teal/compile": { "post": { "description": "Given TEAL source code in plain text, return base64 encoded program bytes and base32 SHA512\_256 hash of program bytes (Address style).", "tags": \[ "Teal" \], "consumes": \[ "text/plain" \], "produces": \[ "application/json" \], "summary": "Compile TEAL source code to binary, produce its hash", "operationId": "TealCompile", "parameters": \[{ "description": "TEAL source code to be compiled", "name": "source", "in": "body", "required": true, "schema": { "type": "string", "format": "binary" } }\], "responses": { "200": { "$ref": "#/responses/CompileResponse" }, "400": { "description": "Bad Request-Teal Compile Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal Error", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Unknown Error" } } } } }, "definitions": { "Account": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"description": "Account information at a given round. Definition: data/basics/userBalance.go : AccountData", "type": "object", "required": \[ "round", "address", "amount", "pending-rewards", "amount-without-pending-rewards", "rewards", "status" \], "properties": { "address": { "description": "the account public key", "type": "string" }, "amount": { "description": "\\\[algo\\\] total number of MicroAlgos in the account", "type": "integer" }, "amount-without-pending-rewards": { "description": "specifies the amount of MicroAlgos in the account, without the pending rewards.", "type": "integer" }, "apps-local-state": { "description": "\\\[appl\\\] applications local data stored in this account. Note the raw object uses `map[int] -&gt; AppLocalState` for this type.", "type": "array", "items": { "$ref": "#/definitions/ApplicationLocalState" } }, "apps-total-schema": { "description": "\\\[tsch\\\] stores the sum of all of the local schemas and global schemas in this account. Note: the raw account uses `StateSchema` for this type.", "$ref": "#/definitions/ApplicationStateSchema" }, "assets": { "description": "\\\[asset\\\] assets held by this account. Note the raw object uses `map[int] -&gt; AssetHolding` for this type.", "type": "array", "items": { "$ref": "#/definitions/AssetHolding" } }, "created-apps": { "description": "\\\[appp\\\] parameters of applications created by this account including app global data. Note: the raw account uses `map[int] -&gt; AppParams` for this type.", "type": "array", "items": { "$ref": "#/definitions/Application" } }, "created-assets": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"description": "\\\[apar\\\] parameters of assets created by this account. Note: the raw account uses `map[int] -&gt; Asset` for this type.", "type": "array", "items": { "$ref": "#/definitions/Asset" } }, "participation": { "$ref": "#/definitions/AccountParticipation" }, "pending-rewards": { "description": "amount of MicroAlgos of pending rewards in this account.", "type": "integer" }, "reward-base": { "description": "\\\[ebase\\\] used as part of the rewards computation. Only applicable to accounts which are participating.", "type": "integer" }, "rewards": { "description": "\\\[ern\\\] total rewards of MicroAlgos the account has received, including pending rewards.", "type": "integer" }, "round": { "description": "The round for which this information is relevant.", "type": "integer" }, "status": { "description": "\\\[onl\\\] delegation status of the account's MicroAlgos \* Offline-indicates that the associated account is delegated. \* Online-indicates that the associated account used as part of the delegation pool. \* NotParticipating-indicates that the associated account is neither a delegator nor a delegate.", "type": "string" }, "sig-type": { "description": "Indicates what type of signature is used by this account, must be one of:

- sig \* msig \* lsig", "type": "string", "enum": \[ "sig", "msig", "lsig" \] }, "auth-addr": { "description": "\\\[spend\\\] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field.", "type": "string", "x-algorand-format": "Address" } } }, "AccountParticipation": { "description": "AccountParticipation describes the parameters used by this account in consensus protocol.",
  SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"type": "object", "required": \[ "vote-participation-key", "selection-participation-key", "vote-first-valid", "vote-last-valid", "vote-key-dilution" \], "properties": { "selection-participation-key": { "description": "\\\[sel\\\] Selection public key (if any) currently registered for this round.", "type": "string", "format": "byte" }, "vote-first-valid": { "description": "\\\[voteFst\\\] First round for which this participation is valid.", "type": "integer" }, "vote-key-dilution": { "description": "\\\[voteKD\\\] Number of subkeys in each batch of participation keys.", "type": "integer" }, "vote-last-valid": { "description": "\\\[voteLst\\\] Last round for which this participation is valid.", "type": "integer" }, "vote-participation-key": { "description": "\\\[vote\\\] root participation public key (if any) currently registered for this round.", "type": "string", "format": "byte" } } }, "Asset": { "description": "Specifies both the unique identifier and the parameters for an asset", "type": "object", "required": \[ "index", "params" \], "properties": { "index": { "description": "unique asset identifier", "type": "integer" }, "params": { "$ref": "#/definitions/AssetParams" } } }, "AssetHolding": { "description": "Describes an asset held by an account. Definition: data/basics/userBalance.go : AssetHolding",

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"type": "object", "required": \[ "asset-id", "creator", "amount", "is-frozen" \], "properties": { "amount": { "description": "\\\[a\\\] number of units held.", "type": "integer", "x-algorand-format": "uint64" }, "asset-id": { "description": "Asset ID of the holding.", "type": "integer", "x-go-name": "AssetID" }, "creator": { "description": "Address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.", "type": "string" }, "is-frozen": { "description": "\\\[f\\\] whether or not the holding is frozen.", "type": "boolean" } } }, "AssetParams": { "description": "AssetParams specifies the parameters for an asset. \\\[apar\\\] when part of an AssetConfig transaction. Definition: data/transactions/asset.go : AssetParams", "type": "object", "required": \[ "creator", "total", "decimals" \], "properties": { "clawback": { "description": "\\\[c\\\] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted.", "type": "string" }, "creator": { "description": "The address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.", "type": "string" }, "decimals": { "description": "\\\[dc\\\] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive).", "type": "integer", "maximum": 19,

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"minimum": 0 }, "default-frozen": { "description": "\\\[df\\\] Whether holdings of this asset are frozen by default.", "type": "boolean" }, "freeze": { "description": "\\\[f\\\] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted.", "type": "string" }, "manager": { "description": "\\\[m\\\] Address of account used to manage the keys of this asset and to destroy it.", "type": "string" }, "metadata-hash": { "description": "\\\[am\\\] A commitment to some unspecified asset metadata. The format of this metadata is up to the application.", "type": "string", "format": "byte" }, "name": { "description": "\\\[an\\\] Name of this asset, as supplied by the creator.", "type": "string" }, "reserve": { "description": "\\\[r\\\] Address of account holding reserve (non-minted) units of this asset.", "type": "string" }, "total": { "description": "\\\[t\\\] The total number of units of this asset.", "type": "integer", "x-algorand-format": "uint64" }, "unit-name": { "description": "\\\[un\\\] Name of a unit of this asset, as supplied by the creator.", "type": "string" }, "url": { "description": "\\\[au\\\] URL where more information about the asset can be retrieved.", "type": "string" } } }, "ApplicationStateSchema": { "description": "Specifies maximums on the number of each type that may be stored.", "type": "object", "required": \[ "num-uint", "num-byte-slice" \], "properties": { "num-uint": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"description": "\\\[nui\\\] num of uints.", "type": "integer" }, "num-byte-slice": { "description": "\\\[nbs\\\] num of byte slices.", "type": "integer" } } }, "ApplicationLocalState": { "description": "Stores local state associated with an application.", "type": "object", "required": \[ "id", "schema", "key-value" \], "properties": { "id": { "description": "The application which this local state is for.", "type": "integer" }, "schema": { "description": "\\\[hsch\\\] schema.", "$ref": "#/definitions/ApplicationStateSchema" }, "key-value": { "description": "\\\[tkv\\\] storage.", "$ref": "#/definitions/TealKeyValueStore" } } }, "TealKeyValueStore": { "description": "Represents a key-value store for use in an application.", "type": "array", "items": { "$ref": "#/definitions/TealKeyValue" } }, "TealKeyValue": { "description": "Represents a key-value pair in an application store.", "type": "object", "required": \[ "key", "value" \], "properties": { "key": { "type": "string" }, "value": { "$ref": "#/definitions/TealValue" } }

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

}, "TealValue": { "description": "Represents a TEAL value.", "type": "object", "required": \[ "type", "uint", "bytes" \], "properties": { "type": { "description": "\\\[tt\\\] value type.", "type": "integer" }, "bytes": { "description": "\\\[tb\\\] bytes value.", "type": "string" }, "uint": { "description": "\\\[ui\\\] uint value.", "type": "integer", "x-algorand-format": "uint64" } } }, "StateDelta": { "description": "Application state delta.", "type": "array", "items": { "$ref": "#/definitions/EvalDeltaKeyValue" } }, "AccountStateDelta": { "description": "Application state delta.", "type": "object", "required": \[ "address", "delta" \], "properties": { "address": { "type": "string" }, "delta": { "$ref": "#/definitions/StateDelta" } } }, "EvalDeltaKeyValue": { "description": "Key-value pairs for StateDelta.", "type": "object", "required": \[ "key", "value"\
\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
* * *\
\
\], "properties": { "key": { "type": "string" }, "value": { "$ref": "#/definitions/EvalDelta" } } }, "EvalDelta": { "description": "Represents a TEAL value delta.", "type": "object", "required": \[ "action" \], "properties": { "action": { "description": "\\\[at\\\] delta action.", "type": "integer" }, "bytes": { "description": "\\\[bs\\\] bytes value.", "type": "string" }, "uint": { "description": "\\\[ui\\\] uint value.", "type": "integer", "x-algorand-format": "uint64" } } }, "Application": { "description": "Application index and its parameters", "type": "object", "required": \[ "id", "params" \], "properties": { "id": { "description": "\\\[appidx\\\] application index.", "type": "integer" }, "params": { "description": "\\\[appparams\\\] application parameters.", "$ref": "#/definitions/ApplicationParams" } } }, "ApplicationParams": { "description": "Stores the global information associated with an application.", "type": "object", "required": \[\
\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
* * *\
\
"creator", "approval-program", "clear-state-program" \], "properties": { "creator": { "description": "The address that created this application. This is the address where the parameters and global state for this application can be found.", "type": "string", "x-algorand-format": "Address" }, "approval-program": { "description": "\\\[approv\\\] approval program.", "type": "string", "format": "byte" }, "clear-state-program": { "description": "\\\[clearp\\\] approval program.", "type": "string", "format": "byte" }, "local-state-schema": { "description": "\[\\lsch\\\] local schema", "$ref": "#/definitions/ApplicationStateSchema" }, "global-state-schema": { "description": "\[\\lsch\\\] global schema", "$ref": "#/definitions/ApplicationStateSchema" }, "global-state": { "description": "\[\\gs\\\] global schema", "$ref": "#/definitions/TealKeyValueStore" } } }, "ErrorResponse": { "description": "An error response with optional data field.", "type": "object", "required": \[ "message" \], "properties": { "data": { "type": "string" }, "message": { "type": "string" } } }, "Version": { "description": "Note that we annotate this as a model so that legacy clients can directly import a swagger generated Version model.", "type": "object",

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"required": \[ "build", "genesis-hash", "genesis-id", "versions" \], "properties": { "build": { "$ref": "#/definitions/VersionBuild" }, "genesis-hash": { "type": "string", "format": "byte" }, "genesis-id": { "type": "string" }, "versions": { "type": "array", "items": { "type": "string" } } }, "x-go-package": "github.com/algorand/go-algorand/daemon/algod/api/spec/common" }, "VersionBuild": { "description": "the current algod build version information.", "type": "object", "required": \[ "branch", "build-number", "channel", "commit-hash", "major", "minor" \], "properties": { "branch": { "type": "string" }, "build-number": { "type": "integer" }, "channel": { "type": "string" }, "commit-hash": { "type": "string", "format": "byte" }, "major": { "type": "integer" },

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"minor": { "type": "integer" } } } }, "parameters": { "account-id": { "type": "string", "x-go-name": "AccountID", "description": "account string", "name": "account-id", "in": "path", "required": true }, "address": { "type": "string", "description": "Only include transactions with this address in one of the transaction fields.", "name": "address", "in": "query" }, "address-role": { "enum": \[ "sender", "receiver", "freeze-target" \], "type": "string", "description": "Combine with the address parameter to define what type of address to search for.", "name": "address-role", "in": "query" }, "after-time": { "type": "string", "format": "date-time", "x-algorand-format": "RFC3339 String", "description": "Include results after the given time. Must be an RFC 3339 formatted string.", "name": "after-time", "in": "query" }, "asset-id": { "type": "integer", "x-go-name": "AssetID", "description": "Asset ID", "name": "asset-id", "in": "query" }, "before-time": { "type": "string", "format": "date-time", "x-algorand-format": "RFC3339 String", "description": "Include results before the given time. Must be an RFC 3339 formatted string.", "name": "before-time",

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"in": "query" }, "currency-greater-than": { "type": "integer", "description": "Results should have an amount greater than this value. MicroAlgos are the default currency unless an asset-id is provided, in which case the asset will be used.", "name": "currency-greater-than", "in": "query" }, "currency-less-than": { "type": "integer", "description": "Results should have an amount less than this value. MicroAlgos are the default currency unless an asset-id is provided, in which case the asset will be used.", "name": "currency-less-than", "in": "query" }, "exclude-close-to": { "type": "boolean", "description": "Combine with address and address-role parameters to define what type of address to search for. The close to fields are normally treated as a receiver, if you would like to exclude them set this parameter to true.", "name": "exclude-close-to", "in": "query" }, "format": { "enum": \[ "json", "msgpack" \], "type": "string", "description": "Configures whether the response object is JSON or MessagePack encoded.", "name": "format", "in": "query" }, "limit": { "type": "integer", "description": "Maximum number of results to return.", "name": "limit", "in": "query" }, "max": { "type": "integer", "description": "Truncated number of transactions to display. If max=0, returns all pending txns.", "name": "max", "in": "query" }, "max-round": { "type": "integer", "description": "Include results at or before the specified max-round.", "name": "max-round", "in": "query" }, "min-round": { "type": "integer",

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"description": "Include results at or after the specified min-round.", "name": "min-round", "in": "query" }, "next": { "type": "string", "description": "The next page of results. Use the next token provided by the previous results.", "name": "next", "in": "query" }, "note-prefix": { "type": "string", "description": "Specifies a prefix which must be contained in the note field.", "name": "note-prefix", "in": "query", "x-algorand-format": "base64" }, "round": { "type": "integer", "description": "Include results for the specified round.", "name": "round", "in": "query" }, "round-number": { "type": "integer", "description": "Round number", "name": "round-number", "in": "path", "required": true }, "sig-type": { "enum": \[ "sig", "msig", "lsig" \], "type": "string", "description": "SigType filters just results using the specified type of signature: \* sig-Standard \* msig-MultiSig \* lsig-LogicSig", "name": "sig-type", "in": "query" }, "tx-id": { "type": "string", "x-algorand-format": "Address", "x-go-name": "TxID", "description": "Lookup the specific transaction by ID.", "name": "tx-id", "in": "query" }, "tx-type": { "enum": \[ "pay", "keyreg",\
\
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0\
\
* * *\
\
"acfg", "axfer", "afrz" \], "type": "string", "name": "tx-type", "in": "query" } }, "responses": { "AccountResponse": { "description": "Encoded block object.", "schema": { "$ref": "#/definitions/Account" } }, "BlockResponse": { "description": "Encoded block object.", "schema": { "type": "object", "required": \[ "block" \], "properties": { "block": { "description": "Block header data.", "type": "object", "x-algorand-format": "BlockHeader" }, "cert": { "description": "Optional certificate object. This is only included when the format is set to message pack.", "type": "object", "x-algorand-format": "BlockCertificate" } } } }, "NodeStatusResponse": { "description": "(empty)", "schema": { "description": "NodeStatus contains the information about a node status", "type": "object", "required": \[ "catchup-time", "last-version", "last-round", "next-version", "next-version-round", "next-version-supported", "stopped-at-unsupported-round", "time-since-last-round" \], "properties": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"catchup-time": { "description": "CatchupTime in nanoseconds", "type": "integer" }, "last-round": { "description": "LastRound indicates the last round seen", "type": "integer" }, "last-version": { "description": "LastVersion indicates the last consensus version supported", "type": "string" }, "next-version": { "description": "NextVersion of consensus protocol to use", "type": "string" }, "next-version-round": { "description": "NextVersionRound is the round at which the next consensus version will apply", "type": "integer" }, "next-version-supported": { "description": "NextVersionSupported indicates whether the next consensus version is supported by this node", "type": "boolean" }, "stopped-at-unsupported-round": { "description": "StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress", "type": "boolean" }, "time-since-last-round": { "description": "TimeSinceLastRound in nanoseconds", "type": "integer" } } } }, "PendingTransactionResponse": { "description": "Given a transaction id of a recently submitted transaction, it returns information about it. There are several cases when this might succeed: - transaction committed (committed round > 0) - transaction still in the pool (committed round = 0, pool error = "") - transaction removed from pool due to error (committed round = 0, pool error != "") Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.", "schema": { "description": "Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.", "type": "object", "required": \[ "txn", "pool-error" \], "properties": { "asset-index": { "description": "The asset index if the transaction was found and it created an asset.", "type": "integer"

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

}, "close-rewards": { "description": "Rewards in microalgos applied to the close remainder to account.", "type": "integer" }, "closing-amount": { "description": "Closing amount for the transaction.", "type": "integer" }, "confirmed-round": { "description": "The round where this transaction was confirmed, if present.", "type": "integer" }, "pool-error": { "description": "Indicates that the transaction was kicked out of this node's transaction pool (and specifies why that happened). An empty string indicates the transaction wasn't kicked out of this node's txpool due to an error.", "type": "string" }, "receiver-rewards": { "description": "Rewards in microalgos applied to the receiver account.", "type": "integer" }, "sender-rewards": { "description": "Rewards in microalgos applied to the sender account.", "type": "integer" }, "txn": { "description": "The raw signed transaction.", "type": "object", "x-algorand-format": "SignedTransaction" } } } }, "PendingTransactionsResponse": { "description": "A potentially truncated list of transactions currently in the node's transaction pool. You can compute whether or not the list is truncated if the number of elements in the **top- transactions** array is fewer than **total-transactions**.", "schema": { "description": "PendingTransactions is an array of signed transactions exactly as they were submitted.", "type": "object", "required": \[ "top-transactions", "total-transactions" \], "properties": { "top-transactions": { "description": "An array of signed transaction objects.", "type": "array", "items": { "type": "object", "x-algorand-format": "SignedTransaction" }

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

}, "total-transactions": { "description": "Total number of transactions in the pool.", "type": "integer" } } } }, "PostTransactionsResponse": { "description": "Transaction ID of the submission.", "schema": { "type": "object", "required": \[ "txId" \], "properties": { "txId": { "description": "encoding of the transaction hash.", "type": "string" } } } }, "SupplyResponse": { "description": "Supply represents the current supply of MicroAlgos in the system.", "schema": { "description": "Supply represents the current supply of MicroAlgos in the system", "type": "object", "required": \[ "online-money", "current\_round", "total-money" \], "properties": { "current\_round": { "description": "Round", "type": "integer" }, "online-money": { "description": "OnlineMoney", "type": "integer" }, "total-money": { "description": "TotalMoney", "type": "integer" } } } }, "TransactionParametersResponse": { "description": "TransactionParams contains the parameters that help a client construct a new transaction.", "schema": {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

"description": "TransactionParams contains the parameters that help a client construct a new transaction.", "type": "object", "required": \[ "consensus-version", "fee", "genesis-id", "genesis-hash", "last-round", "min-fee" \], "properties": { "consensus-version": { "description": "ConsensusVersion indicates the consensus protocol version as of LastRound.", "type": "string" }, "fee": { "description": "Fee is the suggested transaction fee Fee is in units of micro-Algos per byte. Fee may fall to zero but transactions must still have a fee of at least MinTxnFee for the current network protocol.", "type": "integer" }, "genesis-hash": { "description": "GenesisHash is the hash of the genesis block.", "type": "string", "format": "byte" }, "genesis-id": { "description": "GenesisID is an ID listed in the genesis block.", "type": "string" }, "last-round": { "description": "LastRound indicates the last round seen", "type": "integer" }, "min-fee": { "description": "The minimum transaction fee (not per byte) required for the txn to validate for the current network protocol.", "type": "integer" } }, "x-go-package": "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" } }, "ApplicationResponse": { "description": "Application information", "schema": { "$ref": "#/definitions/Application" } }, "AssetResponse": { "description": "Asset information", "schema": { "$ref": "#/definitions/Asset"

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

} }, "CompileResponse": { "description": "Successful compilation", "schema": { "type": "object", "required": \[ "hash", "result" \], "properties": { "hash": { "description": "base32 SHA512\_256 of program bytes (Address style)", "type": "string" }, "result": { "description": "base64 encoded program bytes", "type": "string" } } } } }, "tags": \[\] }

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# Code Snippet

## Javascript

var data = null;

var xhr = new XMLHttpRequest(); xhr.withCredentials = false;

xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } });

//setting request method xhr.open("GET", " [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain) 1/health");

//Available API Endpoints // [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/) // [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/) // [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)

//adding request headers xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("Accept", "application/json");

//sending request xhr.send(data);

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

# JAVA

DataOutputStream dataOut = null; BufferedReader in =null;

## try {

String url = " [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1) /health";

URL urlObj = new URL(url); HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection(); //setting request method connection.setRequestMethod("GET");

//adding headers connection.setRequestProperty("Content-Type","application/json"); connection.setRequestProperty("Accept","application/json");

connection.setDoInput(true);

int responseCode = connection.getResponseCode(); in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); }

//printing response System.out.println(response.toString());

## } catch (Exception e) {

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

//do something with exception
e.printStackTrace();
} finally {
try {
if(dataOut != null) {
dataOut.close();
}
if(in != null) {
in.close();
}
} catch (IOException e) {
//do something with exception
e.printStackTrace();
}
}

* * *

# Swift

## import Foundation

//adding request headers let headers = \[ "Content-Type": "application/json", "Accept": "application/json" \]

let request = NSMutableURLRequest(URL: NSURL(string: " [https://acdevapi1.prod.apimanagement.us10](https://acdevapi1.prod.apimanagement.us10/) .hana.ondemand.com:443/10/sapalgomain1/health")!, cachePolicy: .UseProtocolCachePolicy, timeoutInterval: 10.0)

//setting request method request.HTTPMethod = "GET" request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession() //sending request let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error ) -> Void in if (error != nil) { print(error) } else { let httpResponse = response as? NSHTTPURLResponse print(httpResponse) } })

dataTask.resume()

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0 curl --request GET --url
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/health](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/health)" --
header "Accept: application/json" --header "Content-Type: application/json" #Available API
Endpoints # [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
# [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
# [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)

SAPUI5

//Create JSON Model with URL
var oModel = new sap.ui.model.json.JSONModel();
var sHeaders = {"Content-Type":"application/json","Accept":"application/json"};
//sending request
oModel.loadData(" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain)
1/health", null, true, "GET", null, false, sHeaders);
//Available API Endpoints
// [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
// [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
// [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
//You can assign the created data model to a View and UI5 controls can be bound to it. Please r
efer documentation available at the below link for more information.
// [https://sapui5.hana.ondemand.com/#docs/guide/96804e3315ff440aa0a50fd290805116.html#loio96804e](https://sapui5.hana.ondemand.com/#docs/guide/96804e3315ff440aa0a50fd290805116.html#loio96804e)
3315ff440aa0a50fd290805116
//The below code snippet for printing on the console is for testing/demonstration purpose only.
This must not be done in real UI5 applications.
oModel.attachRequestCompleted(function(oEvent){
var oData = oEvent.getSource().oData;
console.log(oData);
});

* * *

ABAP
DATA: lo\_http\_client TYPE REF TO if\_http\_client.
DATA: response TYPE string.
"create HTTP client by url
CALL METHOD cl\_http\_client=>create\_by\_url
EXPORTING
url = ' [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sa](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sa)
palgomain1/health'
IMPORTING
client = lo\_http\_client
EXCEPTIONS
argument\_not\_found = 1
plugin\_not\_active = 2
internal\_error = 3
OTHERS = 4.
"Available API Endpoints
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
IF sy-subrc <> 0.
"error handling
ENDIF.
"setting request method
lo\_http\_client->request->set\_method('GET').
"adding headers
lo\_http\_client->request->set\_header\_field( name = 'Content-Type' value = 'application/json' ).
lo\_http\_client->request->set\_header\_field( name = 'Accept' value = 'application/json' ).
lo\_http\_client->request->set\_header\_field( name = 'APIKey' value = '' ).
CALL METHOD lo\_http\_client->send
EXCEPTIONS
http\_communication\_failure = 1
SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0 http\_invalid\_state = 2 http\_processing\_failed = 3 http\_invalid\_timeout = 4 OTHERS = 5.

IF sy-subrc = 0. CALL METHOD lo\_http\_client->receive EXCEPTIONS http\_communication\_failure = 1 http\_invalid\_state = 2 http\_processing\_failed = 3 OTHERS = 5. ENDIF.

IF sy-subrc <> 0. "error handling ENDIF.

## response = lo\_http\_client->response->get\_cdata( ).

## WRITE: 'response: ', response.

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0

* * *

SAP Cloud Platform ABAP

TRY.
DATA(lo\_http\_destination) =

cl\_http\_destination\_provider=>create\_by\_url( ' [https://acdevapi1.prod.apimanagement.us10.ha](https://acdevapi1.prod.apimanagement.us10.ha/)
na.ondemand.com:443/10/sapalgomain1/health' ).
"alternatively create HTTP destination via destination service
"cl\_http\_destination\_provider=>create\_by\_cloud\_destination( i\_name = '<...>'
" i\_service\_instance\_name = '<...>' )
"SAP Help: [https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/f871712](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/f871712)
b816943b0ab5e04b60799e518.html
"Available API Endpoints
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
" [https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com:443/10/sapalgomain1/](https://acdevapi1.prod.apimanagement.us10.hana.ondemand.com/10/sapalgomain1/)
"create HTTP client by destination
DATA(lo\_web\_http\_client) = cl\_web\_http\_client\_manager=>create\_by\_http\_destination( lo\_http\_dest
ination ) .
"adding headers with API Key for API Sandbox
DATA(lo\_web\_http\_request) = lo\_web\_http\_client->get\_http\_request( ).
lo\_web\_http\_request->set\_header\_fields( VALUE #(

( name = 'Content-Type' value = 'application/json' )
( name = 'Accept' value = 'application/json' )
( name = 'APIKey' value = '' )
) ).
"set request method and execute request
DATA(lo\_web\_http\_response) = lo\_web\_http\_client->execute( if\_web\_http\_client=>GET ).
DATA(lv\_response) = lo\_web\_http\_response->get\_text( ).
CATCH cx\_http\_dest\_provider\_error cx\_web\_http\_client\_error cx\_web\_message\_error.
"error handling
ENDTRY.
"uncomment the following line for console output; prerequisite: code snippet is implementation
of if\_oo\_adt\_classrun~main
"out->write( \|response: { lv\_response }\| ).

* * *

SAP ALGORAND API – TECHNICAL DOCUMENTATION \| VERSION 1.0
