NAV
curl java javascript php python ruby

Introduction

Base URL

https://api.hydrogenplatform.com/admin/v1

Hydrogen Web Components are self-contained, configurable widgets that perform all necessary API functions and workflows to power your app. All Hydrogen components 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.”

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:

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.

WebView Installation Guide

Our WebViews have been confirmed to run in the following languages and mobile dev 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
2021-07-01 addition Release web components for Cards

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

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

Example Request

curl -X GET -H "Authorization: Bearer <access_token>" \
 "https://api.hydrogenplatform.com/admin/v1/app_token?app_name=card_issuance"





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"
  }
]

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.

HTTP REQUEST

GET /app_token?app_name={app_name1}&{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

Example Request

curl -X GET -H "Authorization: Bearer <access_token>" \
 "https://api.hydrogenplatform.com/admin/v1/app_token?app_name=card_issuance&app_name=card_admin"





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_admin",
    "app_token": "9be4e204425f74ec1b6f5db9361b413699a89606f231ca5665ebb9785dd3eb49"
  }
]