Overview
Welcome to the Bambu API's developer hub. Here you will find comprehensive guides and documentation to help you start working with our APIs, as well as meaningful insights & support.
We have created a set of simple to employ RESTFUL APIs, ensuring you can easily integrate into any application irrespective if it is a web or mobile, existing or new.
What are you still waiting for? Start using our APIs today!
Please refer to Terms of Use before using our API.
Authorization
Relevant credentials are needed to access all the Bambu Calculator Collection APIs.
You will need to create a new account with us in order to test our APIs.
Create an Account and Generate an API Key
- Create a new user account with POST
/api/user
// Request Body
{
"username": "testuser",
"email": "[email protected]",
"password": "XXXXXXX"
}
// Response Body
{
"id": "308efe70-2d2c-11ea-ba7c-d58de15e5bca",
"username": "testuser",
"email": "[email protected]"
}
-
You will receive an email with a link. Simply click on that link to verify your email address.
-
Generate a Bearer Token with your username and password. POST
/client-login
// Request Body
{
"username":"testuser",
"password":"XXXXXXX"
}
// Response Body
{
"access_token": "P62VLToAfNgXBGmdQ4DFe4d7Eaw1Co4ms",
"expires_in": 1209600,
"scope": "basic",
"refresh_token": "t9RoypeNQxUFSgqFbWuGzFPicxL6472E",
"token_type": "Bearer"
}
- Generate an API key with your Bearer Token. POST
/api/apiKey/generateApiKey
Key | Value |
---|---|
Authorization | Bearer P62VLToAfNgXBGmdQ4DFe4d7Eaw1Co4ms |
// Response Body
{
"key": "fa966c9db6d84a97ad147e29"
}
Start Using our APIs
Once you have created an API key, you can begin using our APIs.
Here is an example of how to pass in the API key to the rest of the APIs
GET /api/country/v1/getCountryByCountryCode/US
Key | Value |
---|---|
Authorization | Bearer fa966c9db6d84a97ad147e29 |
// Response Body
{
"country": [
{
"code": "US",
"international_dialing_code": "1",
"currency_code": "USD",
"flag": "https://restcountries.eu/data/usa.svg",
"cioc": "USA",
"name": "United States of America",
"demonym": "American",
"cca2": "US",
"cca3": "USA",
"ccn3": "840",
"id": "USA"
}
],
"success": true
}
Testing
You may use your access token to test the API for your application through the API Console. Here are the steps to use the API console:
- Click on GET/POST to expand the call method details, then fill in the keyword parameter(s).
- Click on the "Try it" button to see the response, request URL and cURL of the API call.
To integrate the API into your application, simply add the provided Key in the HTTP header (e.g. Authorization: Bearer eyXXXXXXXXXXXXXXXXX)
Responses
The response object provides an HTTP status code, which indicates whether a call has succeeded or failed. Status codes:
-
HTTP Status Code: 200
Indication: Successful -
HTTP Status Code: 4xx/5xx
Indication: Failed. The response body will provide more details of the error
Updated 10 days ago