Overview
The CanviPassword endpoint allows an agent to change their password. The agent must provide their current password along with the new password they wish to set.
Authentication
This endpoint requires a valid device identifier (IMEI), agent code (pAgent), and the current password (pOldPass) for authentication before changing to the new password.
Query Parameters
Device identifier: maximum 15 alphanumeric positions
Agent code: maximum 5 alphanumeric positions
Response Schema
The endpoint returns a tRetorn object:
Return code indicating the operation result
Return description with additional details about the operation
Error Codes
| Code | Description |
|---|
| 0 | Success - password changed successfully |
| -1 | Device not found or new password was not set |
| -2 | Agent does not belong to the device’s municipality |
| -3 | Current password is incorrect |
| -4 | Password could not be modified due to database error |
| -9000 | General error different from the above |
| Other negative | Database error |
Usage Examples
cURL
curl -X GET "https://pdaprv16.orgt.diba.cat/RestMultesPDA/svcMultesPDA.svc/rest/CanviPassword?pIMEI=353947020131525&pAgent=501&pOldPass=oldpass123&pNewPass=newpass456" \
-H "Accept: application/xml"
Example Response - Success
<tRetorn xmlns="http://schemas.datacontract.org/2004/07/WcfMultesPDA" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CodiRetorn>0</CodiRetorn>
<DescRetorn/>
</tRetorn>
Example Response - Incorrect Current Password
<tRetorn xmlns="http://schemas.datacontract.org/2004/07/WcfMultesPDA" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CodiRetorn>-3</CodiRetorn>
<DescRetorn>La contrasenya actual és errònia</DescRetorn>
</tRetorn>
Notes
- The agent must be associated with the municipality of the device
- The current password must be correct for the change to succeed
- After a successful password change, use the new password for subsequent authentications
- If the
/FerLogin endpoint returns Canviar=true, the agent should be prompted to change their password using this endpoint
- Password changes are immediately effective in the system