NAV
curl java js php python ruby csharp go

Introduction

Authentication Base URL

https://[sandbox][api].hydrogenplatform.com/authorization/v1

Web Component & WebView Base URL

https://[sandbox][api].hydrogenplatform.com/component/v1

Hydrogen no-codes are self-contained, configurable apps that perform all necessary API functions and workflows to power your embedded finance solution.

All Hydrogen components for the web are built using Web Component technology. According to webcomponents.org, “Web Components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. Custom components and widgets build on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML.”

For mobile functionality, Web Components are wrapped as WebViews. This technology allows you to display web content within a native mobile app, using an embedded mobile browser. Hydrogen WebViews are compatible with all major mobile frameworks, including native iOS and Android, React Native, Flutter, Ionic, and Xamarin.

All Hydrogen APIs are built on REST principles, with resource oriented URLs and HTTP response codes. All API responses are returned in JSON format.

Run in Postman

Authentication

All Hydrogen APIs use the same OAuth 2.0 authorization. Please refer to the Nucleus API for detailed documentation. You may also refer to our quickstart guide if you require more information on authentication.

Client Libraries

We offer client libraries for Hydrogen Web Components in the following languages:

Sample Apps

We offer sample web applications that authenticate using OAuth 2.0, generate and refresh app tokens, and embed Hydrogen Web Components in the following JS frameworks:

Errors

ERROR CODES

Code Description
400 Bad Request.
401 Unauthorized. Occurs when you are using an invalid or expired access token.
403 Forbidden. The request was valid but you are not authorized to access the resource.
404 Not Found. Occurs when you are requesting a resource which doesn’t exist such as an incorrect URL or incorrect ID.
429 Too Many Requests. Exceeded the rate limit set. Currently, there is no rate limit on the APIs.
500 Internal Server Error.
503 Service Unavailable. If the API is down for maintenance you will see this error.


STATUS CODES

Code Description
200 Ok. The request was successful.

Changelog

Changes and updated versions will be outlined here.

Date Change Description
2022-06-22 addition Update sample requests and SDKs. Add referrals and invite codes to white label app. Add Merchant Rewards iframe parameters.
2022-03-22 addition Add URL parameters to white label web app
2021-11-22 addition Add Go, .NET, C# client libraries
2021-09-10 addition Add Vanilla JS and Vue sample apps
2021-08-09 addition Add React and Angular sample apps
2021-07-01 addition Release web components for Cards

White Label Web App

Hydrogen white label apps are fully hosted, configurable, mobile responsive web applications that provide you 100% of the functionality you need to run your own debit program, with no coding needed.

Custom CNAME

You may host your app on a Hydrogen hosted site such as yourapp.hydrogenplatform.com for free. In our paid plans you can direct the app to your own branded host such as yourapp.yoursite.com. This requires limited technical knowledge, but access to your DNS provider to direct your subdomain and SSL certificates to Hydrogen. After choosing your domain, we will send you the following two CNAME records to add to your DNS provider.

Example DNS Records

Category Required Record Type Name Target
Hostname required CNAME cards cards-12345.alb2.hydrogenplatform.com
SSL optional (you may send us your own SSL certificate) CNAME _ae43c57b1fud564725er5613489svw72.yoursite.com _2b4abcy84f6bd79db1636c758m341626.ltyvprtsjl.acm-validations.aws

Useful Links
Custom CNAME SSL
Cloudflare DNS Instructions
GoDaddy DNS Instructions
Namecheap DNS Instructions
Squarespace DNS Instructions
Wix DNS Instructions

URL Parameters

The web app allows you to pass various parameters into the URL to control data that is submitted on user sign up.

Pre-Fill Sign Up

Pass user data to pre-fill the sign up fields on the frontend. Please note, the user will still need to create a new password for the site and accept the terms.

Example Target

https://cards.myapp.com?first_name=John&last_name=Doe&[email protected]

Data Attributes

Attributes may be URL encoded or plain text

Parameter Type Required Description
first_name string optional First name of the user
middle_name string optional Middle name of the user
last_name string optional Last name of the user
phone integer optional Phone number of the user. Integers only, 10 digits, no dashes or spaces. ex. 1234567891
email string optional Email address of the user. Valid email format [email protected]

Internal Client Attributes

Pass internal user data which will be saved in the Nucleus Client after sign up. This data may be combined with the sign up data parameters above. Please note, the user will not see this data on the frontend and it will only be passed into the Nucleus API after a successful sign up.

Example Target

