Route: https://api.cytrix.io/UploadFile
Users can use this function to Upload Files onto their Storage.
Roles Required: Admin, User and Private User.
Request Syntax
{
“apiKey”: “String”,
“name”: “String”,
“fileExtension”: “json/xml/txt/jpg…..”,
“file”: File encoded to base64 (Example code is shown below)
“category”: “har/img/targets/tobotstxt/sitemap/api_schema/crt/custom_template/idor_params”,
“description”: “String”
}
Request Parameters
Parameters being used in the Request
Parameter Name :
apiKey
Parameter Usage and Options :
Your CYTRIX given API Key.
How do I get it ? :
Located in the “Profile” section.
Note : by default, the “API Status” is enabled, unless, the Admin has disabled it in the “Server Settings” section.
Type :
String
Is it Optional ? :
No.
Parameter Name :
name
Parameter Usage and Options :
The exact Name of the File you wish to Upload.
For example: file1.txt –> file1.txt (inc. the Extension).
Type :
String
Is it Optional ? :
No.
Parameter Name :
File
Parameter Usage and Options :
The File you wish to Upload encoded to base64
Python code:
def encode_file_to_base64(file_path):
with open(file_path, 'rb') as file:
return base64.b64encode(file.read()).decode('utf-8')
Type :
Any File.
Is it Optional ? :
No.
Parameter Name :
category
Parameter Usage and Options :
har/img/targets/tobotstxt/sitemap/api_schema/crt/custom_template/idor_params
Type :
String
Is it Optional ? :
No.
Parameter Name :
description
Parameter Usage and Options :
Description for this file
Type :
String
Is it Optional ? :
Yes.
Successful Response
{
“Error”: 0,
“Function”: “UploadFile”,
“Data”: “Uploaded Successfully”
}
Errors and their Possible Causes
For more information, please refer to the General Errors section.