Schogini AI Wizard Module API Doc

Overview

API Base URL: https://do.schogini.com:8084/api/

This API provides endpoints for extracting entities, generating YouTube metadata, extracting contact details, language translation, language detection, and spam/phishing detection.

Authentication

Method: Bearer Token

Header: Authorization: Bearer YOUR_API_KEY_HERE

Endpoints

Extract Entities

Endpoint: /extract_entities

Method: POST

Description: Extracts specified entities from the provided text using OpenAI's language model.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here",
  "entities": "comma-separated entities (e.g., 'persons, emails, phone_numbers')"
}

Response:

200 OK:

{
  "extracted_entities": {
    "persons": ["John Doe"],
    "emails": ["john.doe@example.com"],
    "phone_numbers": ["+11234567890"]
  }
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Generate YouTube Metadata

Endpoint: /generate_youtube_metadata

Method: POST

Description: Generates YouTube metadata for SEO purposes based on the input text and target keywords.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here",
  "target_keywords": "comma-separated keywords (e.g., 'SEO, video, YouTube')"
}

Response:

200 OK:

{
  "youtube_metadata": {
    "youtube_title": "Generated Title",
    "youtube_description": "Generated description with SEO optimization.",
    "hashtags": "#SEO #YouTube",
    "keywords": "SEO, video, YouTube",
    "meta_title": "Generated Meta Title",
    "meta_description": "Generated meta description with SEO."
  }
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Extract Contact Details

Endpoint: /extract_contact_details

Method: POST

Description: Extracts contact details from the provided text, including name, email, phone, address, country, zip code, website, and business type.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here"
}

Response:

200 OK:

{
  "contact_details": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+1 (555) 123-4567",
    "address": "1234 Elm Street, Springfield, IL, 62704",
    "country": "USA",
    "zip_code": "62704",
    "website": "www.techinnovations.com",
    "type_of_business": "Tech Innovations Inc."
  }
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Language Translation

Endpoint: /language_translation

Method: POST

Description: Translates the input text into the specified target language using OpenAI's language model.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here",
  "target_language": "language to translate to (e.g., 'Spanish', 'French')"
}

Response:

200 OK:

{
  "translated_text": "The translated text here"
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Language Detection

Endpoint: /language_detection

Method: POST

Description: Detects the language of the input text using OpenAI's language model.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here"
}

Response:

200 OK:

{
  "language": "Detected language here"
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Spam/Phishing Detection

Endpoint: /spam_phishing_detection

Method: POST

Description: Detects whether a message or email contains spam, phishing content, or is legitimate.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here"
}

Response:

200 OK:

{
  "classification": "Spam" | "Phishing" | "Legitimate"
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Content Moderation

Endpoint: /content_moderation

Method: POST

Description: Analyzes the provided text for inappropriate or harmful content and categorizes it using OpenAI's Moderation API.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here"
}

Response:

200 OK:

{
  "flagged": false,
  "categories": {
    "harassment": false,
    "self-harm": false,
    "sexual": false,
    "violence": false
  },
  "category_scores": {
    "harassment": 0.0002,
    "self-harm": 0.0001,
    "sexual": 0.0015,
    "violence": 0.0189
  }
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Sentiment Analysis

Endpoint: /sentiment_analysis

Method: POST

Description: Analyzes the sentiment of the provided text and returns the sentiment as Positive, Negative, or Neutral using OpenAI's model.

Request Headers:

Authorization: Bearer YOUR_API_KEY_HERE

Request Body:

Content-Type: application/json

{
  "text": "Your input text here"
}

Response:

200 OK:

{
  "sentiment": "positive" | "negative" | "neutral"
}

401 Unauthorized:

{
  "error": "Unauthorized"
}

422 Unprocessable Entity:

{
  "error": "Invalid input data"
}

Example Requests

Extract Entities:

curl -X POST "https://do.schogini.com:8084/api/extract_entities" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "John Doe from Acme Corp. will visit New York on October 5th. Contact him at john.doe@example.com or call +11234567890.",
  "entities": "persons, emails, phone_numbers"
}'

Generate YouTube Metadata:

curl -X POST "https://do.schogini.com:8084/api/generate_youtube_metadata" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "This is a video about improving SEO techniques for YouTube videos.",
  "target_keywords": "SEO, YouTube, video marketing"
}'

Extract Contact Details:

curl -X POST "https://do.schogini.com:8084/api/extract_contact_details" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "John Doe, CEO of Tech Innovations Inc., can be reached at john.doe@example.com or +1 (555) 123-4567. The office is located at 1234 Elm Street, Springfield, IL, 62704, USA. Visit our website at www.techinnovations.com."
}'

Language Translation:

curl -X POST "https://do.schogini.com:8084/api/language_translation" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "Hello, how are you?",
  "target_language": "Spanish"
}'

Language Detection:

curl -X POST "https://do.schogini.com:8084/api/language_detection" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "Bonjour, comment ça va?"
}'

Spam/Phishing Detection:

curl -X POST "https://do.schogini.com:8084/api/spam_phishing_detection" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "You have won $1,000! Click this link to claim your prize."
}'

Content Moderation:

curl -X POST "https://do.schogini.com:8084/api/content_moderation" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "The text you want to analyze for moderation."
}'

Sentiment Analysis:

curl -X POST "https://do.schogini.com:8084/api/sentiment_analysis" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
  "text": "This product is great! I love it."
}'