Here’s a sample POST request that resets the passwords for the tenant named Finance to start123. The empty request body has a content type of JSON. The request is made using a system-level user account that includes the administrator role.
Request with cURL command line
curl -k -i -d "{}" -H "Content-Type: application/json"
-H "Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"
"https://admin.hcp.example.com:9090/mapi/tenants/finance/userAccounts
?resetPasswords=start123"
Request in Python using PycURL
import pycurl
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP \
YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"])
curl.setopt(pycurl.URL,
"https://admin.hcp-ca.example.com:9090/mapi/tenants/finance/" +
"userAccounts?resetPasswords=start123")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.CUSTOMREQUEST, "POST")
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
Request headers
POST /mapi/tenants/finance/userAccounts?resetPasswords=start123 HTTP/1.1
Host: admin.hcp.example.com:9090
Accept: */*
Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382
Content-Type: application/json
Content-Length: 2
Response headers
HTTP/1.1 200 OK
Content-Type: application/xml
X-HCP-SoftwareVersion: 9.0.0.2
Content-Length: 0
© 2015, 2020 Hitachi Vantara LLC. All rights reserved.