https://cards.myapp.com?client_group=1234&client_group=abcd&secondary_id=56789

Data Attributes

Attributes may be URL encoded or plain text.

Parameter Type Required Description
client_group string optional Nucleus Client group. Client groups are useful to segment users by plans, affiliates, referral codes, or departments. They also integrate with spending controls and rewards to help you attribute these rules to different types of users. In Nucleus this value will be saved into an array, therefore multiple values may be passed. To pass multiple values, include the parameter again, such as ?client_group={value}&client_group={value}
secondary_id string optional Nucleus Client secondary_id. Secondary IDs are useful to store your own unique user ID so you can map the Hydrogen sign up back to your user base.

Referral Codes

Users can send referral links to friends and family and receive rewards that you define for each referral. A referral_code can be generated by you via API or created automatically in the white label app. When the referred user is sent to the white label app and signs up, the Nucleus client_id attached to the referral_code will be saved as the referral_client_id.

Example Target

https://cards.myapp.com?referral_code=FA9B6D3M

Data Attributes

Attributes may be URL encoded or plain text

Parameter Type Required Description
referral_code string required Nucleus Client referral_code

Invite Codes

If you do not wish to have an open sign up for all web users, you can toggle off the Sign Up no-code config. You can then send invites to users that you are already approved to use your app. They will only be asked to create a password for the white label and accept the terms. You should create the following Nucleus Client data in the API before sending the invite:

The invite code should be directed to your white label {hostname}/sign-up-invite?invite_code={Nucleus Client referral_code}&client_id={Nucleus Client id}

Example Target

https://cards.myapp.com/sign-up-invite?invite_code=FA9B6D3M&client_id=8f0d7bc2-b75e-4ea8-8b05-e4f5cc7e3746

Data Attributes

Attributes may be URL encoded or plain text

Parameter Type Required Description
invite_code string required Nucleus Client referral_code
client_id string required Nucleus Client id

Web Components

Web Components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. Custom components and widgets build on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML.

HTML Embed

Example Embed

<html>
  <body>
    <card-issuance public-key="12345AbCdE" app-token="123456789123456789123456789"></card-issuance>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/2.5.0/custom-elements-es5-adapter.js"></script>
    <script src="https://cards.hydrogenplatform.com/bundle-web-components.js"></script>
  </body>
</html>

To embed Hydrogen components, you can simply add the HTML embed code into any webpage and include the JS libraries on the bottom of the page. Always include the HTML embed BEFORE the JS bundle.

The following JS libraries should always be included once on each page with components:

<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/2.5.0/custom-elements-es5-adapter.js"></script>

<script src="https://cards.hydrogenplatform.com/bundle-web-components.js"></script>

Card Components

No-code web components are available to issue and manage debit cards.

Useful Links
API Compliance
Required Debit Web Components

Data Attributes

Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response
client-id string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists. Please reference each individual component embed code to see if this parameter is accepted.

Card Activation

Activate physical cards with a security code mailed to the cardholder. Virtual cards are automatically activated on issuance.

Example Embed

<card-activation public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-activation>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_activation”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Balance

Display the latest total and available balance for a card.

Example Embed

<card-balance public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-balance>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_balance”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Controls

Update the card address, add spending controls, and freeze the card.

Example Embed

<card-controls public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-controls>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_controls”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Funding

Load funds onto the card via free bank transfer, ACH, payroll, mobile wallets, and other methods.

Example Embed

<card-funding public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-funding>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_funding”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Image

Display a PCI compliant virtual card image, including the full PAN, expiry date, and CVV.

Example Embed

<card-image public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-image>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_image”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Issuance

Issue a card, perform KYC, and set a PIN, all in a compliant workflow with legal disclosures.

Useful Links
Card Issuance Guide
Card Issuance Compliance
Card Simulation Guide

Example Embed

<card-issuance public-key="12345AbCdE" app-token="123456789123456789123456789" client-id="ee18e414-81a4-4fc0-ba56-68216aa22308"></card-issuance>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_issuance”
client-id string optional Nucleus client_id. If supplied, the client details will be pre-populated.

Card Spending

Perform spending analysis on a card over a period of time.

Example Embed

<card-spending public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-spending>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_spending”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Statements

Pull statements from the bank with beginning and ending balances, and all monthly transactions.

Example Embed

<card-statements public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-statements>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_statements”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

Card Transactions

Display all transactions including amount, date, merchant name, location, website, logo.

Example Embed

