Check Resource Status
curl --request GET \
--url https://api.wistx.ai/v1/indexing/resources/{resource_id}import requests
url = "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/indexing/resources/{resource_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/indexing/resources/{resource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wistx.ai/v1/indexing/resources/{resource_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/resources/{resource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"resource_id": "res_abc123",
"resource_type": "repository",
"status": "indexing",
"progress": {
"percentage": 65,
"stage": "processing_files",
"message": "Processing 812 of 1250 files..."
},
"estimated_completion": "2024-01-15T10:40:00Z"
}
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to get resource"
}
Indexing
Check Resource Status
Check the indexing status of a resource
GET
/
v1
/
indexing
/
resources
/
{resource_id}
Check Resource Status
curl --request GET \
--url https://api.wistx.ai/v1/indexing/resources/{resource_id}import requests
url = "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/indexing/resources/{resource_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/indexing/resources/{resource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wistx.ai/v1/indexing/resources/{resource_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/resources/{resource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"resource_id": "res_abc123",
"resource_type": "repository",
"status": "indexing",
"progress": {
"percentage": 65,
"stage": "processing_files",
"message": "Processing 812 of 1250 files..."
},
"estimated_completion": "2024-01-15T10:40:00Z"
}
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to get resource"
}
Check the indexing status of a resource
curl --request GET \
--url https://api.wistx.ai/v1/indexing/resources/res_abc123 \
--header 'Authorization: Bearer YOUR_API_KEY'
import requests
api_key = "YOUR_API_KEY"
resource_id = "res_abc123"
response = requests.get(
f"https://api.wistx.ai/v1/indexing/resources/{resource_id}",
headers={"Authorization": f"Bearer {api_key}"}
)
data = response.json()
print(f"Status: {data['status']}, Progress: {data['progress']['percentage']}%")
const apiKey = "YOUR_API_KEY";
const resourceId = "res_abc123";
const response = await fetch(
`https://api.wistx.ai/v1/indexing/resources/${resourceId}`,
{
headers: {
Authorization: `Bearer ${apiKey}`
}
}
);
const data = await response.json();
console.log(`Status: ${data.status}, Progress: ${data.progress.percentage}%`);
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
resourceID := "res_abc123"
url := fmt.Sprintf("https://api.wistx.ai/v1/indexing/resources/%s", resourceID)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Status: %v\n", result["status"])
}
require 'net/http'
require 'json'
require 'uri'
api_key = "YOUR_API_KEY"
resource_id = "res_abc123"
url = URI("https://api.wistx.ai/v1/indexing/resources/#{resource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer #{api_key}"
response = http.request(request)
data = JSON.parse(response.body)
puts "Status: #{data['status']}"
<?php
$apiKey = "YOUR_API_KEY";
$resourceId = "res_abc123";
$url = "https://api.wistx.ai/v1/indexing/resources/" . $resourceId;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Status: " . $data['status'];
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class CheckResourceStatus {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
String resourceId = "res_abc123";
URL url = new URL("https://api.wistx.ai/v1/indexing/resources/" + resourceId);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization", "Bearer " + apiKey);
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
}
Path Parameters
string
required
Resource ID returned from indexing request.
Response
{
"resource_id": "res_abc123",
"resource_type": "repository",
"status": "indexing",
"progress": {
"percentage": 65,
"stage": "processing_files",
"message": "Processing 812 of 1250 files..."
},
"estimated_completion": "2024-01-15T10:40:00Z"
}
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to get resource"
}