Overview
The ObtenirRang endpoint requests new ranges of ticket/fine record numbers for a device, enabling offline work. This is the recommended endpoint instead of the deprecated DemanarRang.
Authentication
This endpoint requires a valid device identifier (IMEI) that has been previously registered in the system.
Query Parameters
Device identifier: maximum 15 alphanumeric positions
Set to 1 to request the primary range, 0 if not needed
Set to 1 to request the secondary range, 0 if not needed
Response Schema
The endpoint returns a Rang object containing:
Return object with operation resultReturn code indicating the operation result
Return description with additional details
Minimum value of the primary range
Maximum value of the primary range
Minimum value of the secondary range
Maximum value of the secondary range
Error Codes
| Code | Description |
|---|
| 0 | Success - ranges assigned successfully |
| -1 | Application error - invalid request or device not found |
| -9000 | Uncontrolled exception |
| Other negative | Database error |
Usage Examples
cURL - Request Both Ranges
curl -X GET "https://pdaprv16.orgt.diba.cat/RestMultesPDA/svcMultesPDA.svc/rest/ObtenirRang?pImei=353947020131525&pEstat1=1&pEstat2=1" \
-H "Accept: application/xml"
cURL - Request Only Primary Range
curl -X GET "https://pdaprv16.orgt.diba.cat/RestMultesPDA/svcMultesPDA.svc/rest/ObtenirRang?pImei=353947020131525&pEstat1=1&pEstat2=0" \
-H "Accept: application/xml"
Example Response
<Rang xmlns="http://schemas.datacontract.org/2004/07/WcfMultesPDA" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<MaxRang1>1590630</MaxRang1>
<MaxRang2>1590640</MaxRang2>
<MinRang2>1590631</MinRang2>
<Minrang1>1590621</Minrang1>
<Retorn>
<CodiRetorn>0</CodiRetorn>
<DescRetorn/>
</Retorn>
</Rang>
Notes
- This endpoint is recommended over the deprecated
DemanarRang endpoint
- The returned ranges must be used when creating new fines/tickets with the
/AltaMulta endpoint
- Record numbers must be within the assigned ranges to be valid
- Request new ranges before the current ranges are exhausted to ensure uninterrupted offline operation
- Both primary (Rang1) and secondary (Rang2) ranges can be requested independently