...
Expand | ||
---|---|---|
| ||
The API access key needs to be treated as password. Thus we create in config.json a custom field named ‘key' of type 'Password’ and store in it the personal Atlassian API access key, respective to the user name in use. |
Expand | ||
---|---|---|
| ||
The custom method should do most the guts of the adapter. Most web APIs have some magic sauce that you have to make an API call. The custom method does this and should make it easy to call methods on the API which have not been wrapped explicitly. Let’s call our new Custom method ATTLdescendants. We can rename ATTLhello into ATTLdescendants and to rewrite its content. This method will help us to invoke the API method ATTLgetDescendants. |
Expand | ||
---|---|---|
| ||
Let’s call our new API method ATTLgetDescendants. We can rename ATTLcustom into ATTLgetDescendants and to rewrite its content. This method will returns all pages in a space. |
Expand | ||
---|---|---|
| ||
Sometimes an API method would require a parameter which can be discovered only programmatically. In our example of Confluence Adapter this is Confluence Space Id parameter, which isn’t the same as a Space Key above. The API method ATTLgetSpaceId will help us to discover this value. Let’s create new Lua file, name it ATTLgetSpaceId and write its content. |
Expand | ||
---|---|---|
| ||
Append to Client’s meta table the three newly added methods and the ‘space_id’ variable declaration
|
...