API Reference
Developer Guides
Developer Guides
Sign Up
After registering with the /signup endpoint, email us at team@sumtyme.ai to activate your profile.
Your API key is generated securely and we do not store or have access to it after its creation. For your security, it’s important to save it immediately in a safe place like a password manager or environment variable, as you won’t be able to retrieve it again if lost.
Data Structure
Copy
{
"email": "name@example.com",
"password": "examplepassword",
"confirm_password": "examplepassword"
}
Copy
{
"message": "Your API key has been successfully generated...",
"email": "name@example.com",
"api_key": "stai-KxHZNuyhUVhapikeyAz1EdqAexampleqe7k8E_"
}
Code Examples
Copy
import pandas as pd
import requests
import json
def signup_user(endpoint_url: str, email: str, password: str, confirm_password: str):
"""
Calls the /signup endpoint, handles the response, and saves the API key to a .txt file.
Args:
endpoint_url (str): The URL of your /signup endpoint.
company_id (str): The company ID for the new user.
email (str): The email address for the new user.
password (str): The password for the new user.
confirm_password (str): The password confirmation for the new user.
"""
payload = {
"email": email,
"password": password,
"confirm_password": confirm_password
}
headers = {
"Content-Type": "application/json"
}
# Make the POST request to the signup endpoint
response = requests.post(endpoint_url, data=json.dumps(payload), headers=headers)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
response_data = response.json()
if response.status_code == 200:
api_key = response_data.get("api_key")
user_email = response_data.get("email")
message = response_data.get("message")
if api_key:
# Define the filename for the API key
filename = f"api_key_{user_email.replace('@', '_').replace('.', '_')}.txt"
with open(filename, "w") as f:
f.write(api_key)
print(f"Success: {message}")
print(f"API Key for {user_email} saved to {filename}")
return {"success": True, "api_key": api_key, "filename": filename}
else:
print(f"Error: Signup successful but no API key found in response. Response: {response_data}")
return {"success": False, "message": "API key not found in response"}
else:
# Handle other success status codes if necessary
print(f"Unexpected successful response status code: {response.status_code}. Response: {response_data}")
return {"success": False, "message": "Unexpected successful response"}
signup_endpoint = "https://www.sumtyme.tech/signup"
# Example signup data
user_email = ""
user_password = ""
confirm_user_password = ""
result = signup_user(signup_endpoint, user_email, user_password, confirm_user_password)
Assistant
Responses are generated using AI and may contain mistakes.