Download Public Import File
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/downloadPublicImportFile | yes | POST |
Argument | Example | Required | Description |
---|---|---|---|
X-User-Id | myuser-name | Required | The authenticated user ID. |
X-Auth-Token | myauth-token | Required | Auth token. |
Argument | Example | Required | Description |
---|---|---|---|
fileUrl | https://www.freepik.com/photos/dog | Required | The url of the file. It must start with http or https . |
importerKey | pending-avatars | Required | It indicates how Rocket.Chat should handle the uploaded file. The accepted importer keys are: csv , hipchatenterprise , pending-avatars , pending-files , slack and slack-users |
{
"fileUrl":"https://www.freepik.com/photos/dog",
"importerKey":"pending-avatars"
}
curl --location 'http://localhost:3000/api/v1/downloadPublicImportFile' \
--header 'x-auth-token: DTRPbgzQ0EDlTE3sdd3Nt7WfaWZE-lG1ayi9Pfa28Fm' \
--header 'x-user-id: GonjPyg3gB3Z9ur9s' \
--header 'Content-Type: application/json' \
--data '{
"fileUrl":"https://www.freepik.com/photos/dog",
"importerKey":"pending-avatars"
}'
{
"success": true
}
- Invalid Importer Key: This happens when the importer key does not match any of the accepted options.
- Import File Missing: It occurs when the
fileUrl
for the image does not start withhttp
.
Invalid Importer Key
No Permission
Import File Missing
{
"success": false,
"error": "The importer (png) has no import class defined. [error-importer-not-defined]",
"errorType": "error-importer-not-defined",
"details": "uploadImportFile"
}
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
{
"success": false,
"error": "htt://www.freepik.com/photos/dog [error-import-file-missing]",
"errorType": "error-import-file-missing",
"details": "downloadPublicImportFile"
}
Version | Description |
---|---|
3.0.0 | Added |
Last modified 5mo ago