> For the complete documentation index, see [llms.txt](https://docs.sketchub.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sketchub.in/v2/download.md).

# Download

## Download a project (With authentication)

<mark style="color:green;">`POST`</mark> `https://sketchub.in/api/v2/download_project.php`

This endpoint will allow users to download any public project, or their own private project.

No matter what file type is uploaded, it will download as zip.

The link generated by this endpoint is cleared every 24 hours.

**Body**

<table><thead><tr><th width="237">Name</th><th width="192">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>uid</code></td><td>number</td><td>User ID</td></tr><tr><td><code>project_id</code></td><td>number</td><td>Project ID</td></tr><tr><td><code>email</code></td><td>string</td><td><a href="/v2/introduction.md#public-rsa-key">RSA</a> Encrypted Email</td></tr><tr><td><code>password</code></td><td>string</td><td><a href="/v2/introduction.md#public-rsa-key">RSA</a> Encrypted Password</td></tr><tr><td><code>api_key</code></td><td>string</td><td>Your API key</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": "success",
  "message": "https://sketchub.in/storage/cache/123123123.zip",
  "status_code": "OK"
}
```

{% endtab %}
{% endtabs %}

## Download a project (Without authentication)

<mark style="color:green;">`POST`</mark> `https://sketchub.in/api/v2/download_project_guest.php`

This endpoint will give access to public projects only, but it requires one of the following: `hcaptcha_response` or `access_token`

* Use provided Hcaptcha [site key ](/v2/introduction.md#public-hcaptcha-site-key)to generate `hcaptcha_response` when needed.&#x20;

**Body**

| Name                                                 | Type   | Description                                                                                                                                       |
| ---------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_id`                                         | number | Project ID                                                                                                                                        |
| <p><code>hcaptcha\_response</code><br>(optional)</p> | string | Token by hCaptcha.                                                                                                                                |
| <p><code>access\_token</code><br>(optional)</p>      | string | Temporary JWT access token which is generated when you pass **hcaptcha\_response.** [Learn more.](#how-access-token-works-in-project-downloading) |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": "success",
  "message": "https://sketchub.in/storage/cache/123123123.zip",
  "new_access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2FnZV9saW1pdCI6MSwiZXhwaXJlc19hdCI6MTcxODMzNTMyODAwMH0.yC7RdCG862PgiUOn6RvDPihT43Vk6iEu8SHMW0wJwHg"
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
If the above response have **new\_access\_token**, you can use it instead of **hcaptcha\_response** in next download request within 24 hours.&#x20;
{% endhint %}

{% hint style="danger" %}
In above response **new\_access\_token** might be missing, it happens when you reaches token usage limit. To get the new token, you should pass **hcaptcha\_response** in next download request.
{% endhint %}

#### How access token works in project downloading?

This endpoint exchange hcaptcha response for temporary [JWT](https://jwt.io/) token. But the tokens can be used 10 times only within 24 hours. It works in this way:

<mark style="color:green;">**->**</mark> You provide **hcatpcha\_token** and project id\ <mark style="color:red;">**<-**</mark> Server provides you **access\_token** (10) and project download link\ <mark style="color:green;">**->**</mark> You dont need to solve hcaptcha again and again, just provide the **access\_token** (10) and another project id\ <mark style="color:red;">**<-**</mark> Server provides you **access\_token** (9) and project download link\ <mark style="color:green;">**->**</mark> You provide **access\_token** (8) and another project id\ <mark style="color:red;">**<-**</mark> Server provides you **access\_token** (7) and project download link\
*... and so on ...*\ <mark style="color:red;">**<-**</mark> Server provides you **access\_token** (1) and project download link\ <mark style="color:green;">**->**</mark> You provide **access\_token** (1) and another project id\ <mark style="color:red;">**<-**</mark> Server provides you project download link only (in next request, provide **hcaptcha\_token** again)

Please note that in above example, the numbers mean the number of series you can use the tokens (10 by default), once you reach the usage limit, it will not bounce back new token, and you will need to solve captcha again.

This method was founded for avoiding user to solve captcha everytime when they downloads the project. Perhaps, they only need to solve it once after 10 downloads in a day.<br>