<card-transactions public-key="12345AbCdE" app-token="123456789123456789123456789" card-id="0dc1c518-3579-416e-9440-79b268c7087e"></card-transactions>
Parameter Type Required Description
public-key UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
app-token string required Authenticated app_token from Get App Token response. To retrieve app_token pass app_name as “card_transactions”
card-id string optional Nucleus card_id. If not supplied, a select dropdown of available cards will be displayed, if more than one card exists.

WebViews

All Hydrogen Web Components are also available as Mobile WebViews (if enabled in the app config), and optimized for display on mobile devices. This optional configuration will automatically detect the User-Agent of the device as mobile and wrap the component inside a browser window. The component will be indistinguishable from any other content that is rendered natively in your app.

iOS

Installation

Link to HydrogenCards.podspec

target 'YourProjName' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for YourProjName

  pod 'HydrogenCards', :path => './'
  pod 'Alamofire'
  pod 'iOSDropDown'

  post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
          end
        end
      end
  end
end
  1. Please first install CocoaPods and follow the installation instructions
  2. Download the iOS WebViews package
  3. Create an empty Xcode project (with Storyboard interface) and initialize Podfile: pod init
  4. Open the Podfile in your folder and provide a link to HydrogenCards.podspec using the code in the right panel
  5. Install pods to YourProjName pod install
  6. After you finish with pods open the YourProjName.xcworkspace

Adding to Storyboard

  1. Open components library and choose View
  2. In the Show identity inspector tab enter Class and Module (in our case class BalanceView and module Cards)
  3. Choose BalanceView at View Controller Scene and move it to Assistant holding Ctrl

Usage

Add to controller

import UIKit
import HydrogenCards

class ViewController: UIViewController {

    @IBOutlet weak var balance: BalanceView!
    override func viewDidLoad() {
        super.viewDidLoad()

        balance.showContent(publicKey: "", appToken: "", cardId: "")

       //add your credentials

    }
}
Parameter Type Required Description
publicKey UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
appToken string required Authenticated app_token from Get App Token response
clientId string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
cardId string optional Nucleus card_id. Please reference each individual component embed code to see if this parameter is accepted.

Android

Installation

Add the following code in your AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.package">
    ...
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:usesCleartextTraffic="true"
        ...>
    </application>

</manifest>
  1. Please first read this Android WebView Installation Guide
  2. Download the Android WebViews package
  3. Make sure you have the code in the right panel in your AndroidManifest.xml file

Usage

Example Config

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

  <com.hydrogenplatform.card_modules.Issuance
      android:id="@+id/issuance"
      android:layout_width="match_parent"
      android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

Example Embed

...
import com.hydrogenplatform.card_modules.Issuance

class MainActivity : AppCompatActivity() {
    private late init var cardIssuance: Issuance

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        ...

        cardIssuance = findViewById(R.id.issuance)

        val publicKey="your publicKey"
        val appToken="your appToken"

        cardIssuance.showComponent(publicKey,appToken)
    }
}
Parameter Type Required Description
publicKey UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
appToken string required Authenticated app_token from Get App Token response
clientId string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
cardId string optional Nucleus card_id. Please reference each individual component embed code to see if this parameter is accepted.

React Native

Installation

  1. Please first install react-native-webview
  2. Download the React Native WebViews pacakge or run yarn add https://[sandbox][api].hydrogenplatform.com/webview/cards/react_native_cards.tgz

Usage

Example Embed

import React, { Component } from 'react';
import { CardIssuance } from 'card-modules';

class MyComponent extends Component {
    render() {
        return <CardIssuance publicKey='' appToken='' />;
    }
}
Parameter Type Required Description
publicKey UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
appToken string required Authenticated app_token from Get App Token response
clientId string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
cardId string optional Nucleus card_id. Please reference each individual component embed code to see if this parameter is accepted.

Flutter

Installation

Example Dependencies

dependencies:
  flutter:
    sdk: flutter

  hydrogencards:
    path: ./flutter
  1. Download the Flutter WebViews package
  2. Go to the pubspec.yaml file and add package into dependencies like the example in the right pane.

Usage

Example Flutter Code

import 'package:flutter/material.dart';
import 'package:hydrogencards/card.dart';

