Get Pre-signed URL
You can generate pre-signed URL using this API.
Request Method
GET
Request URL
Request Headers
x-cleartax-auth-token
String
NA
Mandatory.
User auth token.
fileContentType
String
Enum:
XLSX, XLS, CSV
Mandatory.
Type of file being uploaded.
Request Path Params
templateType
String
Enum:
sales,
purchase
Type of document. sales - Sales document.
purchase- Purchase document.
Request Query Params
fileName
String
MaxLength: 1500
Name of the file to be uploaded (eg. filename.xlsx)
Request Body
There will be no request body for this API.
Response Status Codes
200
For a successfully processed request (may be a success or validation error).
401
If the user is not authenticated for the operation.
403
If the user is not authorized for the operation.
500
If there are any unhandled exceptions on Clear side.
Response Schema
status
String
enum:
CREATED, FAILED
Status of generate pre-signed URL action.
CREATED - Pre-signed URL is generated.
FAILED - Pre-signed URL is not generated.
preSignedS3Url
String
MaxLength: 2048
The pre-signed URL string. This URL is valid only for 10 minutes from the time of generation.
errorCode
String
enum:
AUTHORIZATION_FAILED, LICENSE_EXPIRED, API_QUOTA_EXCEEDED, PERMISSION_DENIED,
INTERNAL_ERROR
API Error Code.
AUTHORIZATION_FAILED- Invalid Auth Token passed, LICENSE_EXPIRED- Account License has expired, API_QUOTA_EXCEEDED- API access quota has exceeded, PERMISSION_DENIED- Don't have permission. Contact admin for access, INTERNAL_ERROR- Internal Error in Clear. Contact support.
If there is no error, this will be null.
errorMessage
String
NA
API Error Message.
If there is no error, this will be null.
Sample Response
Success - HTTP Status Code - 200
Error - HTTP Status Code - 401
Error - HTTP Status Code - 500
API Validations
Filename cannot be empty.
Content type and template type should be valid.
API Constraints
The user should have invoice creation permission.
Last updated