Skip to main content
GET
/
CanviPassword
CanviPassword
curl --request GET \
  --url https://api.example.com/CanviPassword
{
  "CodiRetorn": 123,
  "DescRetorn": "<string>"
}

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

pIMEI
string
required
Device identifier: maximum 15 alphanumeric positions
pAgent
string
required
Agent code: maximum 5 alphanumeric positions
pOldPass
string
required
Current password
pNewPass
string
required
New password to be set

Response Schema

The endpoint returns a tRetorn object:
CodiRetorn
integer
Return code indicating the operation result
DescRetorn
string
Return description with additional details about the operation

Error Codes

CodeDescription
0Success - password changed successfully
-1Device not found or new password was not set
-2Agent does not belong to the device’s municipality
-3Current password is incorrect
-4Password could not be modified due to database error
-9000General error different from the above
Other negativeDatabase 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

Build docs developers (and LLMs) love