Github

Github

Github

Asset Version: 1.0.0
  • Version 1.0.0
Last Published: Apr 23, 2017 By: Kony Team
110 0 0 14
Control your git repository straight from your mobile apps. The Github data adapter allows you to quickly connect to a git repository to view assets, check in and check out code locally, merge code and create pull requests. The Github data adapter will help you quickly expose your projects right on your mobile device.

Requirements

  • Kony Fabric
 

Features

  • Builds connection with GitHub
  • Provides a list of all GitHub APIs
  • Makes it easy for you to call GitHub APIs and view responses.

Prerequisites

  • Kony Fabric v8

A GitHub Data Adapter is a RAML based adapter that supports more than 200 APIs.

The following sections help you to use the GitHub Data Adapter component in your MobileFabric application.

Prerequisites

Before starting to use the GitHub Data Adapter, ensure to have the following:

  1. A GitHub Inc. account.
  2. An app registered in the GitHub account.
  3. Client ID and Access key as provided by GitHub Application.
  4. A Kony account and access to MobileFabric application.

Importing the GitHub Data Adapter

You can import the component into MobileFabric directly from Kony Marketplace and also by dragging / importing the component zip file.

To import the component zip file:

  1. Log on to your Kony account. The Dashboard page appears by default.
  2. In the left pane, click the API Management menu. The APIs tab opens by default.
    amadeus_api_page.png
  3. Click the Customer Data Adapters tab. The Custom Data Adapter tab opens.
    amadeus_cda_import.png
  4. Click Import. The Import Data Adapter dialog appears.
    amadeus_import_da.png
  5. Click IMPORT FROM KONY MARKETPLACE. The Import Data Adapter from Kony Marketplace dialog appears with a list of available data adapters.

  6. Click Import. The GitHub data adapter will be listed on the Custom Data Adapters tab.

github_import_da.png

To import the data adapter zip file, do the following:

  1. Perform steps 1 through 4 in the above procedure
  2. Drag the component zip file into the Drag a Data Adapter box.

    Or

    Click browse. The Open dialog appears.

    Navigate to the location where you downloaded the component (zip file) on your computer, select the component, and click Open. The Import Data Adapter dialog shows the selected component.

    Note:

    Click Remove if the selected component is not the one that you want to import.

Creating an Identity Service with GitHub

GitHub provides support for OAuth2.0. We need to configure the identity in order to access the GitHub data with less rate limit.

Create an Identity service with service type as OAuth2.0 to connect with your GitHub site and respective account.

To create an Identity service with GitHub

  1. Log on to your Kony account. The Dashboard page appears by default.
  2. In the left pane, click the API Management menu. The APIs tab opens by default.
  3. Click the Identity tab. The Identity tab opens with a list of existing identity services.
  4. Click CONFIGURE NEW. The Identity Service tab opens.
  5. In the Name box, type a unique name for your service.
  6. From the Type of Identity list, select OAuth2.0.
  7. In the Client ID box, type the Client ID provided by GitHub
  8. Type the URL in the Authorize Endpoint box and Token Endpoint box. These fields are mandatory. In the Client Secret box, type the secret key provided by GitHub. Type the

github_auth.png

Click Save.

If the details provided are valid, the MobileFabric application authenticates to your GitHub Repository and allows you to make the API calls.

Creating an Integration Service with Github

After you import GitHubData Adapter into MobileFabric, you must create an integration service with service type as GitHub to connect with your GitHub Repository.

To create an integration service with GitHub, do the following:

  1. Log on to your Kony account. The Dashboard page appears by default.
  2. In the left pane, click the API Management menu. The APIs tab opens by default.
  3. Click the Integration tab. The Integration tab opens with a list of existing integration services.
  4. Click CONFIGURE NEW. The Service Definition tab opens.

github_identity.png

In the Name box, type a unique name for your service. From the Service Type list, select GitHub.
Note:

The GitHub is listed only after you import the GitHub Data Adapter into MobileFabric.

Select Use Existing Identity Provider. Select github from the drop down list and click Test Login. On successful test log on, click Save.

If the details provided are valid, the MobileFabric service connects to your GitHub repository and allows you to make the API calls.

Refer to Integration Services for more information on creating and using integration services.

Creating an Operation

In the MobileFabric console, to make any API call, you must create an operation for the respective API and then execute the operation. Executing an operation involves making the API call and displaying the response. For more information, see Executing an Operation.

Procedure for User to log on to his GitHub account and view his/ her repositories:

  1. Log on to your Kony account. The Dashboard page appears by default.
  2. In the left pane, click the API Management menu. The APIs tab opens by default.
  3. Click the Integration tab. The Integration page appears with a list of existing integration services.
  4. From the list of integration services, select the integration service that you have created with service type, GitHub. The Service Definition tab of the selected integration service opens by default.
  5. Click the Operations List tab. The Operations List tab opens.
  6. Click the context menu arrow to expand the Please Select list. The GitHub API will be displayed.
  7. Click the Plus icon to expand GitHub API.
  8. Click the Plus icon to expand Services, and select the required operation.

github_add_op.png

Click ADD OPERATION. The selected operation will be listed under the Configured Operations section.

github_config_op.png

You can create multiple operations with required APIs and save them under Configured Operations section. You can then execute the operations when ever required.

Executing an Operation

Executing an operation involves making the API call by setting the necessary parameters and displaying the response. The procedure to execute any operation is same, but the request parameters of the APIs vary. For more information on request parameters of each API, refer GitHub API Catalog. This section provides you the procedure to execute the search of a GitHub repository which is explained in Creating an Operation.

Procedure to execute the get Repository Search API:

  1. Log on to your Kony account. The Dashboard page appears by default.
  2. In the left pane, click the API Management menu. The APIs tab opens by default.
  3. Click the Integration tab. The Integration tab opens with a list of existing integration services.
  4. From the list of integration services, select the integration service that you have created with service type, GitHub. The Service Definition tab of the selected integration service opens by default.
  5. Click the Operations List tab.
  6. Under the Configured Operations section, click the get/search/repository operation. A separate tab opens along with Request Input sub-tab opened.

github_config_op.png

In the Name box, the name of the operation is displayed by default. If you want, you can change the name. On the Request Input tab, in the Body section, for the following parameters, specify the values in the respective boxes under the Default Value column.
  • q: specify the name of the repository location.
  • sort: specify the type of sorting (fork).
  • order: Specify the default value as ascending (asc) or descending order.


github_api_params.png

Click SAVE AND FETCH RESPONSE. The Output Result dialog appears with the data requested for. Otherwise, the Output Result shows an error.

github_fetch_resp.png