# Cloudflare R2 Integration via LowCodeAPI

## Overview

Custom made Object Storage APIs for Cloudflare R2.

## Base Endpoint

```
https://api.lowcodeapi.com/cloudflare-r2/
```

## Authentication

LowCodeAPI handles authentication automatically. You only need to:

1. **Sign up** at [https://developers.cloudflare.com/r2](https://developers.cloudflare.com/r2)
2. **Get your credentials** from [https://dash.cloudflare.com/](https://dash.cloudflare.com/)
3. **Connect your account** in LowCodeAPI dashboard
4. **Use your `api_token`** in all requests

The `api_token` is your LowCodeAPI authentication token. LowCodeAPI will automatically:
- Fetch your Cloudflare R2 credentials
- Apply them to each request

**Auth Type**: API Key

## API Categories

- File Sharing & Collaboration

## Common Endpoints

### Category: Signed URL

#### Generate signed url for R2

**Method**: `GET` | **LowCodeAPI Path**: `/signed-url`

**Full URL**:
```
https://api.lowcodeapi.com/cloudflare-r2/signed-url?...&api_token={api_token}
```


**Query Parameters**:

| `key_name` | string | Yes | File name to be signed |
| `type` | enum | No | Request type |
| `expires_in` | number | No | Expire the signed url after this duration (in second). Default : 300 seconds |


**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/cloudflare-r2/signed-url?...&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

**Official Documentation**: [https://developers.cloudflare.com/r2/api](https://developers.cloudflare.com/r2/api)

---

#### Signed url for fetching file object

**Method**: `GET` | **LowCodeAPI Path**: `/signed-url/for-fetch`

**Full URL**:
```
https://api.lowcodeapi.com/cloudflare-r2/signed-url/for-fetch?...&api_token={api_token}
```


**Query Parameters**:

| `key_name` | string | Yes | File name to be signed |
| `expires_in` | number | Yes | Expire the signed url after this duration (in second). Default : 300 seconds |


**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/cloudflare-r2/signed-url/for-fetch?...&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

**Official Documentation**: [https://developers.cloudflare.com/r2/api](https://developers.cloudflare.com/r2/api)

---

#### Signed url for uploading file object

**Method**: `GET` | **LowCodeAPI Path**: `/signed-url/for-upload`

**Full URL**:
```
https://api.lowcodeapi.com/cloudflare-r2/signed-url/for-upload?...&api_token={api_token}
```


**Query Parameters**:

| `key_name` | string | Yes | File name to be signed |
| `acl` | enum | No | ACL of the file object, only applicable for upload. Default: private |
| `expires_in` | number | No | Expire the signed url after this duration (in second). Default : 300 seconds |


**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/cloudflare-r2/signed-url/for-upload?...&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

**Official Documentation**: [https://developers.cloudflare.com/r2/api](https://developers.cloudflare.com/r2/api)

---

## Usage Examples

### Example 1: Basic Usage

Get started with Cloudflare R2 API by making your first request.

```bash
# Your example code here
# This demonstrates basic usage
curl -X GET "https://api.lowcodeapi.com/cloudflare-r2/?api_token=YOUR_API_TOKEN"
```

### Example 2: Advanced Usage

Explore more advanced features and parameters.

```bash
# Your example code here
# This demonstrates advanced usage
curl -X GET "https://api.lowcodeapi.com/cloudflare-r2/?api_token=YOUR_API_TOKEN"
```

## Complete Endpoint Reference

For a complete list of all endpoints and their parameters, refer to:
- **OpenAPI Definition**: `https://backend.lowcodeapi.com/cloudflare-r2/definition`
- **Official Provider Documentation**: [https://developers.cloudflare.com/r2/api](https://developers.cloudflare.com/r2/api)

## Rate Limits & Best Practices

- Check your Cloudflare R2 account for specific rate limits
- Use appropriate error handling and retry logic
- Cache responses when appropriate to reduce API calls

## Error Handling

Standard HTTP status codes apply:
- `400` - Invalid request parameters
- `401` - Unauthorized (check your API key)
- `429` - Rate limit exceeded
- `500` - Internal server error