Getting started overview
Getting started with SHARE involves a series of steps designed to enable secure data sharing and collaboration quickly. The process typically begins with account creation, followed by the generation of API credentials. These credentials are then used to authenticate and authorize API requests, allowing developers to integrate SHARE's capabilities into their applications or workflows. The platform supports various programming languages through SDKs, simplifying the interaction with its data sharing functionalities. The primary goal of this guide is to walk through the essential initial setup to make a successful first API call.
SHARE emphasizes secure and compliant data exchange, supporting standards like SOC 2 Type II, GDPR, and HIPAA to ensure data integrity and privacy during collaboration SHARE security and compliance overview. Understanding these foundational elements is crucial for developers planning to build applications that leverage SHARE's features for inter-organizational data exchange and real-time data collaboration.
Quick Reference Table
| Step | What to Do | Where |
|---|---|---|
| 1. Sign Up | Create a SHARE account | SHARE signup page |
| 2. Generate API Keys | Obtain API Key and Secret | SHARE Developer Console > API Keys section |
| 3. Install SDK (Optional) | Install Python or JavaScript SDK | pip install share-sdk (Python) or npm install @share/sdk (JavaScript) |
| 4. Make First Request | Execute a simple data listing call | Using SDK or direct HTTP client |
| 5. Explore Documentation | Review API reference and examples | SHARE API reference documentation |
Create an account and get keys
To begin using SHARE, the first step is to create an account. SHARE offers a free tier that supports up to 3 users and 1GB of data storage, making it accessible for initial exploration and small-scale projects SHARE pricing plans. Navigate to the SHARE homepage and select the signup option to register. During the signup process, you will typically provide an email address, create a password, and agree to the terms of service.
Once your account is created and verified, log in to the SHARE Developer Console. Within the console, locate the 'API Keys' section. This is where you will generate your API credentials. SHARE uses an API Key and an API Secret for authentication. The API Key identifies your application, while the API Secret is used to sign your requests, ensuring their authenticity and integrity. It is critical to treat your API Secret as sensitive information, similar to a password, and store it securely. Avoid hardcoding it directly into your application's source code or exposing it in client-side scripts. Environment variables or secure configuration management systems are recommended for storing API secrets.
When generating keys, you may have options to specify permissions or scopes for the API Key. For your first request, it's often sufficient to create a key with read-only access to basic account information or publicly available datasets. This minimizes potential security risks while you are familiarizing yourself with the platform. Make sure to copy both the API Key and API Secret immediately after generation, as the secret may only be displayed once for security reasons.
Your first request
After obtaining your API Key and Secret, you can proceed to make your first request to the SHARE API. This initial request serves to verify your credentials and ensure your environment is correctly configured. SHARE provides SDKs for Python, JavaScript, and R, which simplify API interactions SHARE SDK documentation. For this example, we will demonstrate using Python and JavaScript, as these are the primary languages with example support.
Using the Python SDK
First, install the Python SDK:
pip install share-sdk
Next, use the following Python code to make a simple request to list available datasets. Replace YOUR_API_KEY and YOUR_API_SECRET with your actual credentials.
import os
from share_sdk import ShareClient
# It's recommended to store credentials in environment variables
api_key = os.environ.get("SHARE_API_KEY", "YOUR_API_KEY")
api_secret = os.environ.get("SHARE_API_SECRET", "YOUR_API_SECRET")
if api_key == "YOUR_API_KEY" or api_secret == "YOUR_API_SECRET":
print("Please set SHARE_API_KEY and SHARE_API_SECRET environment variables or replace placeholders.")
else:
try:
client = ShareClient(api_key=api_key, api_secret=api_secret)
datasets = client.data.list_datasets()
print("Successfully connected to SHARE. Available datasets:")
for dataset in datasets:
print(f"- {dataset.name} (ID: {dataset.id})")
except Exception as e:
print(f"An error occurred: {e}")
This Python script initializes the ShareClient with your credentials and then calls client.data.list_datasets() to retrieve a list of datasets accessible to your account. A successful response indicates that your API keys are valid and your connection is established.
Using the JavaScript SDK
For JavaScript, install the SDK:
npm install @share/sdk
Then, use this Node.js example to make a similar request. For client-side JavaScript in a browser, direct API key exposure is generally not recommended due to security implications; server-side proxies are preferred. This example assumes a Node.js environment or a secure server-side implementation.
const { ShareClient } = require('@share/sdk');
// It's recommended to store credentials in environment variables
const apiKey = process.env.SHARE_API_KEY || 'YOUR_API_KEY';
const apiSecret = process.env.SHARE_API_SECRET || 'YOUR_API_SECRET';
if (apiKey === 'YOUR_API_KEY' || apiSecret === 'YOUR_API_SECRET') {
console.log('Please set SHARE_API_KEY and SHARE_API_SECRET environment variables or replace placeholders.');
} else {
const client = new ShareClient({ apiKey, apiSecret });
client.data.listDatasets()
.then(datasets => {
console.log('Successfully connected to SHARE. Available datasets:');
datasets.forEach(dataset => {
console.log(`- ${dataset.name} (ID: ${dataset.id})`);
});
})
.catch(error => {
console.error('An error occurred:', error.message);
});
}
Similar to the Python example, this JavaScript code initializes the client and attempts to list datasets. A successful output listing dataset names confirms your setup.
Direct HTTP Request (cURL example)
If you prefer to make a direct HTTP request without an SDK, you can use cURL. This requires understanding how SHARE authenticates requests, often using an Authorization header with a signed token or basic authentication. Refer to the SHARE API authentication guide for specific details on constructing the authentication header. For many REST APIs, this involves generating a signature using your API Secret and other request parameters. For example, a basic authenticated GET request might look like this (actual authentication mechanism may vary; consult SHARE's API reference):
curl -X GET \
https://api.share.org/v1/datasets \
-H "Authorization: Bearer YOUR_GENERATED_ACCESS_TOKEN" \
-H "Content-Type: application/json"
The YOUR_GENERATED_ACCESS_TOKEN would typically be obtained through an OAuth 2.0 flow or a similar token exchange mechanism involving your API Key and Secret. OAuth 2.0 is a common framework for delegated authorization, allowing applications to obtain limited access to user accounts on an HTTP service OAuth 2.0 specification.
Common next steps
After successfully making your first API call, you can explore more advanced features of SHARE:
- Explore Data Sharing Workspaces: Create secure workspaces to invite collaborators and share specific datasets. This is a core feature for inter-organizational data exchange and controlled access SHARE workspace management.
- Upload and Manage Data: Learn how to programmatically upload new datasets, update existing ones, and manage data versions using the API or SDKs.
- Implement Real-time Data Streams: Investigate SHARE's capabilities for real-time data collaboration, which may involve webhooks or streaming APIs to receive updates as data changes.
- Integrate with Other Tools: Explore integrations with analytics platforms, visualization tools, or other enterprise systems. SHARE is designed to facilitate data flow for research and development teams, often requiring connections to existing data pipelines. For example, you might integrate with a platform like Databricks for advanced analytics Databricks Data Platform overview or Tableau for business intelligence Tableau product information.
- Set Up Webhooks: Configure webhooks to receive automated notifications when specific events occur within your shared datasets or workspaces. This enables reactive and event-driven architectures.
- Review Security Best Practices: Deepen your understanding of secure coding practices for API keys, token management, and data access controls within the SHARE ecosystem to maintain compliance with standards like GDPR and HIPAA SHARE security best practices.
Troubleshooting the first call
Encountering issues during your first API call is common. Here are some troubleshooting steps:
- Check API Key and Secret: Ensure that your API Key and Secret are copied correctly and match the credentials generated in the SHARE Developer Console. Even a single character mismatch can lead to authentication failures.
-
Environment Variables: If using environment variables, verify that they are set correctly in your execution environment. For Python, you can print
os.environ.get("SHARE_API_KEY")to confirm. For Node.js, useprocess.env.SHARE_API_KEY. -
Network Connectivity: Confirm that your machine has an active internet connection and is not blocked by a firewall or proxy from accessing
api.share.org. You can test this by trying to ping the domain or making a simple HTTP request to a known public API. -
SDK Installation: For SDK-based requests, ensure the SDK is installed correctly. Re-run
pip install share-sdkornpm install @share/sdkto confirm. Check for any installation errors. -
Error Messages: Carefully read the error message returned by the API or your SDK. Common errors include
401 Unauthorized(incorrect credentials),403 Forbidden(insufficient permissions for the API key), or500 Internal Server Error(an issue on SHARE's side, though less common for initial calls). - API Reference Documentation: Consult the SHARE API reference for specific endpoint requirements, expected parameters, and authentication methods. Sometimes, endpoints require specific headers or query parameters that might be overlooked.
- SDK Version Compatibility: Ensure you are using a compatible version of the SDK with the SHARE API. While unlikely for a first call, older SDKs might not support newer API features or authentication flows.
-
Rate Limits: Although rare for a first call, be aware that APIs often have rate limits. If you are rapidly retrying requests, you might temporarily hit a limit. Check the response headers for
X-RateLimit-LimitandX-RateLimit-Remainingif available. - Contact Support: If you've exhausted other options, contact SHARE support with details of your error message, code snippet, and troubleshooting steps taken. Providing as much context as possible will help them diagnose the issue efficiently SHARE support page.