Introducing Tilaa's GraphQL Cloud API:
Tilaa's public GraphQL-API provides you with a set of tools and endpoints to set up your Serverless Containers and Cloud Databases. For managing your VPS and everything related to it, take a look at our Restful API.
Please note: For now, we need to manually enable your API user account for use with the GraphQL-API. Please contact us directly to have an API user enabled.
Getting started:
All GraphQL API calls require Bearer Authentication.
For security reasons you cannot use your main Tilaa user account to access this API. Instead, you should add an API user to your customer account and use the specified login credentials to authenticate.
More information about creating an extra user can be found here: HowTo - Create an extra user
This will require a unique and validated email address, which we will also use to notify you about important API related announcements, such as deprecation notifications, new features and maintenance windows.
For testing the API more easily, we advise you to install the GraphiQL extension in your browser.
Using GraphiQL, you can explore the API schema, compose GraphQL operations and execute them to get a response. In other words, a nice interactive playground!
Using https://graphql.tilaa.com/ from the GraphiQL extension gives you easy access to try out our API.
Authentication:
With your API account, you can authenticate using the following request:
curl -d 'grant_type=password&client_id=cloud-tilaa&username=&password=' -X POST https://auth.tilaa.com/realms/tilaa/protocol/openid-connect/token
In the response you'll find the OAuth 2 access token (valid for 1800 seconds). Using the access_token in the response as bearer token in all the following API calls for authentication, you can do everything you need from our platform.
Refresh access token
To get a new access token with the use of the refresh token you can use the following request:
To get a new access token with the use of the refresh token you can use the following request:
curl -d 'grant_type=refresh_token&client_id=cloud-tilaa&refresh_token=' -X POST https://auth.tilaa.com/realms/tilaa/protocol/openid-connect/token
A refresh token is also generated which can be used to renew the access token. Check https://oauth.net/2/ for more information on OAuth.
Creating the first query:
The API is based on GraphQL. To learn more about GraphQL, visit https://graphql.org/learn/.
An example query would be to try to retrieve our account details:
query { account { id role email name customer { id tag address { streetNameAndHouseNumber postalCode city country } termOfPayment billingPeriod recurringPayment ... on Business { vatNumber } } } }
And don't forget to add your token to the call!
The entire list of available queries is shown in the list retrieved by the browser extension.
If you have any questions, issues, or feedback, our support team is here to help. Visit our Support Page to create a ticket or reach out to support@tilaa.com.
Comments
Please sign in to leave a comment.