স্লাগ তৈরি করুন
ছোট হাতের অক্ষর ও হাইফেন দিয়ে URL-এর শেষ অংশের জন্য স্লাগ তৈরি করুন।
বেস URL: https://happytails.ai · পাবলিক API সংযুক্ত নেই
প্রক্রিয়াকরণ
API-তে অনুরোধ পাঠালে আপনার দেওয়া তথ্য সার্ভারে প্রক্রিয়া করা হয়।
অনুরোধের প্যারামিটার
একটি JSON অবজেক্ট পাঠান। অচেনা প্রপার্টি থাকলে অনুরোধটি প্রত্যাখ্যান করা হয়। কোনো অপশন বাদ দিলে নিচে দেওয়া ডিফল্ট মান ব্যবহৃত হয়। সংখ্যা ও বুলিয়ান মান উদ্ধৃতি চিহ্ন ছাড়া JSON মান হিসেবে লিখুন।
input একটি স্ট্রিং, যা শুরুতে খালি থাকে এবং সর্বোচ্চ 1,000,000 অক্ষর নিতে পারে। ফল বদলাতে ইনপুট বা সেটিংস পরিবর্তন করুন। টাইপ করার সময়ও ফল আপডেট হয়।
এই এন্ডপয়েন্টে files অ্যারে গ্রহণ করা হয় না।
বিকল্প
কোনো অপশন দেওয়ার প্রয়োজন নেই। options বাদ দিন অথবা একটি খালি অবজেক্ট পাঠান।
সফল অনুরোধের প্রতিক্রিয়া
HTTP 200 প্রতিক্রিয়ায় tool ও result থাকে। পাঠ্য থাকে result.text-এ। পার্স করা JSON-ও result.data-এ থাকতে পারে। তৈরি ফাইলগুলো result.files-এ থাকে এবং প্রতিটিতে name, mime, bytes ও base64 থাকে। সংরক্ষণের আগে বাইটগুলো ডিকোড করুন। কোনো অপারেশন অন্য ধরনের ফল দিলে ফাইলের অ্যারে খালি থাকা এবং পাঠ্যের মান null হওয়া বৈধ।
আউটপুটের সম্পূর্ণ স্কিমা
{
"type": "object",
"required": [
"tool",
"result"
],
"properties": {
"tool": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"text",
"files"
],
"properties": {
"text": {
"type": [
"string",
"null"
]
},
"data": {
"description": "Parsed JSON when the textual result is JSON."
},
"name": {
"type": "string"
},
"mime": {
"type": "string"
},
"files": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"mime",
"bytes",
"base64"
],
"properties": {
"name": {
"type": "string"
},
"mime": {
"type": "string"
},
"bytes": {
"type": "integer"
},
"base64": {
"type": "string",
"contentEncoding": "base64"
}
}
}
}
}
}
}
}সীমা ও ত্রুটি
এই এন্ডপয়েন্টে নিচের সীমাগুলো প্রযোজ্য। কাজের বিবরণে দেওয়া ফরম্যাট, পৃষ্ঠা, সময়কাল ও মডেল সংক্রান্ত অতিরিক্ত সীমাও প্রযোজ্য। ব্রাউজারের ইন্টারফেসের সীমা API-এর সীমা থেকে ভিন্ন হতে পারে।
request_bytes- 8388608
input_characters- 1000000
files_bytes- 5242880
max_files- 0
timeout_seconds- 12
অবৈধ অনুরোধে error অবজেক্ট ফেরত আসে, যাতে code ও message থাকে। দেখুন HTTP স্ট্যাটাস, পুনরায় চেষ্টা, সময়সীমা ও একসঙ্গে একাধিক অনুরোধ। অনুরোধের কাজ শেষ হলে একই উত্তরে ফলাফল ফেরত আসে।
অনুরোধের সম্পূর্ণ স্কিমা
JSON স্কিমা খুলুন
{
"type": "object",
"additionalProperties": false,
"properties": {
"input": {
"type": "string",
"maxLength": 1000000,
"default": "",
"description": "Plain text input. File tools use files instead unless otherwise documented."
},
"options": {
"type": "object",
"additionalProperties": false,
"properties": {}
}
}
}ব্রাউজারে কাজ স্বয়ংক্রিয় করতে কেন্দ্রীয় WebMCP নির্দেশিকা ব্যবহার করে দেখুন ব্রাউজারটি আসলে কোন টুলগুলো উপলভ্য করে।
curl https://happytails.ai/api/v1/tools/slug-generator/run \
-H "Content-Type: application/json" \
--data '{"input": "Caf\u00e9 Hello World", "options": {}}'const payload = {
"input": "Caf\u00e9 Hello World",
"options": {}
};
const response = await fetch(
"https://happytails.ai/api/v1/tools/slug-generator/run",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}
);
const data = await response.json();
if (!response.ok) throw new Error(data.error.message);
console.log(data.result);import json
from urllib.request import Request, urlopen
payload = json.loads('{"input": "Caf\\u00e9 Hello World", "options": {}}')
request = Request(
"https://happytails.ai/api/v1/tools/slug-generator/run",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
)
with urlopen(request, timeout=200) as response:
result = json.load(response)
print(result){
"input": "Caf\u00e9 Hello World",
"options": {}
}আপনার অ্যাপ্লিকেশন অনুযায়ী API-এর অরিজিন ও ইনপুটের মান বদলান।
{
"tool": "slug-generator",
"result": {
"text": "cafe-hello-world",
"files": [],
"name": "result.txt",
"mime": "text/plain;charset=utf-8"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Unknown request property. See the tool input schema."
}
}