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
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
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.
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
- Get a free API Key at https://example.com
- Clone the repo
git clone https://github.com/ThomasLvll/API-Central.git
- Install NPM packages
npm install
- Enter your API in
config.js
const API_KEY = 'ENTER YOUR API';
This step only should be performed once.
You can sign up and subscribe to API through Central web interface.
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..."
}
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>
- Feature 1
- Feature 2
- Feature 3
- Nested Feature
See the open issues for a full list of proposed features (and known issues).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU GPLv3 License. See COPYING
for more information.
Thomas Léveillé - [email protected]
Project Link: https://github.com/ThomasLvll/API-Central