Database.com REST API Developer's Guide - Salesforce.com
Database.com REST API Developer's Guide - Salesforce.com
Database.com REST API Developer's Guide - Salesforce.com
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Using <strong>REST</strong> <strong>API</strong> ResourcesManage User PasswordsThe examples in this section use <strong>REST</strong> <strong>API</strong> resources to manage user passwords, such as setting or resetting passwords.Manage User PasswordsUse the SObject User Password resource to set, reset, or get information about a user password. Use the HTTP GET methodto get password expiration status, the HTTP POST method to set the password, and the HTTP DELETE method to resetthe password.The associated session must have permission to access the given user password information. If the session does not have properpermissions, an HTTP error 403 response is returned from these methods.Here is an example of retrieving the current password expiration status for a user:Example usage for getting current password expiration statuscurlhttps://na1.salesforce.<strong>com</strong>/services/data/v25.0/sobjects/User/005D0000001KyEIIA0/password-H "Authorization: Bearer token"Example request body for getting current password expiration statusNone requiredJSON example response body for getting current password expiration status{}"isExpired" : falseXML example response body for getting current password expiration statusfalseExample error response if session has insufficient privileges{}"message" : "You do not have permission to view this record.","errorCode" : "INSUFFICIENT_ACCESS"Here is an example of changing the password for a given user:Example usage for changing a user passwordcurlhttps://na1.salesforce.<strong>com</strong>/services/data/v25.0/sobjects/User/005D0000001KyEIIA0/password-H "Authorization: Bearer token" —H "Content-Type: application/json" —d @newpwd.json—X POST46