# API Client Registration

{% hint style="success" %}
*Check out the given illustration to configure a new Internal API Client Registration.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2Fk5Lu4awLQqcvXcfvfWvI%2FAPI%20client%20Registration.mp4?alt=media&token=a6af1028-271d-4a37-983e-ae6b21a6298d>" %}
***Configuring a new Internal API Client***
{% endembed %}

The API Client Registration option helps the user to register and save the specific details of API Clients.&#x20;

## Registering an API Client

* Navigate to the ***Admin Module.***
* Click the **API Client Registration** option from the side navigation bar.​ &#x20;

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FyRtGut6PPY6T025U40hj%2Fimage.png?alt=media&#x26;token=105efe5b-e744-48a0-80cc-cc4ee81ae9ba" alt=""><figcaption></figcaption></figure>
* The ***API Client Registration*** ***page*** opens.
* Click the ***New*** option to create a new client registration.&#x20;

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FCStQ26hw5KvcdjMpZ8Jm%2Fimage.png?alt=media&#x26;token=8df61f1b-7b47-4bcb-b026-c726f2839f92" alt=""><figcaption></figcaption></figure>
* There are two a**uthentication** types (**Internal** or **External)** available to register a new API client    (Select any one of them).

<figure><img src="https://content.gitbook.com/content/uMgCAr8LDezd8gVX68JP/blobs/VDiAZH9niipBZqPaSQqc/image.png" alt=""><figcaption></figcaption></figure>

### Internal Client Registration <a href="#internal-client-registration" id="internal-client-registration"></a>

The **Internal API Client authentication** will happen from the platform side using client ID, client secret, app name, and content type.

* Select ***Internal*** as the authentication option.
* Provide the following information:
  * Client Name
  * Client Email
  * App Name
  * Request Per Hour
  * Request Per Day
  * Select API Type: Select either of the options: ***Data as API*** or ***Model as API***

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>  The user can select any one of the given choices for the Select Api Type field. The supported API types are:*&#x20;

* Data as API

* Model as API

* AI as API

* Widget as API
  {% endhint %}

* After selecting one option from the ***Select API Type***, a new field named ***Select the entitled services*** appears The user can select multiple options of the chosen API Type by using this field.

* Click the ***Save*** option. &#x20;

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2F6Cw3XGDtPPmpcWQ6UR6O%2Fimage.png?alt=media&#x26;token=46f7edaf-96aa-4e19-bbdc-48e3bd39d5c6" alt=""><figcaption></figcaption></figure>

* A notification message appears.

* The created API Client gets listed at the top of the displayed ***Client List***.

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FT1eVED2uRZDJYlfdXjU0%2Fimage.png?alt=media&#x26;token=5fd932e3-e7ec-437d-9e03-2baf5018aa5e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*

* *The **client ID** and **client secret** will be generated while saving the **API Client Registration**.*
* *Both **Data as API** & **Model as API** support Internal Authentication. So the user needs to select either one of them in the **Select API Type**.*
  {% endhint %}

### External Client Registration  <a href="#external-client-registration" id="external-client-registration"></a>

The **External** option does not support **Authentication** by using the client ID, client secret, and app name. The user needs to authenticate by providing the secret Key and Values/Mapping key. The authentication will be considered only if the selected ***Validation Type*** is ***Validated.***

* Select the ***External*** option.
* Provide the following details:
  * Client Name
  * Client Email
  * Select the entitled services from the drop-down menu.
* Provide Key, Validation Type, and Value/Mapping Key.
* Click the ***Save*** option.&#x20;

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2F0QQgKqMAShZ1e7DmoTHV%2Fimage.png?alt=media&#x26;token=1cea6f5d-6a0c-4a3e-9439-3a9518f15964" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> The* ***Select the Services Entitled** drop-down* *will display the data sets published as services* *from the **Data Center** module.*
{% endhint %}

* A notification message appears.
* The ***API Client*** details get saved at the top of the displayed ***Client List.***

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FKilJMUSDpmxE3ZyrmfQh%2Fimage.png?alt=media&#x26;token=20f8f0b0-cde5-48ea-88ef-4fc85cfc8f67" alt=""><figcaption></figcaption></figure>

