# API

Hier findest du eine Anleitung zu unserer API.

## Schritt 1: API Key

{% hint style="danger" %}
WICHTIG: Gebe den API Key an niemanden weiter. Er erhält sonst Rechte Lizenzen zu erstellen!
{% endhint %}

Gehe auf unser [License Panel](https://license.wavecore.dev) und klicke auf den Tab [Account Einstellungen](https://license.wavecore.dev/own-settings/). Unter diesem Tab siehst du unten einen grünen Button der "API Key kopieren" heißt. Der API Key ist jetzt in deiner Zwischenablage.

## Schritt 2: API Abfrage (Create License)

Um die API nutzen zu können, musst du eine Abfrage z.B. in deine Website einbauen. Hier sind ein paar Code Vorlagen

### PHP

```php
<?php

$data = array(
    "apikey" => "YOUR API KEY",
    "userid" => "DISCORD USER ID (TO GIVE LICENSE)",
    "script" => "SCRIPT ID"
);

$data_json = json_encode($data);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.wavecore.dev/create-license");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_json)
));

$response = curl_exec($ch);

echo $response;

curl_close($ch);

?>
```

### Python

```python
import requests
import json

data = {
    "apikey": "YOUR API KEY",
    "userid": "DISCORD USER ID (TO GIVE LICENSE)",
    "script": "SCRIPT ID"
}

data_json = json.dumps(data)

url = "https://api.wavecore.dev/create-license"

headers = {
    'Content-Type': 'application/json',
    'Content-Length': str(len(data_json))
}

response = requests.post(url, data=data_json, headers=headers)

print(response.text)
```

apikey = Hier kannst du deinen API Key einfügen.\
userid = Das ist die Discord User ID des Lizenz Besitzers. Also wenn du die Lizenz geben willst\
scriptid = Das ist die ID deines Scripts. Wenn du nicht weißt wie man die herausfindet, dann klicke [hier](/wavecore/faq/wie-finde-ich-meine-script-id-heraus.md) drauf.

## Schritt 2: API Abfrage (Set IP)

Um die API nutzen zu können, musst du eine Abfrage z.B. in deine Website einbauen. Hier sind ein paar Code Vorlagen

### PHP

```php
<?php

$data = array(
    "apikey" => "YOUR API KEY",
    "userid" => "DISCORD USER ID (TO GIVE LICENSE)",
    "script" => "SCRIPT ID",
    "setip" => "NEW IP"
);

$data_json = json_encode($data);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.wavecore.dev/set-ip");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_json)
));

$response = curl_exec($ch);

echo $response;

curl_close($ch);

?>
```

### Python

```python
import requests
import json

data = {
    "apikey": "YOUR API KEY",
    "userid": "DISCORD USER ID (TO GIVE LICENSE)",
    "script": "SCRIPT ID",
    "setip": "NEW IP"
}

data_json = json.dumps(data)

url = "https://api.wavecore.dev/set--ip"

headers = {
    'Content-Type': 'application/json',
    'Content-Length': str(len(data_json))
}

response = requests.post(url, data=data_json, headers=headers)

print(response.text)
```

apikey = Hier kannst du deinen API Key einfügen.\
userid = Das ist die Discord User ID des Lizenz Besitzers. Also wenn du die Lizenz geben willst\
scriptid = Das ist die ID deines Scripts. Wenn du nicht weißt wie man die herausfindet, dann klicke [hier](/wavecore/faq/wie-finde-ich-meine-script-id-heraus.md) drauf.\
setip = Neue IP-Adresse für die Lizenz

## Schritt 3: Dinge zum Beachten

Beachte das man für einen reibungslose API Kontakt folgendes benötigt:

* Gültigen API Key (nicht gesperrt)&#x20;
* Gültiges Benutzerkonto
* Ausreichende Lizenzen
* Funktonierendes Script im Panel


---

# 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.wavecore.dev/wavecore/license-system-1/api.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.
