CREATE A CONNECTOR
Create a connector
In the BO, click on “Connectors”. A list of connectors appears:
Add a connector
Click on the “Add Connector” button:
- Title: connector name
- Type : format of the data that will be recovered, by default this format will be JSON type.
- On (Y/N)
- Called by: Default “Server
- Cache: Default “Cache”
- Method: data recovery method, default “GET”.
- Url: Url that will allow to recover a set of data. For example, all articles created in WordPress will be retrieved by this Url: https://support.t.shapper.com/wp-json/wp/v2/posts/.
Test the Webservice
By clicking for example on the line “categories” the 2 lines “0: 46” and “1: 48” appear in the sub-menu. These 2 values (ID) correspond to the information entered in this element: “News” and “Cultural”.
Tip: to really know what these 2 values correspond to, you have to go to WordPress on the menu “Articles” then “categories”. Position the mouse on the name of the category, and a line will appear at the very bottom of the screen with information where is written: ID=…
In our example, if you put the mouse on “News” it will appear ID=46 and on “Culture” ID=48.
In “Articles” and then “Labels”, if you put the mouse on “Book”, ID=50 will appear.
We are now going to set up the filter parameters: in the BO, click on the “Add a parameter” button, and a “Key” and “Value” line will appear.
For our example, we will filter via the subcategory “Cultural”: so “Key” = “Categories” and “Value” = “48” (which corresponds to “Cultural”). If you then click on “Test the webservice”, you can see that only one element remains (above the dark frame).
If needed, it is possible to add as many parameters as necessary to filter the right elements correctly.
Choosing and setting up the information for each element
Once you have agreed on the selected elements, you must choose to set up the desired fields.
By default, a retrieved element will be installed in the application in a “Page” type element.
Everything is done by mouse click. To the left of the dark frame, there is the set of 5 tabs that form the information of an element of the application (with in addition a first value named: “Identifier”).
Make sure that in the field “Mapper tree” there is “0”.
Manip to do to get the “id” info:
- Click on the input field “Identifier” (the cursor blinks)
- In the dark frame click (one click only) on the first field “id”: you will see {id} in the input field “ID”. Caution: a double click will make {id} appear twice, if this is the case you can manually delete the extra info.