Overview
These API methods and curl commands provide efficient solutions for creating a folder, uploading and removing files in the server repository using Repertoire 2024.
1. Creating a Folder in the Server Repository
curl -v -k -H "Authentication: elx.token YOUR_ELX_TOKEN"
-H "Content-Type: application/json"
--data "{\"path\": \"/User/admin\", \"name\": \"FarhanaTest\"}"
http://localhost:1730/repository/action/add-folder
Details:
- Endpoint:
/repository/action/add-folder - Method:
POST - Authentication Header: Use
elx.tokenwith your specific token. - Parameters:
path: The parent directory where the new folder will be created.name: The name of the new folder.
2. Uploading a File to the Server Repository
curl -v -k -X POST http://localhost:1730/repository/action/upload \
-H "Authentication: elx.token YOUR_ELX_TOKEN" \
-H "Accept: application/json" \
-F "file=@/Elixir/Repertoire-2024.0.7/repository/User/admin/TestHello.txt" \
-F "json={\"path\":\"/User/admin/def\", \"overwrite\":true}"
Details:
- Endpoint:
/repository/action/upload - Method:
POST - Authentication Header: Use
elx.tokenwith your specific token. - Parameters:
file: Path to the file being uploaded.json: Includes destination path (path) and anoverwriteflag.
3. Removing a File from the Server Repository
curl -v -k -H "Authentication: elx.token YOUR_ELX_TOKEN" \
-H "Content-Type: application/json" \
--data "{\"path\":\"/User/admin/abc/Test246.txt\"}" \
http://localhost:1730/repository/action/delete-file
Details:
- Endpoint:
/repository/action/delete-file - Method:
POST - Authentication Header: Use
elx.tokenwith your specific token. - Parameters:
path: Path to the file being deleted.
Please remember to revise any values such as file paths, tokens, and server URLs to match your specific environment before executing these commands.