## **Steps to call the API from POSTMAN**  <a href="#how-to-call-the-api-from-postman" id="how-to-call-the-api-from-postman"></a>

### **Internal Authentication API** <a href="#how-to-call-the-api-from-postman" id="how-to-call-the-api-from-postman"></a>

* Click the ***Edit*** option from the saved API Client Registration.
* The API Client Registration form reopens.
* The user can get the ***Client ID***, ***Client Secret***, and ***App Name.*** You can copy them.
* A doc link appears at the bottom. Click on it.

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FnJzz0fXVqvU4blUg4h8o%2Fimage.png?alt=media&#x26;token=7f3b64a4-b58e-43c6-81d1-d4249ef1c627" alt=""><figcaption></figcaption></figure>
* Navigate to the Headers section.&#x20;
* You will get the Content type displayed.
* Copy the Content type of the service.&#x20;

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FtKKAojWcjG6niSn46yHY%2Fimage.png?alt=media&#x26;token=bdb96755-3f72-4dcd-bcd7-9a6af6669bd4" alt=""><figcaption></figcaption></figure>
* Navigate to the ***Headers*** tab inside the GET call.
* Pass the ***Client ID, App Name Client Secret Key, and Content Type*** to get the response.

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2Fco2G3tBUuJWyYmtnmVjV%2Fimage.png?alt=media&#x26;token=1cdbd094-a780-419d-8a4b-14a4a1fba3d7" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> Users may need to manually enter the **Client ID, App Name, Client Secret Key, and Content Type** in the **Postman** to get the respons&#x65;**.***
{% endhint %}

### **External Authentication API**

* Click on the ***Edit*** option for the saved External API Client.
* The API Client Registration form reopens with the entitled service.
* The user can get the following information about the API Service:
  * Key
  * Validation Type
  * Value/ Mapping Key

    <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2F7qraY6Ty4vd15RizNnbr%2Fimage.png?alt=media&#x26;token=5ddc2bc2-8b86-4765-970a-2f59bf0f7199" alt=""><figcaption></figcaption></figure>
* To get the response, pass the mapping key value and content type in the Headers section of the Postman GET/POST call.&#x20;

  <figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2F8JlKCNGe5vyB1QD49vwJ%2Fimage.png?alt=media&#x26;token=a645a98b-6d97-4648-b7ae-ac2f0f4df8d4" alt=""><figcaption></figcaption></figure>
* *The User's tenant/Space name must be mentioned in the URL for the external user.*

<figure><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FPBSfjkmRc5qvbYi8XLKt%2Fimage.png?alt=media&#x26;token=0ac147ae-94f6-4ee6-b355-cd391784d2ef" alt=""><figcaption></figcaption></figure>

The following actions are provided to an API Registration Client:

<table><thead><tr><th width="151">Icon</th><th>Action</th></tr></thead><tbody><tr><td><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FKVjD7l2gh0femk2AGimj%2Fimage.png?alt=media&#x26;token=b70d146a-cb69-49c9-820d-877eafd05391" alt="" data-size="original"></td><td>Send Mail to Client</td></tr><tr><td><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FM5pxd3Jk3myXtymzYteQ%2Fimage.png?alt=media&#x26;token=4df99bad-2ac5-438c-8c1e-46ffbf69d336" alt="" data-size="original"></td><td>Edit Client Details</td></tr><tr><td><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2Fq3GaxPEUdVAUlQmITMAc%2Fimage.png?alt=media&#x26;token=4d7b8da8-f102-418a-ade5-c792b2411f20" alt="" data-size="original"></td><td>Delete Client</td></tr><tr><td><img src="https://4090376733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuMgCAr8LDezd8gVX68JP%2Fuploads%2FzRj1GwQGZo8rWex4DqoV%2Fimage.png?alt=media&#x26;token=6d0307ed-ae2f-4e45-b7c1-a08059686ece" alt="" data-size="original"></td><td>Download</td></tr></tbody></table>
