Groundhogg provides a RESTful API which allows users to retrieve data remotely using a JSON format. Using the RESTful API users can manage contacts, emails, funnels and tags remotely.
In order to enable Groundhoggs REST API you need to go to Groundhogg->Settings->API and select enable Groudhogg API and click on save changes.
Once you enable the API you can see new routes in your website. To view all the Groundhogg endpoints available go to following link.
Here you can see new namespace is added which is gh/v2/ and you can also able to view all the endpoints are available for the Groundhogg with the required HTTP methods and required params for each endpoint.
The Groundhogg API provides direct access to admin methods thus, authentication is an inevitable part of using the API.
Users needs to provide a public key and token to access API. To create keys for any user of your website select a user from the drop down list on the API settings page and click on [Generate New API Keys]. Using these new keys your users will be able to access the API.
Both the API key and the token need to be appended to the URL as query parameters or you can also pass key and token as an argument in the JSON body section if you add body section in your HTTP request.
For example the following url returns list of all the contacts on your website.
https://yoursite.com/wp-json/gh/v2/contact?key=[API key here]&token=[token here]
All the API calls check for the user permission. All the API keys linked with the users thus if