How to effectively used Razuna Api to search, create and upload Asset faster

i am working on Razuna from past 3 month and i really like features provided by Rauna for Managing the content.
But one feature on which Razuna team should work on is API calls.

I had faced an issue in my test and development environment where uploading an image file of size 2 mb on Razuna was taking more than 3- 4 minutes, resulting into transaction timeout.

After going through the code return by previous developer , i came to know that in order to upload content to a specific folder on Razuna , we need to first get the folderid of the parent folder then get the all subfolders of the parent folder and check whether folder in which content has to be uploaded is present or not and if folder is not present then again get list of subfolder in that folder and again loop through it.

As the number of folder increeasd in our Razuna, time taken to search and upload assets also increased.

After optimising the code i was able to upload 2 mb of file in 20 second(still slow but lot better than 4 minutes.)

i request Razuna team to create apis which help us to use Razuna effectively.

I have created this topic to help Razuna users to share codes and optimize it to achieve better result with razuna API.

Can you please share the code optimizations you made so we can look at it.

Rav,

While we appreciate any productive criticism, telling us to “…learn how to create apis…” is most likely not the best way to go about it. Wouldn’t you agree?

Reading your description actually makes me wonder why you even need to loop through folders. Furthermore, uploading has nothing to do with “looping over folder”. 2MB taking 3-4 minutes?

I’ve created my fair share of API applications and done many for Razuna. I’ve yet to come over such a use case as you describe.

May I consider that you maybe rethink your approach?

Nitai,

i guess you misunderstood me, i wanted to convey that if razuna is able to provide more number of api’s that meet user
requirement it will be more beneficial for users as well as to Razuna.

As per my comment of uploading file taking 3-4 minutes, it includes searching of folder in which asset has to be uploaded, if folder is not present then creating that folder and uploading the asset in that folder. All this to be done using java and calling razuna api.

My case:

suppose i need to upload an asset in folder with path ParentFolder/subfolder/subfolder2, here subfolder and subfolder2 is not present in Razuna and i need to upload the asset in subfolder2.

can you provide me better approach to upload file in subfloder2. i have following 2 things with me:

  1. complete path of subfolder2 i.e ParentFolder/subfolder/subfolder2
  2. file to be uploaded.

Your help will be greatly appreciated.

Ok. No problem. We haven’t received many more requests for the API, as many users and companies tell us that they can do everything with the current API methods. If you have anything specific in mind you can send us a request for that.

I don’t know the steps (methods you use) for your use case so I can’t suggest a “better approach”.

i already mentioned it in my previous comment about it. but i will again write it down for you.

firstly i try to get the folderid of parentfolder , then i get the list of all subfolder. once i get all the subfolder, i iterate through that list to get the sufolderid and then find the subfolder inside it.

if i am unable to find the subfolder, i try to create it and then upload the asset into it.

I’ve asked for the methods. In any case, why don’t you store the API results in a local DB and sync periodically? For sure better and faster and the Razuna server doesn’t need to get hit.