In CrafterCMS, how can I publish content via the API?

I am trying to write a bash script that will post a list of files already present in the Crafter.

Is there an API for this? And I suppose you need to login first.

thank

+3


source to share


2 answers


Try using Bulk Publish API, for example:

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



You will need to be logged in to log in and store a cookie to use when calling this API.

+5


source


Adding to sumerz's answer you can use it to login

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 can use -b and -c to make a curl in the session.

+4


source







All Articles