This API provides endpoints for File Support. You can upload files, list them, retrieve file details, delete them, and access their content
Refer to the Globant Enterprise AI API Reference for generic variables needed to use the API.
| Method |
Path |
Description |
| POST |
/files |
Uploads a file |
| GET |
/files/{fileId} |
Gets a file by Id |
| DELETE |
/files/{fileId} |
Deletes a file by Id |
| GET |
/files/{fileId}/content |
Gets the content of a file by Id |
| GET |
/files/all |
Gets all files |
All endpoints require authentication using one of the following:
- Authorization: Bearer $GEAI_APITOKEN
- Authorization: Bearer $OAuth_accesstoken
- Authorization: Bearer $GEAI_ORGANIZATION_APITOKEN
Uploads a file to the system.
- Method: POST
- Path: $BASE_URL/v1/files
- Headers:
- Authorization: See Authentication section above.
- Accept: application/json
- fileName: File name (optional). If not provided, the name of the uploaded file will be used.
- organizationId: $ORGANIZATION_ID.
- projectId: Project ID.
- project-id: Alternative single header that can be used instead of both organizationId and projectId.
- folder: Destination folder (optional). If not provided, the file will be temporarily saved.
{
"dataFileId": "string",
"dataFileUrl": "string",
"success": true
}
curl -X POST "$BASE_URL/v1/files"
-H "Authorization: Bearer $GEAI_APITOKEN"
-H "Accept: application/json"
-H "fileName: $FILE_NAME"
-H "organizationId: $ORGANIZATION_ID"
-H "projectId: $PROJECT_ID"
-H "folder: $FOLDER"
-F "file=@/path/to/file.txt" // The file you want to upload.
curl -X POST "$BASE_URL/v1/files"
-H "Authorization: Bearer $GEAI_APITOKEN"
-H "Accept: application/json"
-H "fileName: $FILE_NAME"
-H "project-id: $PROJECT_ID" // alternative single header with no need to indicate organizationId
-H "folder: $FOLDER"
-F "file=@/path/to/file.txt" // The file you want to upload.
Gets a file by Id.
This endpoint requires $GEAI_ORGANIZATION_APITOKEN. If you use the $OAuth_accesstoken you will only see the files you uploaded.
| Name |
Type |
Description |
| fileId |
string |
Refers to the File Id. |
- Method: GET
- Path: $BASE_URL/v1/files/{fileId}
- Headers:
- Authorization: See Authentication section above.
- Accept: application/json
{
"dataFileExtension": "string",
"dataFileId": "string",
"dataFileName": "string",
"dataFilePurpose": "string"
"dataFileSize": numeric,
"dataFileUrl": "string",
"organizationId": "string",
"projectId": "string",
"success": true
}
curl -X GET "$BASE_URL/v1/files/{fileId}"
-H "Authorization: Bearer $GEAI_APITOKEN"
-H "Accept: application/json"
-G
-d "organization=$ORGANIZATION_ID"
-d "project=$PROJECT_ID"
Deletes a file by Id.
This endpoint requires a $GEAI_ORGANIZATION_APITOKEN.
| Name |
Type |
Description |
| fileId |
string |
Refers to the File Id. |
- Method: DELETE
- Path: $BASE_URL/v1/files/{fileId}
- Headers:
- Authorization: See Authentication section above.
- Accept: application/json
{
"success": true
}
curl -X DELETE "$BASE_URL/v1/files/{fileId}"
-H "Authorization: Bearer $GEAI_APITOKEN"
-H "Accept: application/json"
-G
-d "organization=$ORGANIZATION_ID"
-d "project=$PROJECT_ID"
Retrieves the content of a file by Id.
This endpoint requires $GEAI_ORGANIZATION_APITOKEN. If you use the $OAuth_accesstoken you will only see the files you uploaded.
| Name |
Type |
Description |
| fileId |
string |
Refers to the File Id. |
- Method: GET
- Path: $BASE_URL/v1/files/{fileId}/content
- Headers:
- Authorization: BearerToken $GEAI_APITOKEN.
- Accept: application/json
{
"content": "string"
}
curl -X GET "$BASE_URL/v1/files/{fileId}/content"
-H "Authorization: Bearer $GEAI_APITOKEN"
-H "Accept: application/json"
-G
-d "organization=$ORGANIZATION_ID"
-d "project=$PROJECT_ID"
Gets all files.
This endpoint requires $GEAI_ORGANIZATION_APITOKEN. If you use the $OAuth_accesstoken you will only see the files you uploaded.
- Method: GET
- Path: $BASE_URL/v1/files/all
- Headers:
- Authorization: See Authentication section above.
- Accept: application/json
{
"dataFiles":
{
"DataFileExtension": "string",
"DataFileId": "string",
"DataFileName": "string",
"DataFilePurpose": "string",
"DataFileSize": "number",
"DataFileUrl": "string"
},
{
"DataFileExtension": "string",
"DataFileId": "string",
"DataFileName": "string",
"DataFilePurpose": "string",
"DataFileSize": "number",
"DataFileUrl": "string"
}
}
curl -X GET "$BASE_URL/v1/files/all"
-H "Authorization: Bearer $GEAI_APITOKEN"
-H "Accept: application/json"
-G
-d "organization=$ORGANIZATION_ID"
-d "project=$PROJECT_ID"
How to upload and manage Files via API