# BuiltByBit Automation

### Step 1: Get the Webhook URL

1. Go to the **Integrations** page on SunLicense.
2. Select your product.
3. Copy the **Webhook URL**.
4. The webhook URL should be in the following format:

   ```
   {yourdomain}/api/v1/bbb/{productId}
   ```

### Step 2: Create a Placeholder in BuiltByBit

1. Navigate to the **Placeholders** page in BuiltByBit: [BuiltByBit Placeholders](https://builtbybit.com/resources/dashboard/placeholders)
2. Click on **Create New Placeholder**.
3. Set the placeholder name to something like:

   ```
   %%__MyProduct_License__%%
   ```
4. Set **Type** as `External License Key`.
5. Paste the copied **Webhook URL** in the URL field.
6. Copy the **Secret Key** from the SunLicense **Integrations** page.
7. Paste the secret key in BuiltByBit.
8. Save the placeholder in BuiltByBit.

### Step 3: Use the Placeholder in Your Product

1. When using SunLicense API with your product, assign the placeholder string to the license key variable.
2. Example usage in Java:

   ```java
   String key = "%%__MyProduct_License__%%";

   SunLicenseAPI api = SunLicenseAPI.getLicense(
       key,     // License key
       1,       // Product ID (integer)
       "1.0.0", // Product version
       "http://yourdomain.com/" // API endpoint
   );

   api.validate();
   ```

### Step 4: Automatic License Assignment

* When users download your product, BuiltByBit will automatically create a new license in SunLicense.
* The placeholder `%%__MyProduct_License__%%` will be replaced with the user's actual license key.
* The user's downloaded product will be validated automatically without requiring manual input of the license key.

Now your BuiltByBit product is successfully integrated with SunLicense for seamless license management!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sunlicense.hapangama.com/automations/builtbybit-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
