Skip to content

Getting Started

This guide will help you quickly get started with the PinkCloudSync service.

Prerequisites

Before you begin, make sure you have:

  • An active PinkCloudSync account
  • API key and secret (obtain from the console)
  • Basic knowledge of REST APIs
  • An installed tool for working with APIs (curl, Postman, or Python)

Quick Start Checklist

Follow these steps to get started:

  • Create a PinkCloudSync account
  • Obtain API keys from the console
  • Make your first authentication request
  • Test API access with a simple query
  • Review rate limits and best practices

Obtaining API Keys

To work with the API, you'll need an API key and secret1.

  1. Log in to the PinkCloudSync console.
  2. Navigate to the API Keys section.
  3. Click Create New Key.
  4. Save the API key and secret in a secure location.

Important

The API secret is displayed only once during creation. If you lose it, you'll need to create a new key.

Base API URL

All API requests are sent to the base URL:

1
https://api.pinkcloudsync.example/v1

For testing, use the sandbox environment:

1
https://sandbox.pinkcloudsync.example/v1

First Request

Let's make your first API request — obtaining an access token.

1
2
3
4
5
6
curl -X POST https://api.pinkcloudsync.example/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "pk_live_abc123",
    "api_secret": "sk_live_xyz789"
  }'
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import requests

url = "https://api.pinkcloudsync.example/v1/auth/token"

payload = {
    "api_key": "pk_live_abc123",
    "api_secret": "sk_live_xyz789"
}

response = requests.post(url, json=payload)
token_data = response.json()

print(f"Access token: {token_data['access_token']}")

Response

1
2
3
4
5
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}

The "expires_in" field indicates the token lifetime in seconds (3600 = 1 hour).

Using the Token

The obtained token is used to authenticate all subsequent requests. Add it to the Authorization header:

1
2
curl -X GET https://api.pinkcloudsync.example/v1/sync/sessions \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import requests

url = "https://api.pinkcloudsync.example/v1/sync/sessions"

headers = {
    "Authorization": f"Bearer {token_data['access_token']}"
}

response = requests.get(url, headers=headers)
sessions = response.json()

Rate Limits

PinkCloudSync API applies the following rate limits:

Request Type Limit
Authentication 10 requests per minute
Sync Operations 100 requests per minute
Data Reading 1000 requests per minute

When the limit is exceeded, the API returns a 429 Too Many Requests error. Response headers contain information about limits:

  • X-RateLimit-Limit — maximum number of requests
  • X-RateLimit-Remaining — remaining number of requests
  • X-RateLimit-Reset — counter reset time (Unix timestamp)

Troubleshooting

401 Unauthorized Error

If you receive a 401 Unauthorized error, check:

  • Correctness of the API key and secret
  • Token expiration (tokens are valid for 1 hour)
  • Presence of the Authorization header in the request

Example error response:

1
2
3
4
{
  "error": "invalid_credentials",
  "message": "Invalid API key or secret"
}

429 Too Many Requests Error

If you've exceeded the rate limit:

  • Check the X-RateLimit-* headers in the response
  • Wait for the counter reset (time specified in X-RateLimit-Reset)
  • Optimize request frequency

Response headers:

1
2
3
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1640995200

Best Practices

To avoid common issues:

  1. Store credentials securely — Use environment variables or secure vaults
  2. Implement token refresh — Request new tokens before expiration
  3. Handle rate limits — Implement exponential backoff
  4. Log errors properly — Never log sensitive data like tokens

Next Steps

Now that you've set up API access, explore the following sections:


  1. API keys consist of two parts: a public key (starts with pk_) and a secret key (starts with sk_). Never share your secret key.