Hi Team,
Our requirement is to import assets presents in network mounted drive. We decided to use ACS Commons URL Asset Import. This fits to our requirement and importing assets in lower environment.
But in higher environments, We can't perform any step manually. Everything has to be done either using some job or some utility. We are not allowed to create/start process manually.
Is there any way I can trigger URL Asset Import by using API or some other means.
Any help/approach please
Views
Replies
Total Likes
Hi @jnmatthew ,
You can execute this using curl or rest call using any client ex. postman
@sunil_kumar_could you please share sample curl. Or there is any process to get curl
@jnmatthew This has been tested on MAC/Terminal. May need to adjust as per OS/Terminal in case you face encoding related issue.
curl -u admin:admin POST 'http://localhost:4502/apps/acs-commons/content/manage-controlled-processes/jcr:content.start.json' \ --form 'definition="URL Asset Import"' \ --form 'retryPause="200"' \ --form 'dryRunMode="true"' \ --form 'jcrBasePath="/content/dam"' \ --form 'importFile=@"/Users/<your-path-to-file>/url-asset-import-example.xlsx"' \ --form 'filename="url-asset-import-example.xlsx"' \ --form 'defaultPrefix="nfile"' \ --form 'timeout="30000"'
I used only required parameters. Add other parameters as per your need.
Thanks, It is working for me. Don't have any utility or process to get curl for operations. It almost impossible to memories curl for different operations.
@jnmatthew You can get curl at high level from your browser. I prefer chrome.
When you perform any operation.
Go to Network tab. On your specific call. Right click and copy as curl. You will get curl with headers. Remove headers and adjust as per your need. You have to -u to add credentials.
By using this, you will get only high level curl.
Using postman- Set rest call in postman. Once your rest call work as expected. Copy as curl. You have to adjust that with -u and remove token. means adjust so that you can use this in terminal to Jenkins.
I hope this will help.
@jnmatthew Sample curl command to execute the servlet :
curl -u <username>:<password> -i -XPOST http://<domain-name>:<domain-port>/<servlet-path>
and if you want to pass the file along with it, you can use:
curl -u <username>:<password> -i -XPOST -F "file=@<filepath>" http://<domain-name>:<domain-port>/<servlet-path>
Some of the other examples of the curl commands can be found in the below link:
Thanks
Thank @ShaileshBassi
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies