# Introduction

Welcome to the Akowe Developer Documentation where you will learn how to integrate digital certificate issuance into your systems.

### API Basics <a href="#introduction-api-basics" id="introduction-api-basics"></a>

Akowe API gives you access to pretty much all the features you can use on our dashboard and lets you extend them for use in your application. It strives to be RESTful and is organized around the main resources you would be interacting with - with a few notable exceptions.

{% hint style="info" %}
**Before you do anything**

You should [create a free Akowe account](https://issuance.akowe.app/dashboard/register.html) that you can test the API against. We will provide you with keys that you can use to make API calls.
{% endhint %}

### Sample Requests <a href="#introduction-sample-requests" id="introduction-sample-requests"></a>

We provide sample API calls next to each method using [cURL](https://curl.haxx.se/). All you need to do is insert your specific parameters, and you can test the calls from the command line. See this tutorial on [using cURL with APIs](https://www.baeldung.com/curl-rest).

You can also use [Postman](https://www.postman.com/downloads/) if you are not familiar with cURL. Postman is an easy to use API development and testing platform. You can explore it to understand how our APIs work.

### Requests and Response <a href="#introduction-requests-response" id="introduction-requests-response"></a>

Both request body data and response data are formatted as JSON. Content type for responses will always be `application/json`. Generally, all responses will be in the following format:

{% code title="Response Format" lineNumbers="true" %}

```json
{
  "ResponseCode": [string],  // "00" if the details provided could be processed and no error occured while processing
  "ResponseMessage": [string], // Explains why status is false... Entirely informational. Please only log this but do not use for your checks
  "Data": [object]    // contains actionable result of processing if present
}
```

{% endcode %}

We have provided a handy `ResponseCode` key to let you know upfront if the request was successful or not. "00" represents Success, while other codes would have their corresponding failure message in `ResponseMessage.`

The ResponseMessage key is a string which will contain a summary of the response and its status. For instance, when trying to retrieve a list of templates, ResponseMessage might read “Successful”. In the event of an error, the message key will contain a description of the error. ResponseCode and ResponseMessage are the only keys that are universal across requests.

The Data key is where you want to look at for the result of your request. It can either be an object or an array depending on the request made. For instance, a request to retrieve templates will return  an array of templates earlier created by you.


# Authentication

Authenticate your API calls by including your X-USER and X-HASH keys in the header of every request you make. You can manage your API keys from Integrations page on the [dashboard](https://issuance.akowe.app/) .

{% hint style="danger" %}
**Secure your X-HASH key**

Do not commit your X-HASH key to git, or use it in client-side code.
{% endhint %}

{% code title="Sample Headers" lineNumbers="true" %}

```json
X-USER: test@test.com
X-HASH: xxxxxxxxxxxxxxxxxxxxx
```

{% endcode %}

API requests made without authentication will fail with the status code `400`. All API requests must be made over HTTPS.


# JavaScript In-line SDK

We offer a JavaScript in-line SDK to easily integrate into your existing website and provide rather complex features in an easy way.

Akowe Popup provides a simple and convenient payment flow for web. It can be integrated in two easy steps, making it the easiest way to start using Akowe on your website.

The sample HTML and JavaScript below is all you need to get started.

{% tabs %}
{% tab title="HTML + JavaScript" %}
{% code lineNumbers="true" %}

```html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="https://issuance.akowe.app/sdk/v1.js"></script>
</head>
<body>
    <button onclick="AkoweCreateTemplate('test@test.com');">Open Template</button>
    <button onclick="AkoweIssueCertificates('test@test.com');">Issue Loaded Certificates</button>
</body>
</html>
```

{% endcode %}
{% endtab %}
{% endtabs %}

That is all that is needed to get Akowe running on your website.

The script tag in the header references Akowe's JavaScript in-line SDK.

## Create Template

To create a new template on Akowe that can be used in future to issue certificates, call the function **`AkoweCreateTemplate`** and pass the email attached to your account as argument as seen in line 7 above. This will popup Akowe's template creation tool right on your website. You can follow the prompt, upload your certificate's image and set all paremeters.

{% hint style="info" %}
**Template creation full view**

To get a full overview of how template creation works visually and all you can do, please visit the [dashboard](https://issuance.akowe.app/) and click `Create New Certificate`.
{% endhint %}

## Issue Certificates

To issue certificates visually from your website and watch the progress in real time, call the function **AkoweIssueCertificates** and pass the email attached to your account as argument as seen in line 8 above.

{% hint style="warning" %}
**Before issuing certificates**

Please note that you must call the API endpoint&#x20;

*<https://developer.akowe.app/api/Customer/issuecertificate>*

before you can issue certificates via the popup.

Alternatively, you can use the dashboard to populate the certificates you wish to send, then they will also be available on the popup plugin.
{% endhint %}


# Swagger OpenAPI Docs

For the full list of supported API endpoints, payloads, responses and a playground to try the APIs, we have documented Swagger OpenAPI docs.

To view the swagger please visit our developer page.

[Swagger OpenAI Docs](https://developer.akowe.app/swagger/index.html)