class _YouClassNameState extends State<YouClassName> {
  @override
  Widget build(BuildContext context) {

    CardsState instanceCards = CardsState(
        appName: 'card-balance',
        appToken: 'your-app-token',
        publicKey: 'your-public-key');

    return Scaffold(
      body: Container(
        child: Column(
          children: <Widget>[
            Expanded(
              child: Container(
                child: instanceCards,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Add the hydrogencards package into your project like the example in the right pane.

Parameter Type Required Description
appName UUID required Name of web component found on embed modal of app on the Hydrogen Account Portal. Format will be card-balance or card-issuance
publicKey UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
appToken string required Authenticated app_token from Get App Token response
clientId string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
cardId string optional Nucleus card_id. Please reference each individual component embed code to see if this parameter is accepted.

Ionic

Installation

Download the Ionic WebViews package or run yarn add https://[sandbox][api].hydrogenplatform.com/webview/cards/ionic_cards.tgz

Usage

Example JS

import { Component, OnInit } from '@angular/core';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';

import { Card } from 'hydrogen-cards';

@Component({
  selector: 'app-cards',
  templateUrl: 'cards.component.html',
  styleUrls: ['cards.component.scss'],
})
export class CardsComponent implements OnInit {
  card: SafeResourceUrl;

  constructor(private domSanitizer: DomSanitizer) {}

  onChange() {
          this.card = this.domSanitizer.bypassSecurityTrustHtml(
            new Card(
              appName,
              appToken,
              publicKey,
              cardId,
              clientId
            ).renderCard()
          );
  }
}

Add the javascript in the right panel inside your project.

Example HTML

<ion-app id="app">
    <ion-content [fullscreen]="true">
        <iframe id="iFrame" frameborder="0" [srcdoc]="card"></iframe>
    </ion-content>
</ion-app>
Parameter Type Required Description
appName UUID required Name of web component found on embed modal of app on the Hydrogen Account Portal. Format will be card-balance or card-issuance
publicKey UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
appToken string required Authenticated app_token from Get App Token response
clientId string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
cardId string optional Nucleus card_id. Please reference each individual component embed code to see if this parameter is accepted.

Xamarin

Installation

  1. Download the Xamarin WebViews package and unarchive files
  2. Open your project and right click on Dependencies. Select Add Reference. In opened popup select .Net Assembly -> Browse
  3. Open file from unarchived folder publish/CardNet.dll

Usage

Example link xaml

xmlns:hydrogen="clr-namespace:CardNet;assembly=CardNet" > <ContentPage.Content> </ContentPage.Content>

Example connect xaml

xmlns:hydrogen="clr-namespace:CardNet;assembly=CardNet" > <ContentPage.Content> <hydrogen:CardView x:Name="hydroItem" IsVisible="true"/> </ContentPage.Content>

Open xaml file and enter the following lines:

  1. Link to connected dependency to the main tag of your page xmlns:hydrogen="clr-namespace:CardNet;assembly=CardNet"

  2. Connect the component. Give x:Name such as:
    <hydrogen:CardView x:Name="hydroItem" IsVisible="true"/>

Inside your cs file (must be connected to xaml page) by using x:Name call widget using the code in the right panel

Example card balance embed

hydroItem.showWidget("card-balance", "publicKey", "appToken", "cardId");
Parameter Type Required Description
appName UUID required Name of web component found on embed modal of app on the Hydrogen Account Portal. Format will be card-balance or card-issuance
publicKey UUID required Public Key found with your OAuth credentials on the Hydrogen Account Portal
appToken string required Authenticated app_token from Get App Token response
clientId string optional Nucleus client_id. Please reference each individual component embed code to see if this parameter is accepted.
cardId string optional Nucleus card_id. Please reference each individual component embed code to see if this parameter is accepted.

API Endpoints

App Tokens

Each time you load a Hydrogen Web Component, you will need to generate an app token using your OAuth 2.0 JWT. Each token can only be used once and will be invalidated once embedded and loaded.

Generate token for one app

Example Request

curl -X GET -H "Authorization: Bearer <access_token>" \
 "https://[sandbox][api].hydrogenplatform.com/component/v1/app_token?app_name=card_issuance"
api_instance = admin_api.AutoGenerateAppTokenApi()

attribMap = [
    {"name": "public-key", "value": "public_key"},
    {"name": "client-id", "value": "xxxx"},
    {"name": "card-id", "value": "xxxx"},
]

userAuthToken = "xxxx"

appTokenConfig = {}
appTokenConfig['clientId'] = "xxxx"
appTokenConfig['clientSecret'] = "xxxx"
appTokenConfig['username'] = "xxxx"
appTokenConfig['password'] = "xxxx"
appTokenConfig["appName"] = [{"app_name": "card_issuance"}]
appTokenConfig["auth_type"] = "password_credentials"
appTokenConfig["basePath"] = "https://[sandbox][api].hydrogenplatform.com"
appTokenConfig["accessToken"] = None
appTokenConfig["attribMap"] = attribMap
appTokenConfig["isEmbed"] = None

try:
    api_response = api_instance.get_app_token_using_get(appTokenConfig)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AppTokenApi->get_app_token_using_get: %s\n" % e)
api_instance = AdminApi::AutoGenerateAppTokenApi.new

attribMap = [{"name" => "public-key", "value" => "xxxx"},{"name" => "client-id", "value" => "xxxx"}, {"name" => "card-id", "value" => "xxxx"}]

appTokenConfig = {}
appTokenConfig['appName'] = [{'app_name':'card_issuance'}]
appTokenConfig['accessToken'] = userAuthToken
appTokenConfig['attribMap'] = attribMap
appTokenConfig['isEmbed'] = TRUE
appTokenConfig['clientId'] = "xxxx"
appTokenConfig['clientSecret'] = "xxxx"
appTokenConfig['username'] = "xxxx"
appTokenConfig['password'] = "xxxx"
appTokenConfig['basePath'] = "https://[sandbox][api].hydrogenplatform.com"
appTokenConfig['authType'] = "client_credentials"

begin
  result = api_instance.get_app_token_using_get(appTokenConfig)
  p result
rescue IntegrationApi::ApiError => e
  puts "Exception when calling AutoGenerateAppTokenApi->get_app_token_using_get: #{e}"
end
AppTokenConfig appTokenConfig = new AppTokenConfig()
.setClientId("xxxx")
.setClientSecret("xxxx")
.setUsername("xxxx")
.setPassword("xxxx")
.setAuthType(AuthType.PASSWORD)
.setAppNames(asList(new AppConfig().setAppName("card_issuance")))
.setBasePath(Environment.PRODUCTION);

AutoGenerateAppTokenApi appTokenApi = new AutoGenerateAppTokenApi(appTokenConfig);

try {
      appTokenApi.getAppTokenUsingGET();
      System.out.println( "client_token_credentials :-" + appTokenApi.getApiClient().getAccessToken());
  } catch (ApiException e) {
      System.err.println("Exception when calling AutoGenerateAppTokenApi#getAppTokenUsingGET");
      e.printStackTrace();
  }
var api = new HydrogenAppTokenApi.AutoGenerateAppTokenApi()
let attribMap = [{
    "name": "public-key",
    "value": "xxxx"
}, {
    "name": "client-id",
    "value": "xxxx9"
}]

const userAuthToken = "xxxx";

let appTokenConfig = {};
appTokenConfig['clientId'] = "xxxx"
appTokenConfig['clientSecret'] = "xxxx"
appTokenConfig['username'] = "xxxx"
appTokenConfig['password'] = "xxxx"
appTokenConfig['appName'] = [{'app_name':'card_issuance'}]
appTokenConfig['authType'] = "password_credentials"
appTokenConfig['basePath'] = "https://[sandbox][api].hydrogenplatform.com/"
appTokenConfig['accessToken'] = userAuthToken

var callback = function(error, data, response) {
    if (error) {
        console.error(error);
    } else {
        console.log('API called successfully. Returned data: ' + JSON.stringify(data));
    }
};
api.getAppTokenUsingGET(appTokenConfig = appTokenConfig, callback);
  var a = sw.AutoGenerateAppTokenApiService{}
  var appTokenConfig = sw.AppTokenConfig{};
  var appConfig = sw.AppConfig{};
  appConfig.AppName = "card_issuance";
  appConfig.AuthType = "client_credentials";
  var tagAttributes = sw.TagAttributes{};
  tagAttributes.Name = "xxxx";
  tagAttributes.Value = "xxxx";
  appTokenConfig.BasePath = "https://[sandbox][api].hydrogenplatform.com";
  appTokenConfig.ClientId = "xxxx";
  appTokenConfig.ClientSecret = "xxxx";
  appTokenConfig.AppNames = []sw.AppConfig{appConfig}
  appTokenConfig.Attributes = []sw.TagAttributes{tagAttributes}
  appTokenConfig.IsEmbed = true;
  appTokenConfig.Username = "xxxx";
  appTokenConfig.Password = "xxxx";

​
  r, res, err :=a.GetAppTokenUsingGET(auth, appTokenConfig)
  fmt.Printf("%s",err)
  fmt.Printf("%s",res)
  var result = r[0]
  b, _ := PrettyJson(result["card_issuance"])
    fmt.Printf("%s",result["card_issuance"])
  xulu.Use(res, err, b)
AppTokenConfig appTokenConfig = new IO.Swagger.Model.AppTokenConfig();
AppConfig appConfig = new IO.Swagger.Model.AppConfig();
appConfig.appName = "card_issuance";
appConfig.authType = "client_credentials";
TagAttributes tagAttributes = new IO.Swagger.Model.TagAttributes();
tagAttributes.name = "xxxx";
tagAttributes.value = "xxxx";
appTokenConfig.basePath = "https://[sandbox][api].hydrogenplatform.com";
appTokenConfig.clientId = "xxxx";
appTokenConfig.clientSecret = "xxxx";
appTokenConfig.appNames = new List<AppConfig>{appConfig};
appTokenConfig.attributes = new List<TagAttributes>{tagAttributes};
appTokenConfig.isEmbed = true;
appTokenConfig.username = null;
appTokenConfig.password = null;
appTokenConfig.publicKey = "<public_key>";

var apiInstance = new AutoGenerateAppTokenApi(appTokenConfig);
try
{
  List<Dictionary<string, string>> result = apiInstance.GetAppTokenUsingGET();
  Console.WriteLine(JsonConvert.SerializeObject(result));
}
catch (Exception e)
{
  Console.WriteLine("Exception when calling AutoGenerateAppTokenApi.GetAppTokenUsingGET: " + e);
}
$apiInstance = new com\hydrogen\admin\Api\AutoGenerateAppTokenApi(
    new GuzzleHttp\Client()
);

$attribMap = [
    [
        "name" => "public-key",
        "value" => "****",
    ],
    [
        "name" => "client-id",
        "value" => "****",
    ],
    [
        "name" => "card-id",
        "value" => "****",
    ],
];

$app_token_config["clientId"] = "xxxx";
$app_token_config["clientSecret"] = "xxxx";
$app_token_config["username"] = "xxxx";
$app_token_config["password"] = "xxxx";
$app_token_config["appName"] = [["app_name" => "card_issuance"]];
$app_token_config["authType"] = "password_credentials";
$app_token_config["basePath"] = \com\hydrogen\admin\Environment::PRODUCTION;
$app_token_config["isEmbed"] = true;
$app_token_config["attribMap"] = $attribMap;


try {
    $result = $apiInstance->getAppTokenUsingGET($app_token_config);
    print_r($result);
} catch (Exception $e) {
    print_r($e->getMessage());
}

Example Response

[
  {
    "id": "d1a53d6e-a9a0-4352-900a-56bf81844eed",
    "tenant_name": "lMwcvm6paFnWBTms9DdqY4PbilwR",
    "username": null,
    "is_valid": true,
    "create_date": "2021-09-06T23:23:53.319+0000",
    "update_date": "2021-09-06T23:23:53.319+0000",
    "app_name": "card_issuance",
    "app_token": "p87c6243958fa6eb64a59aaadec8a4acd31bc37a0f9dc09b1cdc250d9151c698"
  }
]

HTTP REQUEST

GET /app_token?app_name={app_name}

ARGUMENTS

Parameter Type Required Description
app_name string required Name of the app that you want to generate a token for. You will find the string name on the “Embed” modal of the “Apps” page on the Account Portal.

RESPONSE

Parameter Type Description
id UUID ID of the response object
tenant_name string Your OAuth client_id
username string Username of the client if using the password OAuth grant when embedding end user widgets
is_valid boolean Designates if the token is still valid
create_date timestamp Time when the token was generated
update_date timestamp Time when the token was updated
app_name string Name of the app from the request that the token was generated for
app_token string Token that you will use in the html embed code as app-token

Generate tokens for multiple apps

If you are embedding multiple components on the same app, you can make one API call and add each app_name as a URL param to retrieve the tokens in the same response.

Example Request

curl -X GET -H "Authorization: Bearer <access_token>" \
 "https://[sandbox][api].hydrogenplatform.com/component/v1/app_token?app_name=card_issuance,card_balance"
api_instance = \
    integration_api.AutoGenerateAppTokenApi(integration_api.ApiClient(configuration))

attribMap = [{"name" : "public-key", "value" : "public_key"},{"name" : "client-id", "value" : "xxxx"}, {"name" : "card-id", "value" : "xxxx"}]

userAuthToken = "xxxx"

appTokenConfig = {}
appTokenConfig['clientId'] = "xxxx"
appTokenConfig['clientSecret'] = "xxxx"
appTokenConfig['username'] = "xxxx"
appTokenConfig['password'] = "xxxx"
appTokenConfig["appName"] = [{"app_name": "card_issuance"},{"app_name": "card_balance"}]
appTokenConfig["auth_type"] = "password_credentials"
appTokenConfig["basePath"] = "https://[sandbox][api].hydrogenplatform.com"
appTokenConfig["attribMap"] = attribMap
appTokenConfig["accessToken"] = None
appTokenConfig["isEmbed"] = None

try:
    api_response = api_instance.get_app_token_using_get(appTokenConfig)
    pprint(api_response)
except ApiException as e:
    pprint("Exception when calling AutoGenerateAppTokenApi->get_app_token_using_get: %s\n" % e)
api_instance = AdminApi::AutoGenerateAppTokenApi.new

attribMap = [{"name" => "public-key", "value" => "xxxx"},{"name" => "client-id", "value" => "xxxx"}, {"name" => "card-id", "value" => "xxxx"}]

appTokenConfig = {}
appTokenConfig['appName'] = [{'app_name':'card_issuance'},{'app_name':'card_balance'}]
appTokenConfig['accessToken'] = userAuthToken
appTokenConfig['attribMap'] = attribMap
appTokenConfig['isEmbed'] = TRUE
appTokenConfig['clientId'] = "xxxx"
appTokenConfig['clientSecret'] = "xxxx"
appTokenConfig['username'] = "xxxx"
appTokenConfig['password'] = "xxxx"
appTokenConfig['basePath'] = "https://[sandbox][api].hydrogenplatform.com"
appTokenConfig['authType'] = "client_credentials"

begin
  result = api_instance.get_app_token_using_get(appTokenConfig)
  p result
rescue IntegrationApi::ApiError => e
  puts "Exception when calling AutoGenerateAppTokenApi->get_app_token_using_get: #{e}"
end
AppTokenConfig appTokenConfig = new AppTokenConfig()
.setClientId("xxxx")
.setClientSecret("xxxx")
.setUsername("xxxx")
.setPassword("xxxx")
.setAuthType(AuthType.PASSWORD)
.setAppNames(asList(new AppConfig().setAppName("card_issuance"), new AppConfig().setAppName("card_balance")))
.setBasePath(Environment.PRODUCTION);

AutoGenerateAppTokenApi appTokenApi = new AutoGenerateAppTokenApi(appTokenConfig);

try {
      appTokenApi.getAppTokenUsingGET();
      System.out.println( "client_token_credentials :-" + appTokenApi.getApiClient().getAccessToken());
  } catch (ApiException e) {
      System.err.println("Exception when calling AutoGenerateAppTokenApi#getAppTokenUsingGET");
      e.printStackTrace();
  }
var api = new HydrogenAppTokenApi.AutoGenerateAppTokenApi()
let attribMap = [{
    "name": "public-key",
    "value": "xxxx"
}, {
    "name": "client-id",
    "value": "xxxx9"
}]

const userAuthToken = "xxxx";

let appTokenConfig = {};
appTokenConfig['clientId'] = "xxxx"
appTokenConfig['clientSecret'] = "xxxx"
appTokenConfig['username'] = "xxxx"
appTokenConfig['password'] = "xxxx"
appTokenConfig4['appName'] = [{'app_name': 'card_issuance'}, {'app_name': 'card_balance'}]
appTokenConfig['authType'] = "password_credentials"
appTokenConfig['basePath'] = "https://[sandbox][api].hydrogenplatform.com/"
appTokenConfig['accessToken'] = userAuthToken

var callback = function(error, data, response) {
    if (error) {
        console.error(error);
    } else {
        console.log('API called successfully. Returned data: ' + JSON.stringify(data));
    }
};
api.getAppTokenUsingGET(appTokenConfig = appTokenConfig, callback);
$apiInstance = new com\hydrogen\admin\Api\AutoGenerateAppTokenApi(
    new GuzzleHttp\Client()
);

$attribMap = [
    [
        "name" => "public-key",
        "value" => "****",
    ],
    [
        "name" => "client-id",
        "value" => "****",
    ],
    [
        "name" => "card-id",
        "value" => "****",
    ],
];

$app_token_config["clientId"] = "xxxx";
$app_token_config["clientSecret"] = "xxxx";
$app_token_config["username"] = "xxxx";
$app_token_config["password"] = "xxxx";
$app_token_config["appName"] = [["app_name" => "card_issuance"],["app_name" => "card_balance"]];
$app_token_config["authType"] = "password_credentials";
$app_token_config["basePath"] = \com\hydrogen\admin\Environment::PRODUCTION;
$app_token_config["isEmbed"] = true;
$app_token_config["attribMap"] = $attribMap;

try {
    $result = $apiInstance->getAppTokenUsingGET($app_token_config);
    print_r($result);
} catch (Exception $e) {
    print_r($e->getMessage());
}
    var a = sw.AutoGenerateAppTokenApiService{}
    var appTokenConfig = sw.AppTokenConfig{};
    var appConfig = sw.AppConfig{};
    appConfig.AppName = "card_issuance";
    appConfig.AuthType = "client_credentials";
    var tagAttributes = sw.TagAttributes{};
    tagAttributes.Name = "<xxxx>";
    tagAttributes.Value = "<xxxx>";
    appTokenConfig.BasePath = "https://[sandbox][api].hydrogenplatform.com/component/v1";
    appTokenConfig.ClientId = "xxxx";
    appTokenConfig.ClientSecret = "xxxx";
    appTokenConfig.AppNames = []sw.AppConfig{appConfig}
    appTokenConfig.Attributes = []sw.TagAttributes{tagAttributes}
    appTokenConfig.IsEmbed = true;
​
    r, res, err :=a.GetAppTokenUsingGET(auth, appTokenConfig)
    fmt.Printf("%s",err)
    fmt.Printf("%s",res)
    var result = r[0]
    b, _ := PrettyJson(result["card_issuance"])
        fmt.Printf("%s",result["card_issuance"])
    xulu.Use(res, err, b)
}
AppTokenConfig appTokenConfig = new IO.Swagger.Model.AppTokenConfig();
AppConfig appConfig = new IO.Swagger.Model.AppConfig();
appConfig.appName = "card_issuance";
appConfig.authType = "client_credentials";
TagAttributes tagAttributes = new IO.Swagger.Model.TagAttributes();
tagAttributes.name = "xxxx";
tagAttributes.value = "xxxx";
appTokenConfig.basePath = "https://[sandbox][api].hydrogenplatform.com";
appTokenConfig.clientId = "xxxx";
appTokenConfig.clientSecret = "xxxx";
appTokenConfig.appNames = new List<AppConfig>{appConfig};
appTokenConfig.attributes = new List<TagAttributes>{tagAttributes};
appTokenConfig.isEmbed = true;
appTokenConfig.username = null;
appTokenConfig.password = null;
appTokenConfig.publicKey = "<public_key>";
appTokenConfig.isEmbed = true;
var apiInstance = new AutoGenerateAppTokenApi(appTokenConfig);
try
{
    List<Dictionary<string, string>> result = apiInstance.GetAppTokenUsingGET();
    Console.WriteLine(JsonConvert.SerializeObject(result));
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling AutoGenerateAppTokenApi.GetAppTokenUsingGET: " + e);
}

Example Response

[
  {
    "id": "13fdec57-1a45-4555-be41-f805f7da5123",
    "tenant_name": "lMwcvm6paFnWBTms9DdqY4PbilwR",
    "username": null,
    "is_valid": true,
    "create_date": "2021-09-06T23:29:39.113+0000",
    "update_date": "2021-09-06T23:29:39.113+0000",
    "app_name": "card_issuance",
    "app_token": "p5e87a258615120963e81b7f63aa66984fb4316caa545cbe23fb4cb9e6fe831e"
  },
  {
    "id": "d5548e49-03c7-4b2f-a651-20a6a404b7bc",
    "tenant_name": "lMwcvm6paFnWBTms9DdqY4PbilwR",
    "username": null,
    "is_valid": true,
    "create_date": "2021-09-06T23:29:39.125+0000",
    "update_date": "2021-09-06T23:29:39.125+0000",
    "app_name": "card_balance",
    "app_token": "9be4e204425f74ec1b6f5db9361b413699a89606f231ca5665ebb9785dd3eb49"
  }
]

HTTP REQUEST

GET /app_token?app_name={app_name1}&app_name={app_name2}

ARGUMENTS

Parameter Type Required Description
app_name string required Name of the app that you want to generate a token for. You will find the string name on the “Embed” modal of the “Apps” page on the Account Portal.

RESPONSE

Parameter Type Description
id UUID ID of the response object
tenant_name string Your OAuth client_id
username string Username of the client if using the password OAuth grant when embedding end user widgets
is_valid boolean Designates if the token is still valid
create_date timestamp Time when the token was generated
update_date timestamp Time when the token was updated
app_name string Name of the app from the request that the token was generated for
app_token string Token that you will use in the html embed code as app-token