The example below demonstrates how to invoke the Run Archive Policy REST API with the following assumptions:
You are using cURL from the Unix command line, and are presently working from the home (~) directory of the admin user myUser
You have the Live Artifactory instance running on your local system on port 8082
You wish to run an archive policy called myPolicy
You have configured an admin user named
myUser
, with the passwordmyP455w0rd!
Your API Key is
ABcdEF
To execute a call using basic authentication, you would use the following command:
curl -u myUser:myP455w0rd! -X POST http://SERVER_HOSTNAME:8082/artifactory/api/retention/archive/policies/mPolicy/trigger
To execute a call using your API Key for basic authentication, you would use the following command:
curl -u myUser:ABcdEF -X POST http://SERVER_HOSTNAME:8082/artifactory/api/retention/archive/policies/mPolicy/trigger
To execute a call using your API Key in a header, you would use the following command:
curl -H "X-JFrog-Art-Api:ABcdEF" -X POST http://SERVER_HOSTNAME:8082/artifactory/api/retention/archive/policies/mPolicy/trigger
To execute a call using an access token for basic authentication, you would use the following command:
curl -u myUser:<Token> -X POST http://SERVER_HOSTNAME:8082/artifactory/api/retention/archive/policies/mPolicy/trigger
To execute a call access token in a header, you would use the following command:
curl -H "Authorization: Bearer <Token>" -X POST http://SERVER_HOSTNAME:8082/artifactory/api/retention/archive/policies/mPolicy/trigger