Learn how to insert resources using the Wetrocloud API
/resource/insert/
endpoint to add resources (URLs, files, text or JSON) to a collection for indexing and retrieval. Simply provide a collection_id
, resource
, and type
.Resource | Parameter | Description |
---|---|---|
File | file | Supports various file types including .csv , .docx , .epub , .hwp , .ipynb , .jpeg , .jpg , .mbox , .md , .mp3 , .mp4 , .pdf , .png , .ppt , .pptm , .pptx . |
Text | text | Plain text content. |
JSON | json | Structured data in JSON format. |
Web | web | Web-based resources, such as websites. |
Youtube | youtube | Youtube videos with youtube URLs. |
Audio | audio | Supports various audio file types including .3ga , .8svx , .aac , .ac3 , .aif , .aiff , .alac , .amr , .ape , .au , .dss , .flac , .flv , .m4a , .m4b , .m4p , .m4r , .mp3 , .mpga , .ogg , .oga , .mogg , .opus , .qcp , .tta , .voc , .wav , .wma , .wv |
/v1/resource/insert/
endpoint when you need to:
collection_id
.POST
request to the /v1/resource/insert/
endpoint with the required parameters in the body.
Parameter | Type | Description |
---|---|---|
collection_id | String | The unique ID obtained from the /collection/create/ endpoint. |
resource | String | The resource (e.g. file path, file URL, a website). |
type | String | The type of resource to insert (e.g., web , file , text , json , youtube ). |
Field | Description |
---|---|
success | Indicates whether the resource was inserted successfully. |
tokens | Number of tokens consumed during the operation. |
resource_id | Unique ID for the resource, this is required when removing a resource |