Status
Check the status of generate.
Request
GEThttps://api.fliki.ai/v1/generate/status
Headers
{
"Content-type": "application/json",
"Authorization": "Bearer API_KEY"
}
Key | Value | Description |
---|---|---|
Content-Type | application/json | Specifies that the request body format is JSON, allowing the server to parse the data correctly. |
Authorization | Bearer YOUR_API_KEY | Generate your API Key in the account/api. section and replace YOUR_API_KEY with your actual key. |
Query params
{
"fileId": String
}
Obtain fileId
via the generate template endpoint.
Response
{
"fileId": String,
"status": String,
"progress": Number | undefined,
"download": String | undefined
}
Key | Type | Description |
---|---|---|
fileId | string | The unique identifier for the file. |
status | string | Indicates whether the file generation status. |
progress | number | undefined | The progress percentage of the file generation (if available). |
download | string | undefined | The URL to download the file (if available). |
Example
- Bash
- TypeScript
- Python
- Go
cURL Request
curl
-H "Authorization: Bearer <API KEY>"
-H "Content-Type: application/json"
-G -d "fileId=..."
-X GET https://api.fliki.ai/v1/generate/status
TypeScript Request
const apiKey = '<API KEY>'; // Replace with your actual API key
const fileId = '...'; // Replace with your actual file ID
async function getGenerateStatus(apiKey: string, fileId: string) {
const url = `https://api.fliki.ai/v1/generate/status?fileId=${encodeURIComponent(fileId)}`;
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`Error: ${response.status} - ${response.statusText}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error('Error fetching Fliki status:', error);
throw error; // Re-throw the error for further handling if needed
}
}
getGenerateStatus(apiKey, fileId)
.then(data => console.log(data))
.catch(error => console.error(error));
Python Request
import requests
api_key = "<API KEY>" # Replace with your actual API key
file_id = "..." # Replace with your actual file ID
url = "https://api.fliki.ai/v1/generate/status"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
params = {
"fileId": file_id
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
Go Request
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
apiKey := "<API KEY>" // Replace with your actual API key
fileID := "..." // Replace with your actual file ID
url := "https://api.fliki.ai/v1/generate/status"
req, err := http.NewRequest("GET", url, bytes.NewBuffer(nil))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
q := req.URL.Query()
q.Add("fileId", fileID)
req.URL.RawQuery = q.Encode()
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
I'm a text that doesn't belong to any tab. So I'm always visible.