Getting started overview
Integrating with Yes No involves a sequence of steps designed to enable developers to quickly generate and manage synthetic data. The process typically begins with account creation, followed by the retrieval of API authentication credentials. These credentials are then used to make an initial API request, confirming successful setup and access to Yes No's services.
Yes No provides API reference documentation detailing available endpoints and parameters. For various programming languages, SDKs are offered to simplify common interactions, abstracting away direct HTTP request handling. This guide focuses on the fundamental steps to get a basic integration operational.
The following table outlines the key steps to initiate your Yes No integration:
| Step | Action | Where |
|---|---|---|
| 1. Account Creation | Register for a Yes No account. | Yes No homepage |
| 2. API Key Retrieval | Locate and copy your API key from the dashboard. | Yes No developer dashboard |
| 3. Environment Setup | Install a Yes No SDK or prepare for direct API calls. | Local development environment |
| 4. First API Request | Execute an authenticated request to a Yes No endpoint. | Code editor/terminal |
Create an account and get keys
To begin using Yes No, you must first create an account. Yes No offers a Developer Plan free tier, which allows up to 50,000 requests per month, suitable for initial testing and development. Registration is performed through the Yes No website.
- Navigate to the Yes No homepage: Open your web browser and go to www.yesno.ai.
- Sign up: Look for a "Sign Up" or "Get Started" button, typically located in the top right corner. Follow the prompts to create your account, providing necessary information such as email and password.
- Verify email (if prompted): Some account creation processes require email verification. Check your inbox for a confirmation email and follow the instructions to activate your account.
- Access the dashboard: After successful registration and login, you will be redirected to your Yes No developer dashboard.
- Locate API Keys: Within the dashboard, navigate to the "API Keys" or "Developer Settings" section. Here, you will find your unique API key(s). Yes No API keys are essential for authenticating your requests and should be treated as sensitive credentials, similar to passwords.
- Copy your API Key: Copy the primary API key. This key will be used in the authorization header of your API requests or configured within the SDKs. It is recommended to store this key securely, for example, using environment variables, rather than hardcoding it directly into your application code.
For security best practices regarding API keys, consider guidelines from organizations like Mozilla Developer Network on HTTP authentication, which emphasize secure handling and transmission.
Your first request
After acquiring your API key, you can make your first authenticated request. This example uses Python and the Yes No Python SDK, which simplifies interaction with the API. Ensure you have Python installed on your system. If you prefer a different language, refer to the Yes No documentation for specific SDK examples.
Install the Yes No Python SDK
Open your terminal or command prompt and install the SDK using pip:
pip install yesno-sdk
Make a synthetic data generation request
This example demonstrates generating a simple synthetic dataset. Replace YOUR_YESNO_API_KEY with the key you copied from your dashboard.
import os
from yesno_sdk import YesNoClient
from yesno_sdk.models import DataGenerationRequest, FieldDefinition, FieldType
# It's recommended to load your API key from environment variables
api_key = os.environ.get("YESNO_API_KEY", "YOUR_YESNO_API_KEY")
client = YesNoClient(api_key=api_key)
try:
# Define the structure of the synthetic data to be generated
request = DataGenerationRequest(
record_count=5, # Generate 5 records
fields=[
FieldDefinition(name="id", type=FieldType.INTEGER, min=1, max=1000),
FieldDefinition(name="name", type=FieldType.STRING, pattern="[A-Z][a-z]{5,10}"),
FieldDefinition(name="email", type=FieldType.EMAIL),
FieldDefinition(name="is_active", type=FieldType.BOOLEAN)
]
)
# Make the API call to generate data
response = client.data.generate(request)
# Print the generated data
print("Generated Synthetic Data:")
for record in response.data:
print(record)
except Exception as e:
print(f"An error occurred: {e}")
This script initializes the Yes No client with your API key and then defines a request to generate five synthetic records, each containing an ID, name, email, and active status. The generated data is then printed to the console.
Expected Output
The output will be a list of dictionaries, each representing a synthetic record. The exact values will vary due to the synthetic nature of the data, but the structure will match your defined fields.
Generated Synthetic Data:
{'id': 789, 'name': 'Eleanor', 'email': '[email protected]', 'is_active': True}
{'id': 123, 'name': 'Michael', 'email': '[email protected]', 'is_active': False}
{'id': 456, 'name': 'Jessica', 'email': '[email protected]', 'is_active': True}
{'id': 901, 'name': 'William', 'email': '[email protected]', 'is_active': False}
{'id': 234, 'name': 'Sophia', 'email': '[email protected]', 'is_active': True}
Common next steps
After successfully making your first request, consider these common next steps to further integrate Yes No into your development workflow:
- Explore advanced data generation: Review the Yes No API reference to understand more complex data types, constraints, and relationships for generating more sophisticated synthetic datasets. This includes defining custom patterns, ranges, and dependencies between fields.
- Integrate with CI/CD pipelines: Automate synthetic data generation as part of your continuous integration and continuous delivery pipelines. This ensures that your tests always run against fresh, relevant data without manual intervention.
- Implement data masking: If working with existing sensitive production data, explore Yes No's data masking capabilities to anonymize or pseudonymize records for development and testing environments, ensuring compliance with regulations like GDPR or HIPAA.
- Utilize data subsetting: For large databases, use Yes No's data subsetting features to extract smaller, representative portions of your data, reducing the time and resources needed for testing while maintaining data integrity.
- Monitor usage and optimize: Keep track of your API usage through the Yes No dashboard. Optimize your requests and data generation strategies to stay within your plan limits and ensure efficient resource utilization.
- Leverage SDKs for other languages: If your project uses a different programming language, explore the available SDKs (Java, JavaScript, Go, Rust, Ruby, PHP, C#) to streamline integration and abstract common API interactions.
Troubleshooting the first call
Encountering issues during the first API call is common. Here are some troubleshooting steps:
- Check API Key: Ensure your API key is correct and hasn't expired. Verify it against the key displayed in your Yes No dashboard. API keys are case-sensitive.
- Environment Variable Setup: If you're using environment variables (recommended), double-check that the
YESNO_API_KEYvariable is correctly set and accessible to your script. Restarting your terminal or IDE might be necessary for new environment variables to take effect. - Network Connectivity: Confirm that your development environment has an active internet connection and is not blocked by a firewall or proxy from accessing
api.yesno.ai. - SDK Installation: Verify that the Yes No SDK is correctly installed. For Python, run
pip show yesno-sdkto confirm its presence and version. - Request Body Format: Ensure the JSON structure of your
DataGenerationRequestmatches the requirements specified in the Yes No API documentation. Incorrect field names, types, or missing required parameters can lead to errors. - Error Messages: Pay close attention to the error messages returned by the API or the SDK. They often provide specific details about what went wrong (e.g., "Invalid API Key", "Missing required parameter").
- Rate Limits: Although less likely on a first call, be aware of rate limits. If you are making multiple rapid calls, you might temporarily exceed your plan's allowance. The Yes No documentation on rate limiting provides details.
- Consult Documentation: Refer to the official Yes No documentation for detailed error codes and common issues.