If you have already written your own Confluence app, follow steps 1 to 4 to set up your local repository in such a way that you'll be able to implement a backend integration with Metadata.
Alternatively, if you have not written your own app yet, perform steps 1 and 2 and move to the step Quick Start at the bottom to start with an example.