Bunny's GraphQL API lets you create trial subscriptions, track feature usage, update accounts, contacts, quotes and almost all other objects that you can see in the web user interface.
To interact with with Bunny API you will need to follow these steps:
Get an access token
All requests to Bunny require an Access Token to be sent in an Authorization header. To get started quickly you can generate an access token directly in the Bunny admin portal or alternatively you can obtain the client credentials for an API client and generate an access token using an SDK.
In Bunny, go to Settings > API Clients
Select the Default API client
Click the Generate Access Token button and copy the token
Send a GraphQL request
The Bunny SDKs offers convenience methods for some of the common GraphQL requests as well as a raw query method so that you can build your own queries. .
For example, if a new trial has signed up in your SaaS application then you will track this in Bunny using the convenient subscription creation methods.
GraphQL is pretty simple in the sense that you're always just sending a HTTP POST request with a specially formatted body. Within that request body you will be asking graphal to perform either a query or a mutation.