> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.salamoonder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payload

> Each request in this task is priced at only €0.0005. 

<Warning>
  **Attention**

  Copy this user-agent precisely. Deviations will produce unexpected or broken responses.

  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
</Warning>

## Create Task​

Create the task with the [<u>createTask</u>](https://apidocs.salamoonder.com/endpoint/createTask) endpoint, or use our [<u>Software Development Kit</u>](https://apidocs.salamoonder.com/sdk/official) to make your integration process even easier!

### Task Structure

| **Property**     | **Type** | **Required** |
| ---------------- | :------: | :----------: |
| `type`           |  String  |      Yes     |
| `url`            |  String  |      Yes     |
| `script_content` |  String  |      Yes     |
| `script_url`     |  String  |      No      |

### **Example Request**

```json theme={null}
POST https://salamoonder.com/api/createTask
Host: salamoonder.com
Content-Type: application/json

{
    "api_key": "YOUR_API_KEY",
    "task": {
        "type": "KasadaPayloadSolver",
        "url": "https://www.whatnot.com/",
		"script_url": "https://www.whatnot.com/../../ips.js?KP_UIDz=0....",
		"script_content": "KPSDK.scriptStart=KPSDK.now();((function()....",
    }
}
```

Upon successfully submitting the task to us, you should receive a 'taskId' in the response.

### Example Response

```json theme={null}
{
  "error_code": 0,
  "error_description": "",
  "taskId": "d4611a5f-9b4e-4f4a-94a2-8303d97562e1"
}
```

**Response Fields:**

* `taskId` - Unique identifier for this task. Use this to retrieve results.

## **Getting Results**

Retrieve the results using the [<u>getTaskResult</u>](https://apidocs.salamoonder.com/api/gettaskresult-task-result) method. or use our [<u>Software Development Kit</u>](https://apidocs.salamoonder.com/sdk/official) to make your integration process even easier!

### **Example Request**

```json theme={null}
POST https://salamoonder.com/api/getTaskResult
Host: salamoonder.com
Content-Type: application/json

{
  "api_key": "YOUR_API_KEY",
  "taskId": "d4611a5f-9b4e-4f4a-94a2-8303d97562e1"
}
```

### Example Response

<Warning>
  The returned payload is base64 encoded. You must decode it before sending it. Our SDK can handle this for you and keeps things simple.
</Warning>

```json theme={null}
{
    "errorId": 0,
    "solution": {
        "headers": {
            "x-kpsdk-ct": "02ZDV4Wf8UnQrrkylUAizpCB8ASqkRLkm6...",
            "x-kpsdk-dt": "12mx37w425vz64hz04plwa1z10w78w81t5...",
            "x-kpsdk-im": "AALI-09Hz2cchHDvUL2BZJxUn9WAK9sZzn...",
            "x-kpsdk-v": "j-1.2.118"
        },
        "payload": "base64_encoded_payload",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win6..."
    },
    "status": "ready"
}
```

**Response Fields:**

* `x-kpsdk-*` - Header values that need to be sent to the /tl endpoint.
* `payload` - Payload to post to /tl which will give you the validated data.
* `user-agent` - User-Agent that was used to make this payload.

## Quick Start Example

We have examples for all our tasks to streamline integration. Feel free to check them out!

<Card title="Payload Examples" icon="sparkles" href="https://apidocs.salamoonder.com/examples#kasada-payload-examples">
  All our Kasada Payload Examples can be found here!
</Card>

## Common Troubleshooting

Because we rely on the data you provide, small discrepancies, such as mismatched user-agents, can occasionally cause issues.

### Not getting a 200 and `"reload": true` from `/tl`?

If the `/tl` endpoint does not return a 200 response with `"reload": true`, the request has failed. Please verify the following:

1. The correct `user-agent` is being used.
2. The same `user-agent` is sent with **every** request, not just the POST.
3. All required headers are included in the POST request to `/tl`.
4. The request body is decoded **before** being sent.

If you've checked all of the above and are still experiencing blocks or errors, please reach out to our support team via [Telegram](https://t.me/salamoonder_bot) or <Tooltip tip="support@salamoonder.com">**Email**</Tooltip>.

### Receiving a token but still getting blocked?

There are a variety of reasons this can happen, but let's start with the most common. Please verify the following:

1. You are proxying **all** requests, preferably with a sticky session.
2. You are using a well-crafted TLS client.
3. You are **not** posting the `kpsdk-v` value to the protected endpoint.

If you've checked all of the above and are still experiencing blocks or errors, please reach out to our support team via [Telegram](https://t.me/salamoonder_bot) or <Tooltip tip="support@salamoonder.com">**Email**</Tooltip>.
