Import and publish apps via API

Confluence User - 17 Nov, 2016

Hi,

Is there a way to import an app zip file via API and publish it. I'm trying to automate testing for my app and need to configure an app from scratch based on specific joget release.

Please let me know a way to archive this.

Thanks

server;installation;configration

2


17 Nov, 2016
confluenceUser
confluenceUser

Hi there!

Could you try using JSON API#web/json/apps/install?

Or if you need to import apps from the filesystem, you could call the POST .../console/app/import/submit API with proper authentication and appZip header having the path to the app.

For publishing the app, you could try using POST .../console/app/(*:appId)/(~:version)/publish & see if that works.

 

Hope this helps!

Thanks

18 Nov, 2016
confluenceUser
confluenceUser
Hi,

I tried local file import with POST request. It fails authentication even with OWASP Token. I Used curl to post.

* get token & save cookies
curl -k -X POST -c /tmp/jogetcookie.txt -e 'https://localhost:8080/jw/web/console/app/import' 'https://localhost:8080/jw/csrf?j_username=prov.bot&hash=FEA4057E678D7E408B665E8EFC2BA564&loginAs=prov.bot' -H "Content-Type: application/json" -H "FETCH-CSRF-TOKEN:1"

* use token and cookies
curl -vk -X POST -b /tmp/jogetcookie.txt --data-binary @workflow/workflow.zip --data-binary @workflow/form-data.txt 'https://localhost:8080/jw/web/console/app/import/submit?j_username=admin&hash=FEA4057E678D7E408B665E8EFC2BA564&loginAs=admin&OWASP_CSRFTOKEN=<TOKEN_RECEIVED>'

* form-data.txt
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Content Start >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
------WebKitFormBoundaryT1gATXIc4GoFdPOo
Content-Disposition: form-data; name="appZip"; filename="workflow.zip"
Content-Type: application/zip


------WebKitFormBoundaryT1gATXIc4GoFdPOo
Content-Disposition: form-data; name="OWASP_CSRFTOKEN"

<TOKEN_RECEIVED>
------WebKitFormBoundaryT1gATXIc4GoFdPOo--
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Content End >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print