Principles of the API
The TokenForge Core backend API is accessible as both a REST API and GraphQL. However, the REST API is more advanced and covers more aspects than the GraphQL API. Both approaches are currently being intensively developed. The GraphQL API is also diligently catching up.
At the time of writing we commend to use the REST-API for the following operations:
Create
Update
Delete
while the GraphQL-API should be used for READ-operations on our resources and its descendants. If you encounter issues using GraphQL, please refer to the REST-API implementation first.
REST-API
Our REST-API can be easily discovered via Swagger. Authentication requires JSON WebToken (JWT). However, not all API Endpoints requires authentication. For instance, all these data that should be available for rendering a Storefront, are accessible without any authentication:
Countries
Locales
Categories (”Taxon”)
Products
Supported currencies
Exchange Rates
Customer Groups
Collections
User Roles
At the time of writing, we offer Version 2 of our Core Backend API which can be reached with:
Swagger can be always accessed via:
GraphQL
GraphQL can be access via
A good starting point with “boarding aid” would be to use GraphiQL, an in-browser tool for writing, validating, and testing GraphQL queries:
Type queries into the left part of the screen and you will see intelligent typeaheads aware of the current GraphQL type schema and live syntax and validation errors highlighted within the text. On the right side of the screen, the corresponding results are displayed.
GraphiQL can be accessed under the following URL:
Another option would be to use the GraphQL Playground which offers a way more sophisticated UI in order to build and test queries. It also offers a typeahead for existing properties and available entities:
The GraphQL-Playground can be accessed on your backend via:
Last updated