Access and modify all the resources of our Wiki.js using WikiJS API
Hi everyone 😎 , Today we are going to see how to access or modify WikiJS resources using WikiJS API. WikiJS exposes GraphQL API to access and modify the stuff according to our requirements.
So In this blog post, we going to see
- How to set up WikiJS's local environment using docker.
- How to generate an API token in Wikijs.
- Using API tokens how to access WikiJS resources and how to modify them.
First Local Setup using docker
Here I am using docker to set up my local isolated WikiJS environment. Below is my docker-compose.yml file written by WikiJS contributors.
To build the WikiJS environment we just need to run the following command
docker-compose up -df [PATH_OF_DOCKER_COMPOSE_YML_FILE]
docker ps
Second Generate API token
After setup our local environment we are ready to create our initial Administrator account in our WikiJS.
1. On the browser type localhost:80
2. Create an Administrator account
- Email: localhost@gmail.com
- Password: admin@123
- Site URL: http://localhost
3. After login we see initial page of WikiJS.
By default GraphQL API is disabled so first, we have to click on the Enabled API button and thereafter we have to click on the New API Key button to generate an API token.
Now we are going to pass values in the New API Key form to generate a new API
- Name: Testing
- Expiration: 1 year
- Full Access: Checked
Note: Please copy the API token carefully.
Third, using API tokens to access WikiJS resources and modify them
Reference
- WikiJS GraphQL API https://docs.requarks.io/dev/api
- WikiJS Installation https://docs.requarks.io/install
Comments
Post a Comment
Please give us your valuable feedback