I have a python code that's updating an existing confluence page with some data. I want to include a html link/button for users so that when they click this on confluence page it would trigger to make a call in the backend python code for jenkins API for job build and update with the new data on confluence page.
I know how to make API call using requests in python code for jenkins api and get the data but how can I hook this html link with python function that would trigger this api call? Is it possible ? Or do I have to use Ajax or something else?
Here is payload for my confluence API to update page where data is a var containing html string.
payload = {'id': page_id, 'type': 'page', 'status': 'current', 'title': 'Report', 'space': {'key':'XXXX'}, 'ancestors':[{'id':parent_page_id}], 'body': {'storage': {'representation': 'storage', 'value': '<p><b>This page is auto-generated. In case you want manually update this page click </b><a href="url">here</a></p>' + data}}, 'version': {'number': existing_version, 'minorEdit': 'true'}}