Upload via API permissions

Hi all

I try to upload assets via the Upload API. When I use the API_KEY of a user that is not in the Administrator group, the upload fails:

<?xml version="1.0" encoding="UTF-8"?> 1 Login not valid! Check user API Key and ensure with your administrator that the user has appropriate permissions for access.

The folder where I try to upload has read/write permission for “Everybody” and I can manually upload images into the folder with this user. It just fails if I upload via the API.

Any hints?

That doesn’t work. You need to have a user of a group or the admin upload.

So I added a group, added the user to this group and gave the group full access to the folder. The upload still fails:

Login not valid! Check user API Key and ensure with your administrator that the user has appropriate permissions for access.

Hi m.riehl ,

Please try with admin permission to testing with API.

With Admin permission the upload works fine. But I don’t want to give all API users Admin permissions…

Hi m.riehl ,

Please try to clear the template and database cache then restart the Razuna . After that , you can try to test with API upload again to see how.

Hope this helps.

Thanks

I tried that a lot, still no success.

I just found another bug when calling an API without Administrator permission. When I call “groups - getall” with a user that is not in the Administrator group, I get this result:

{“COLUMNS”:[“responsecode”,“message”],“DATA”:[[“1”,“No permissible data or action found for user! If you believe this is a mistake then please check with your administrator to ensure that you have appropriate permissions for access.”]]}

But the user is in a group, so I should get his group as result.

Sorry, forget my last post. Typing error in my API call. So there is “only” the bug when uploading an asset without Administrator permission.

Did you try API key of an Administrator for user to upload ?

As already mentioned: When I upload images with the API key of an Administrator user, the upload works fine. But I don’t want to use API keys of Administrator users, I want to use the API key of a “normal” user that has the right to upload images to a folder.

Hi,

I don’t see what kind of version of Razuna you are running or are you on the hosted edition? In any case, upload should work with any user, but the user needs to have at least write permission to the folder.

Usually when people have an issue it boils down to a wrong folder or permissions being used.

Hi,

I really appreciate your help, but everything is in this thread. Here is the summary:

Razuna 1.8.2 on Debian Jessy 64 Bit, self hosted.

Steps to reproduce:

  1. I defined a group called “API”.

  1. I added a user to this group.

  2. I gave full access for the API group to the Upload-Folder:

  1. Using the API-Key of the user that is in the API group, I tried to upload an image to to the Upload-Folder (http://wiki.razuna.com/display/ecp/Upload+API2)

The result is this message:

responseCode=1, message=Login not valid! Check user API Key and ensure with your administrator that the user has appropriate permissions for access., assetId=null, fileType=null, comingFrom=null

When I add the user to the Administrator group, the upload works fine. But I don’t want to give Administrator permissions to the API users.

Thank you for the information, however you did not mention what version of Razuna you are using in any of your replies, hence the question.

That said, there is no issue with uploading through the API with users that are not systemadmins. I just tried it again and it works as expected.

Here is my code:

curl -X POST -H "Expect: " -F fa=c.apiupload -F destfolderid=2DA77AAB83014CDEB3ED0C7B71FD27AD -F filedata=@large.png -F api_key=2343CBD2E38B4251BBD296AD032A3C5B http://localhost:8080/raz1/dam/index.cfm

My folder permissions:

As mentioned in one of my answers, I suspect you either using the wrong folderID or the wrong API key.

Hope this helps.

Actually on closer look, I see that we did a patch update that fixes this issue for 1.8.2. You somehow much be running once without that patch. I’m sorry that I did not catch this earlier.

However, we just release Razuna 1.8.5 which brings an approval process to Razuna. In addition, this issue is also included in the release.

You can download the new version from http://razuna.org/download now. Once again, apologies for not seeing this earlier.

Thanks a lot, that’s good news.

Unfortunately I’m not able to upgrade to 18.5. I made a database backup (H2) with the old instance. I copied all backup files to the new admin/backup directory. When starting the new instance, the backup cannot be found and therefore not restored.

There are a lot of folders that are created during setup of 1.8.5: /Users/nitai/Downloads/razuna_tomcat_1_8_5/tomcat/webapps/razuna/
I don’t think these folders are correct. Maybe a bug in 1.8.5?

I’ve just done an update yesterday from 1.8 to 1.8.5 and had no problems.

I don’t know what you mean by “there are a lot of folders”. What kind of
“folders”?

Also, what happens when you start up 1.8.5 without a restore?

I did the following:

  1. I downloaded Razuna 1.8.5. from http://razuna.org/razuna-tomcat.cfm?v=1.8.5.

  2. I unzipped the file to /opt

  3. I started the tomcat via startup.sh from razuna_tomcat_1_8_5/tomcat/bin.

After that, a lot of folders are created:

/Users/nitai/Downloads/razuna_tomcat_1_8_5/tomcat/webapps/razuna/db/

It contains one file:
razuna.lock.db

I can use Razuna, but the database and backup files are stored in /Users/nitai…

Markus

That’s rather odd, but I could see why this is so. I’ve reset the config
file and now it should default back to the default location.

Please download 1.8.5 again. You can grab it directly from
http://s.razuna.com.s3.amazonaws.com/installers/1.8.5/razuna_tomcat_1_8_5.zip

Much better. The folders are gone now. But I can’t see my backup from the 1.8.2.

I copied all files from admin/backup to the admin/backup folder of the new razuna instance. I also copied all raz#-folders as described in the wiki. But I can’t see the backup when going through the setup process.

The two files that I copied are razuna_backup.mv.db and razuna_backup.trace.db. This differs from the description in the wiki, but that’s all that was created when I made the backup.

Thanks in advance

Markus