Skip to main content
GET
/
ObtenirRang
ObtenirRang
curl --request GET \
  --url https://api.example.com/ObtenirRang
{
  "Retorn": {
    "CodiRetorn": 123,
    "DescRetorn": "<string>"
  },
  "Minrang1": 123,
  "MaxRang1": 123,
  "MinRang2": 123,
  "MaxRang2": 123
}

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

pImei
string
required
Device identifier: maximum 15 alphanumeric positions
pEstat1
integer
required
Set to 1 to request the primary range, 0 if not needed
pEstat2
integer
required
Set to 1 to request the secondary range, 0 if not needed

Response Schema

The endpoint returns a Rang object containing:
Retorn
object
Return object with operation result
CodiRetorn
integer
Return code indicating the operation result
DescRetorn
string
Return description with additional details
Minrang1
integer
Minimum value of the primary range
MaxRang1
integer
Maximum value of the primary range
MinRang2
integer
Minimum value of the secondary range
MaxRang2
integer
Maximum value of the secondary range

Error Codes

CodeDescription
0Success - ranges assigned successfully
-1Application error - invalid request or device not found
-9000Uncontrolled exception
Other negativeDatabase 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

Build docs developers (and LLMs) love