Download Public Import File

It requires the run-import permission.

Headers

Payload

Example payload

{
    "fileUrl":"https://www.freepik.com/photos/dog",
    "importerKey":"pending-avatars"
 
}

Example Call

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"
 
}'

Example Result

Success

{
  "success": true
}

Error

  • Invalid Importer Key: This happens when the importer key does not match any of the accepted options.

  • No Permission: This occurs when the authenticated user doesn't have the run-import permission.

  • Import File Missing: It occurs when the fileUrl for the image does not start with http.

{
    "success": false,
    "error": "The importer (png) has no import class defined. [error-importer-not-defined]",
    "errorType": "error-importer-not-defined",
    "details": "uploadImportFile"
}

Change Log

Last updated

Rocket.Chat versions receive support for six months after release.