Skip to content

ThomasLvll/API-Central

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 

Repository files navigation

API Central

Node.js RESTful API that provides management and access to different APIs, handling authentication and permissions.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Documentation
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

API Central is a Node.js API that aims to simplify access and authentication management of many APIs.

Here's a blank template to get started: To avoid retyping too much info. Do a search and replace with your text editor for the following: github_username, repo_name, twitter_handle, linkedin_username, email_client, email, project_title, project_description

Built With

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

  1. Get a free API Key at https://example.com
  2. Clone the repo
    git clone https://github.com/ThomasLvll/API-Central.git
  3. Install NPM packages
    npm install
  4. Enter your API in config.js
    const API_KEY = 'ENTER YOUR API';

(back to top)

(back to top)

Usage

API Usage Flow

1. Register into API

This step only should be performed once.

You can sign up and subscribe to API through Central web interface.

2. Request an API token

This step should be repeated each time the token expires.

You can do so by making a GET /token HTTP request to API, passing the client ID and secret keys returned in previous step as Authorization HTTP request header.

The header must strictly match the following format:

Authorization: Bearer <authToken>

where authToken is a base64-encoded string in this format:

<clientId>:<clientSecretHash>:<listOfPermissions>

where clientId obviously is your client ID key, and clientSecretHash is a hash of your client secret key. Supported hashing methods are the following:

  • MD5
  • SHA1

listOfPermissions parameter is a comma-separated list of permissions you want your API token to own.

The HTTP request finally looks like:

GET /token
Authorization: Bearer af456zjk54...

In case of success, the JSON response body has the following form:

{
	"apiToken": "kl593fkfd240...",
	"expirationDate": "2022-04-26 17:10:25.230 +00:00",
	"refreshUrl": "https://example.com/token/refresh/kl593fkfd240..."
}

3. Call the API

Once your API token has been obtained, you can make requests to endpoints of the API.

Even if not all paths require an authorization, it is recommended to always include API token in your requests. It must be passed as Authorization HTTP request header, strictly matching the following format:

Authorization: Bearer <authToken>

(back to top)

Roadmap

  • Feature 1
  • Feature 2
  • Feature 3
    • Nested Feature

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU GPLv3 License. See COPYING for more information.

(back to top)

Contact

Thomas Léveillé - leveille.thomas77@gmail.com

Project Link: https://github.com/ThomasLvll/API-Central

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published