|
| 1 | +# BlueSpice & KB |
| 2 | + |
| 3 | +To communicate and integrate with EasyProject app our KnowlegeBase require one Rys which is BlueSpice. |
| 4 | +It is well known that both projects needs testing and API adjustments from time to time as KnowledgeBase works on Wiki. |
| 5 | +In this section we will try to describe how to work with those projects when you want to make sure what is going on. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Wiki API |
| 10 | + |
| 11 | +Most of the requests is common for each wiki app. You can find it documented [HERE](https://www.mediawiki.org/w/api.php). |
| 12 | +Also each knowledge base which is created by us contains it, so for example you can also check it on Easy KB, [HERE](https://www.es-kb.easysoftware.com/w/api.php). |
| 13 | +That part is helpful to understand the response and request made in case something is not working well, or the API was changed. |
| 14 | + |
| 15 | + |
| 16 | +## Postman Testing |
| 17 | + |
| 18 | +Now let's focus on step-by-step how-to in case you would like to test kb locally. |
| 19 | + |
| 20 | +To test our KnowledgeBase the best way is to use [Postman](https://www.postman.com/) to check the response output or what is happening under the hood. |
| 21 | +In this section we will focus on how to setup environment on Postman to be able to make it working. |
| 22 | +In a files folder you will find sub-folder called Postman. |
| 23 | + |
| 24 | +You will find there 2 files. |
| 25 | +1. BlueSpice postman environment which contains variables needed to make the API calls working. Lets describe them one by one. |
| 26 | + |
| 27 | +* **kb-url** => It is a address of your KnowledgeBase url. You can take it from Kb deployment. |
| 28 | +* **client_id** => This is something you will find in the same place as the URL |
| 29 | +* **client_secret** => same as above |
| 30 | +* **access_token** => to get that one you need to do a API call. It will be describe later in this article |
| 31 | +* **username** => it is an login of the user you want to use (usually the one you are logged as in EasyProject app) |
| 32 | + |
| 33 | +To use this environment you simply need to import this file to Postman. |
| 34 | +To do that go to the app and on the left side select tab called Environments. |
| 35 | +Then click Import button which is placed on the top right under the top bar menu |
| 36 | +When you import BlueSpice environment hover over it and you will see thick icon. Check it and you will set the environment to active state. |
| 37 | + |
| 38 | +2. BlueSpice postman collection which contains collection of API calls that can be useful for you for testing our KB application. |
| 39 | +Each of the API call contains few tabs that are important to you to know. |
| 40 | +There are: |
| 41 | +- Auth tab - most of the API calls will require access_token mentioned previously |
| 42 | +- Headers - probably for most of the time it will not be bothering you |
| 43 | +- Body - some data (depends on the call) is required to be send in body, this is for example a case for sending client_id or client_secret, so make sure your data is there |
| 44 | + |
| 45 | + |
| 46 | +Let's describe the most important calls now. |
| 47 | + |
| 48 | +**POST Get access token action** |
| 49 | + |
| 50 | +This action is the one you need to call always to get the user access_token. This one is used to authorize user to KB. |
| 51 | +As we mentioned previously the access_token will be used in Auth tab for most of the API calls. |
| 52 | + |
| 53 | +**GET References** |
| 54 | + |
| 55 | +This action is used for checking the articles connected to specific Task/Issue. It should return list of articles assigned to it. |
| 56 | +As a parameter it use: |
| 57 | +* type: example: issues |
| 58 | +* id: #id of issue |
| 59 | + |
| 60 | +**PUT Add Reference** |
| 61 | + |
| 62 | +This action is used for adding KB article to Issue. In a body of this request you will find exemplary structure that you should keep for a successful connection. |
| 63 | +You can also find it below: |
| 64 | +``` |
| 65 | +{ |
| 66 | + "references": { |
| 67 | + "entityType": "Issue", |
| 68 | + "entityId": "778", |
| 69 | + "pagename": "Check_%2B_verify_url_encoded_titles" |
| 70 | + } |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +**DELETE Reference** |
| 75 | + |
| 76 | +This is pretty self-explanatory. It is used for removing referenced article from the Issue. |
| 77 | + |
| 78 | +**PUT Sync groups** |
| 79 | + |
| 80 | +This request is also pretty important. It correspond to EasyProject button placed in blue_spice/rys_management on the bottom of page, |
| 81 | +called **Update Permissions**. It is used to make sure that user permission is up to date. Thanks to this either user has or has not access to knowledge base. |
| 82 | + |
0 commit comments