3

I'm trying to write a bash script that would publish a list of files already present in crafter.

Is there an API to do that? And I suppose you need to be logged in first.

Thank you

Nicolas Dufour
  • 203
  • 1
  • 5

2 Answers2

5

Try using the Bulk Publish API, like this:

POST /api/1/services/api/1/deployment/bulk-golive.json?site={siteName}&path={path}&environment={env}

You will need to be logged in, so login and save the cookie to use when calling this API.

sumerz
  • 1,346
  • 7
  • 4
4

Adding to sumerz response you could use this to log in

curl -i -b cookies.txt -H "Content-Type:application/x-www-form-urlencoded" -H "Accept:application/json, text/plain, */*"  -c cookies.txt -X POST -d "username=admin&password=admin" http://localhost:8080/studio/api/1/services/api/1/user/login.json

then you could use -b and -c to make curl aware of a session.

Cortiz
  • 839
  • 4
  • 7