...
First, encode your new password as a base 64 string. You can do this on Linux using the base64 utility. For example:
Code Block |
---|
$ echo -n 'This is the password' | base64 VGhpcyBpcyB0aGUgcGFzc3dvcmQKVGhpcyBpcyB0aGUgcGFzc3dvcmQ= |
Create a file with the XML update payload
...
Code Block |
---|
<ns2:accounts_common xmlns:ns2="http://collectionspace.org/services/account"> <userId>admin@core.collectionspace.org</userId> <password>VGhpcyBpcyB0aGUgcGFzc3dvcmQK<<password>VGhpcyBpcyB0aGUgcGFzc3dvcmQ=</password> </ns2:accounts_common> |
...
Once you have the account's CSID, you can make an HTTP PUT request that looks something like this:
Code Block |
---|
curl -X POSTPUT http://${domain}:8180/cspace-services/accounts/${csid} -i -u ${user}:${password} -H "Content-Type: application/xml" -T ${file} |
...